SVN_SILENT made messages (.desktop file)
[kdeartwork.git] / kscreensaver / kxsconfig / kxsitem.h
blob0c15c69a6ab22f60c3ea002f9779df28d4cd7c87
1 //-----------------------------------------------------------------------------
2 //
3 // KDE xscreensaver configuration dialog
4 //
5 // Copyright (c) Martin R. Jones <mjones@kde.org> 1999
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public
9 // License as published by the Free Software Foundation;
10 // version 2 of the License.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; see the file COPYING. If not, write to
19 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 // Boston, MA 02110-1301, USA.
22 #ifndef __KXSITEM_H__
23 #define __KXSITEM_H__
25 #include <KConfig>
26 #include <QStringList>
28 class QXmlAttributes;
30 class KXSConfigItem
32 public:
33 KXSConfigItem(const QString &name, KConfig &config);
34 KXSConfigItem(const QString &name, const QXmlAttributes &attr);
35 virtual ~KXSConfigItem() {}
37 virtual QString command() = 0;
38 virtual void save(KConfig &config) = 0;
39 virtual void read(KConfig &config) = 0;
41 protected:
42 QString mName;
43 QString mLabel;
46 class KXSRangeItem : public KXSConfigItem
48 public:
49 KXSRangeItem(const QString &name, KConfig &config);
50 KXSRangeItem(const QString &name, const QXmlAttributes &attr);
52 virtual QString command();
53 virtual void save(KConfig &config);
54 virtual void read(KConfig &config);
56 protected:
57 QString mSwitch;
58 int mMinimum;
59 int mMaximum;
60 int mValue;
61 bool mInvert;
64 class KXSDoubleRangeItem : public KXSConfigItem
66 public:
67 KXSDoubleRangeItem(const QString &name, KConfig &config);
68 KXSDoubleRangeItem(const QString &name, const QXmlAttributes &attr);
70 virtual QString command();
71 virtual void read(KConfig &config);
72 virtual void save(KConfig &config);
74 protected:
75 QString mSwitch;
76 double mMinimum;
77 double mMaximum;
78 double mValue;
79 bool mInvert;
82 class KXSBoolItem : public KXSConfigItem
84 public:
85 KXSBoolItem(const QString &name, KConfig &config);
86 KXSBoolItem(const QString &name, const QXmlAttributes &attr);
88 virtual QString command();
89 virtual void read(KConfig &config);
90 virtual void save(KConfig &config);
92 protected:
93 QString mSwitchOn;
94 QString mSwitchOff;
95 bool mValue;
98 class KXSSelectItem : public KXSConfigItem
100 public:
101 KXSSelectItem(const QString &name, KConfig &config);
102 KXSSelectItem(const QString &name, const QXmlAttributes &attr);
104 virtual void addOption(const QXmlAttributes &attr);
106 virtual QString command();
108 virtual void read(KConfig &config);
109 virtual void save(KConfig &config);
111 protected:
112 QStringList mOptions;
113 QStringList mSwitches;
114 int mValue;
117 class KXSStringItem : public KXSConfigItem
119 public:
120 KXSStringItem(const QString &name, KConfig &config);
121 KXSStringItem(const QString &name, const QXmlAttributes &attr);
123 virtual QString command();
124 virtual void save(KConfig &config);
125 virtual void read(KConfig &config);
127 protected:
128 QString mSwitch;
129 QString mValue;
132 #endif