1 /*
2     KSysGuard, the KDE System Guard
3 
4     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
5 
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 as published by the Free Software Foundation; either
9     version 2 of the License, or (at your option) any later version.
10 
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.
15 
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.
19 
20 */
21 
22 #ifndef KSG_DANCINGBARSSETTINGS_H
23 #define KSG_DANCINGBARSSETTINGS_H
24 
25 
26 #include <KPageDialog>
27 
28 #include "SensorModel.h"
29 
30 class KColorButton;
31 class QDoubleSpinBox;
32 class QLineEdit;
33 
34 class QCheckBox;
35 class QPushButton;
36 class QSpinBox;
37 class QTreeView;
38 
39 class DancingBarsSettings : public KPageDialog
40 {
41   Q_OBJECT
42 
43   public:
44     explicit DancingBarsSettings( QWidget* parent = nullptr, const QString &name = QString() );
45     ~DancingBarsSettings();
46 
47     void setTitle( const QString& title );
48     QString title() const;
49 
50     void setMinValue( double min );
51     double minValue() const;
52 
53     void setMaxValue( double max );
54     double maxValue() const;
55 
56     void setUseLowerLimit( bool value );
57     bool useLowerLimit() const;
58 
59     void setLowerLimit( double limit );
60     double lowerLimit() const;
61 
62     void setUseUpperLimit( bool value );
63     bool useUpperLimit() const;
64 
65     void setUpperLimit( double limit );
66     double upperLimit() const;
67 
68     void setForegroundColor( const QColor &color );
69     QColor foregroundColor() const;
70 
71     void setAlarmColor( const QColor &color );
72     QColor alarmColor() const;
73 
74     void setBackgroundColor( const QColor &color );
75     QColor backgroundColor() const;
76 
77     void setFontSize( int size );
78     int fontSize() const;
79 
80     void setSensors( const SensorModelEntry::List &list );
81     SensorModelEntry::List sensors() const;
82 
83     QList<uint> getDeletedIds();
84 
85   private Q_SLOTS:
86     void editSensor();
87     void removeSensor();
88 
89   private:
90     KColorButton *mForegroundColor;
91     KColorButton *mAlarmColor;
92     KColorButton *mBackgroundColor;
93     QDoubleSpinBox *mMinValue;
94     QDoubleSpinBox *mMaxValue;
95     QDoubleSpinBox *mLowerLimit;
96     QDoubleSpinBox *mUpperLimit;
97     QLineEdit *mTitle;
98     QSpinBox *mFontSize;
99 
100     QCheckBox *mUseLowerLimit;
101     QCheckBox *mUseUpperLimit;
102     QPushButton *mEditButton;
103     QPushButton *mRemoveButton;
104 
105     QList<uint> deletedIds;
106 
107     QTreeView *mView;
108     SensorModel *mModel;
109 };
110 
111 #endif
112