00001 /* 00002 Copyright (C) 2008 Tim Fechtner < urwald at users dot sourceforge dot net > 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License or (at your option) version 3 or any later version 00008 accepted by the membership of KDE e.V. (or its successor approved 00009 by the membership of KDE e.V.), which shall act as a proxy 00010 defined in Section 14 of version 3 of the license. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef STATIONLISTWIDGET_H 00022 #define STATIONLISTWIDGET_H 00023 00024 #include <QTableView> 00025 #include <KMenu> 00026 #include "stationlistmodel.h" 00027 #include "customizableheaderview.h" 00028 00049 class stationlistWidget : public QTableView 00050 { 00051 00052 Q_OBJECT 00053 00054 public: 00064 explicit stationlistWidget(QWidget *parent = 0, QWidget *mainWindow = 0); 00066 virtual ~stationlistWidget(); 00071 KMenu globalContextMenu; 00076 KMenu streamContextMenu; 00078 virtual bool queryClose(); 00083 virtual void readProperties(const KConfigGroup & m_configGroup); 00088 virtual void saveProperties(KConfigGroup & m_configGroup); 00092 QPointer<stationlistModel> stationlistmodel(); 00093 00094 signals: 00099 void multipleSelected(bool value); 00104 void noneSelected(bool value); 00109 void oneSelected(bool value); 00110 00111 public slots: 00113 void addNewStation(); 00115 void deleteStation(); 00119 void displayStreamSettings(); 00121 void record(); 00134 void saveAllColumnSizes(); 00136 void stopRecord(); 00137 00138 protected: 00142 virtual void contextMenuEvent(QContextMenuEvent * e); 00150 virtual void mousePressEvent(QMouseEvent *event); 00151 00152 protected slots: 00166 virtual void selectionChanged(const QItemSelection & selected, 00167 const QItemSelection & deselected); 00168 00169 private: 00175 QPointer<stationlistModel> m_stationlistModel; 00176 00177 private slots: 00180 void saveColumnSize(const int column); 00181 }; 00182 00183 #endif