dtor first
[personal-kdebase.git] / workspace / ksysguard / gui / SensorDisplayLib / ListView.h
blob351034db85d159fa41400667519ecc9108957261
1 /*
2 KSysGuard, the KDE System Guard
4 Copyright (c) 2001 Tobias Koenig <tokoe@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License version 2 or at your option version 3 as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef _ListView_h_
22 #define _ListView_h_
24 #include <QStandardItemModel>
25 #include <QList>
26 #include <QByteArray>
27 #include <SensorDisplay.h>
29 class ListViewSettings;
30 class QTreeView;
32 class ListView : public KSGRD::SensorDisplay
34 Q_OBJECT
35 public:
36 ListView(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
37 ~ListView() {}
39 bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& sensorDescr);
40 void answerReceived(int id, const QList<QByteArray>& answerlist);
41 void updateList();
43 bool restoreSettings(QDomElement& element);
44 bool saveSettings(QDomDocument& doc, QDomElement& element);
46 virtual bool hasSettingsDialog() const
48 return true;
51 virtual void timerTickEvent()
53 updateList();
56 void configureSettings();
58 public Q_SLOTS:
59 void applySettings();
60 void applyStyle();
62 private:
64 typedef enum { Text, Int, Float, Time, DiskStat } ColumnType;
66 QStandardItemModel mModel;
67 QTreeView *mView;
68 ListViewSettings* lvs;
69 QByteArray mHeaderSettings;
71 QList<ColumnType> mColumnTypes;
72 ColumnType convertColumnType(const QString &type) const;
75 #endif