stationlistmodel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef STATIONLISTMODEL_H
00022 #define STATIONLISTMODEL_H
00023
00024 #include <QAbstractTableModel>
00025 #include <QPointer>
00026 #include <QList>
00027 #include "radiostation.h"
00028
00046 class stationlistModel : public QAbstractTableModel
00047 {
00048
00049 Q_OBJECT
00050
00063 Q_PROPERTY(quint64 bandwidth READ bandwidth)
00064
00065
00075 Q_PROPERTY(int numberOfActiveStreams READ numberOfActiveStreams)
00076
00077 public:
00081 explicit stationlistModel(const QPointer<QObject> parent = 0,
00082 const QPointer<QWidget> mainWidget = 0);
00083
00085 virtual ~stationlistModel();
00086
00123 enum columnInfoType {
00124 columnHeaderTitle,
00125 columnHeaderToolTip,
00126 columnHeaderWhatsThis,
00127 columnWidth,
00128 setColumnWidth,
00129 columnVisibility,
00130 setColumnVisibility,
00131 columnData,
00132 columnDataToolTip,
00133 columnDataWhatsThis
00134 };
00135
00137 quint64 bandwidth() const;
00138
00143 virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
00144
00169 QVariant columnInfo(const columnInfoType type,
00170 const int column,
00171 const qint64 row = (-1),
00172 const quint64 value = (-1)) const;
00173
00189 virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
00190
00194 virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
00195
00197 int numberOfActiveStreams() const;
00198
00200 virtual bool queryClose();
00201
00203 virtual void readProperties(const KConfigGroup & m_configGroup);
00204
00209 virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
00210
00212 virtual void saveProperties(KConfigGroup & m_configGroup);
00213
00217 virtual void sort (int column, Qt::SortOrder order = Qt::AscendingOrder);
00218
00219 signals:
00221 void bandwidthChanged();
00223 void numberOfActiveStreamsChanged();
00225 void numberOfActiveStreamsIsZero();
00226
00227 public slots:
00231 void addNewStation();
00236 void deleteStation(const int index);
00240 void record(const int index);
00243 void showConfigDialog(const int index);
00248 void stopRecording(const int index);
00249
00250 private:
00256 void helper_connectSignalsAndSlots(QPointer<radioStation> m_stream);
00258 void helper_writeStationListToGeneralSettings();
00260 quint64 internal_bandwidth;
00262 int internal_numberOfActiveStreams;
00273 QStringList * m_listOfStreamsOfWhichTheUserWantsThatTheyRip;
00276 QPointer<QWidget> m_mainWidget;
00279 QList< QPointer<radioStation> > m_stationlist;
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291 private slots:
00308 void recalculate_numberOfActiveStreams_and_bandwidth();
00310 void reloadBitrate(const qlonglong stationIndex);
00312 void reloadDataSize(const qlonglong stationIndex);
00314 void reloadMetaInterval(const qlonglong stationIndex);
00316 void reloadRelayPort(const qlonglong stationIndex);
00318 void reloadServerName(const qlonglong stationIndex);
00320 void reloadSong(const qlonglong stationIndex);
00322 void reloadStatus(const qlonglong stationIndex);
00324 void reloadStreamName(const qlonglong stationIndex);
00326 void rememberListOfStreamsWhichTheUserWantsToRip_ifNotYetDone();
00327
00328 };
00329
00330 #endif