00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KRADIO_STATIONSELECTOR_H
00019 #define KRADIO_STATIONSELECTOR_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <qstringlist.h>
00026
00027 #include "radio_interfaces.h"
00028 #include "stationselection_interfaces.h"
00029 #include "stationlist.h"
00030
00031 #include <stationselector-ui.h>
00032 #include "radiostation-listview.h"
00033
00034
00035 class RadioStationListView;
00036
00037 class StationSelector : public StationSelectorUI,
00038 public IRadioClient,
00039 public IStationSelectionClient
00040 {
00041 Q_OBJECT
00042 public :
00043 StationSelector (QWidget *parent);
00044 ~StationSelector ();
00045
00046 bool connectI (Interface *i);
00047 bool disconnectI (Interface *i);
00048
00049
00050
00051 bool noticeStationSelectionChanged(const QStringList &sl);
00052
00053
00054
00055 bool noticePowerChanged(bool ) { return false; }
00056 bool noticeStationChanged (const RadioStation &, int ) { return false; }
00057 bool noticeStationsChanged(const StationList &sl);
00058 bool noticePresetFileChanged(const QString &) { return false; }
00059
00060 bool noticeCurrentSoundStreamIDChanged(SoundStreamID) { return false; }
00061
00062 void saveState (KConfig *) const;
00063 void restoreState (KConfig *);
00064
00065 bool isDirty () const { return m_dirty; }
00066
00067 protected slots:
00068
00069 void slotButtonToLeft();
00070 void slotButtonToRight();
00071 void slotMoveToRight(const QStringList &list);
00072 void slotMoveToLeft(const QStringList &list);
00073
00074 void slotOK();
00075 void slotCancel();
00076 void slotSetDirty();
00077
00078 signals:
00079
00080 void sigDirty();
00081
00082 protected:
00083
00084 void moveItem (RadioStationListView *fromListView, QStringList &fromIDList,
00085 QListViewItem *item, int fromIdx,
00086 RadioStationListView *toListView, QStringList &toIDList);
00087
00088 void updateListViews();
00089
00090
00091 QStringList m_stationIDsAvailable,
00092 m_stationIDsSelected,
00093 m_stationIDsNotDisplayed,
00094 m_stationIDsAll;
00095
00096 bool m_dirty;
00097 };
00098
00099 #endif