Back to index

kdeartwork  4.3.2
kxscontrol.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // KDE xscreensaver configuration dialog
00004 //
00005 // Copyright (c)  Martin R. Jones <mjones@kde.org> 1999
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public
00009 // License as published by the Free Software Foundation;
00010 // version 2 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 GNU
00015 // 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; see the file COPYING.  If not, write to
00019 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020 // Boston, MA 02110-1301, USA.
00021 
00022 #ifndef __KXSCONTROL_H__
00023 #define __KXSCONTROL_H__
00024 
00025 #include <qwidget.h>
00026 #include <qcheckbox.h>
00027 //Added by qt3to4:
00028 #include <QLabel>
00029 
00030 #include "kxsitem.h"
00031 
00032 class QLabel;
00033 class QSlider;
00034 class QSpinBox;
00035 class QComboBox;
00036 class QLineEdit;
00037 
00038 //===========================================================================
00039 class KXSRangeControl : public QWidget, public KXSRangeItem
00040 {
00041   Q_OBJECT
00042 public:
00043   KXSRangeControl(QWidget *parent, const QString &name, KConfig &config);
00044   KXSRangeControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00045 
00046   virtual void read(KConfig &config);
00047 
00048 signals:
00049   void changed();
00050 
00051 protected slots:
00052   void slotValueChanged(int value);
00053 
00054 protected:
00055   QSlider *mSlider;
00056   QSpinBox *mSpinBox;
00057 };
00058 
00059 //===========================================================================
00060 class KXSDoubleRangeControl : public QWidget, public KXSDoubleRangeItem
00061 {
00062   Q_OBJECT
00063 public:
00064   KXSDoubleRangeControl(QWidget *parent, const QString &name, KConfig &config);
00065   KXSDoubleRangeControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00066 
00067   virtual void read(KConfig &config);
00068 
00069 signals:
00070   void changed();
00071 
00072 protected slots:
00073   void slotValueChanged(int value);
00074 
00075 protected:
00076   QSlider *mSlider;
00077   double  mStep;
00078 };
00079 
00080 //===========================================================================
00081 class KXSCheckBoxControl : public QCheckBox, public KXSBoolItem
00082 {
00083   Q_OBJECT
00084 public:
00085   KXSCheckBoxControl(QWidget *parent, const QString &name, KConfig &config);
00086   KXSCheckBoxControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00087 
00088   virtual void read(KConfig &config);
00089 
00090 signals:
00091   void changed();
00092 
00093 protected slots:
00094   void slotToggled(bool);
00095 };
00096 
00097 //===========================================================================
00098 class KXSDropListControl : public QWidget, public KXSSelectItem
00099 {
00100   Q_OBJECT
00101 public:
00102   KXSDropListControl(QWidget *parent, const QString &name, KConfig &config);
00103   KXSDropListControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00104 
00105   virtual void read(KConfig &config);
00106 
00107   virtual void addOption( const QXmlAttributes &attr );
00108 
00109 signals:
00110   void changed();
00111 
00112 protected slots:
00113   void slotActivated(int);
00114 
00115 protected:
00116   QComboBox *mCombo;
00117 };
00118 
00119 //===========================================================================
00120 class KXSLineEditControl : public QWidget, public KXSStringItem
00121 {
00122   Q_OBJECT
00123 public:
00124   KXSLineEditControl(QWidget *parent, const QString &name, KConfig &config);
00125   KXSLineEditControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00126 
00127   virtual void read(KConfig &config);
00128 
00129 signals:
00130   void changed();
00131 
00132 protected slots:
00133   void textChanged(const QString &);
00134 
00135 protected:
00136   QLineEdit *mEdit;
00137 };
00138 
00139 //===========================================================================
00140 class KXSFileControl : public QWidget, public KXSStringItem
00141 {
00142   Q_OBJECT
00143 public:
00144   KXSFileControl(QWidget *parent, const QString &name, KConfig &config);
00145   KXSFileControl(QWidget *parent, const QString &name, const QXmlAttributes &attr );
00146 
00147   virtual void read(KConfig &config);
00148 
00149 signals:
00150   void changed();
00151 
00152 protected slots:
00153   void textChanged(const QString &);
00154   void selectFile();
00155 
00156 protected:
00157   QLineEdit *mEdit;
00158 
00159 };
00160 
00161 #endif
00162