kradio4  r778
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
stationselector.h
Go to the documentation of this file.
1 /***************************************************************************
2  StationSelector.h - description
3  -------------------
4  begin : Son Aug 3 2003
5  copyright : (C) 2003 by Martin Witte
6  email : emw-kradio@nocabal.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KRADIO_STATIONSELECTOR_H
19 #define KRADIO_STATIONSELECTOR_H
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <QtCore/QStringList>
26 #include <QtGui/QWidget>
27 
28 #include "radio_interfaces.h"
29 #include "stationselection_interfaces.h"
30 #include "stationlist.h"
31 
32 #include "radiostation-listview.h"
33 
34 #ifdef KRADIO_ENABLE_FIXMES
35  #warning "konvert from k3listview to KListWidget"
36 #endif
37 //#include <k3listview.h>
38 
39 class RadioStationListView;
40 class Ui_StationSelectorUI;
41 class QGridLayout;
42 
43 class KDE_EXPORT StationSelector : public QWidget,
44  public IRadioClient,
45  public IStationSelectionClient
46 {
47 Q_OBJECT
48 public :
49  StationSelector (QWidget *parent);
50  ~StationSelector ();
51 
52  bool connectI (Interface *i);
53  bool disconnectI (Interface *i);
54 
55 // IStationSelectionClient
56 
57  bool noticeStationSelectionChanged(const QStringList &sl);
58 
59 // IRadioClient
60 
61  bool noticePowerChanged(bool /*on*/) { return false; }
62  bool noticeStationChanged (const RadioStation &, int /*idx*/) { return false; }
63  bool noticeStationsChanged(const StationList &sl);
64  bool noticePresetFileChanged(const QString &/*f*/) { return false; }
65 
66  bool noticeRDSStateChanged (bool /*enabled*/) { return false; }
67  bool noticeRDSRadioTextChanged (const QString &/*s*/) { return false; }
68  bool noticeRDSStationNameChanged(const QString &/*s*/) { return false; }
69 
72 
73  void saveState (KConfigGroup &) const;
74  void restoreState (KConfigGroup &);
75 
76  bool isDirty () const { return m_dirty; }
77 
78 protected slots:
79 
80  void slotButtonToLeft();
81  void slotButtonToRight();
82  void slotMoveToRight(const QStringList &list);
83  void slotMoveToLeft(const QStringList &list);
84 
85  void slotOK();
86  void slotCancel();
87  void slotSetDirty();
88 
89 signals:
90 
91  void sigDirty();
92 
93 protected:
94 
95  QGridLayout *getGridLayout();
96 
97  void moveItem (RadioStationListView *fromListView, QStringList &fromIDList,
98  Q3ListViewItem *item, int fromIdx,
99  RadioStationListView *toListView, QStringList &toIDList);
100 
101  void updateListViews();
102 
103  // station ids
104  QStringList m_stationIDsAvailable,
106  m_stationIDsNotDisplayed,
107  m_stationIDsAll;
108 
109  bool m_dirty;
110 
111  Ui_StationSelectorUI *m_ui;
112 };
113 
114 #endif
bool noticePowerChanged(bool)
bool noticeCurrentSoundStreamSourceIDChanged(SoundStreamID)
Contains a list of stations, including meta data.
Definition: stationlist.h:110
bool noticeRDSRadioTextChanged(const QString &)
Ui_StationSelectorUI * m_ui
bool noticeRDSStateChanged(bool)
QStringList m_stationIDsSelected
bool noticePresetFileChanged(const QString &)
bool noticeRDSStationNameChanged(const QString &)
bool isDirty() const
bool noticeCurrentSoundStreamSinkIDChanged(SoundStreamID)
bool noticeStationChanged(const RadioStation &, int)