pieditor.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003-2004 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef PIEDITOR_H
00012 #define PIEDITOR_H
00013 
00014 #include <qwidget.h>
00015 #include <qstring.h>
00016 #include <qvariant.h>
00017 
00018 class DoubleSpinBox;
00019 class ColorCombo;
00020 class KComboBox;
00021 class KIntSpinBox;
00022 class KLineEdit;
00023 class KURLRequester;
00024 class Variant;
00025 
00026 
00030 class PIEditor : public QWidget
00031 {
00032         Q_OBJECT
00033         public:
00034                 PIEditor(QString id, Variant *data, QWidget *parent = 0, const char *name = 0);
00035                 ~PIEditor();
00036                 
00037         public slots:
00038                 virtual void valueChanged( QVariant variant );
00039                 
00040         signals:
00041                 void editorDataChanged(const QString &id, QVariant data);
00042                 
00043         protected:
00044                 QString m_id;
00045                 Variant *m_data;
00046 };
00047 
00048 
00052 class PIBool : public PIEditor
00053 {
00054         Q_OBJECT
00055         public:
00056                 PIBool( QString id, Variant *data, QWidget *parent = 0, const char *name = 0 );
00057                 ~PIBool();
00058                 
00059                 void popup();
00060                 
00061         protected slots:
00062                 void selectChanged( int index );
00063                 virtual void valueChanged( QVariant variant );
00064                 
00065         protected:
00066                 KComboBox *m_comboBox;
00067 };
00068 
00072 class PIColor : public PIEditor
00073 {
00074         Q_OBJECT
00075         public:
00076                 PIColor(QString id, Variant *data, QWidget *parent = 0, const char *name = 0);
00077                 ~PIColor();
00078                 void popup();
00079                 
00080         protected slots:
00081                 void colorChanged(const QColor &col);
00082                 virtual void valueChanged( QVariant variant );
00083                 
00084         protected:
00085                 ColorCombo *m_combo;
00086 };
00087 
00088 
00093 class PIDouble : public PIEditor
00094 {
00095         Q_OBJECT
00096         public:
00097                 PIDouble(QString id, Variant *data, QWidget *parent = 0, const char *name = 0);
00098                 ~PIDouble();
00099                 
00100         protected slots:
00101                 void spinValueChanged(double value);
00102                 virtual void valueChanged( QVariant variant );
00103                 
00104         protected:
00105                 DoubleSpinBox *spin;
00106 };
00107 
00108 
00112 class PIFilename : public PIEditor
00113 {
00114         Q_OBJECT
00115         public:
00116                 PIFilename(QString id, Variant *data, QWidget *parent = 0, const char *name = 0);
00117                 ~PIFilename();
00118                 
00119         protected slots:
00120                 void slotURLChanged(const QString &url);
00121                 virtual void valueChanged( QVariant variant );
00122         // see comments in implementation.
00123         //void slotOpenFileDialog(KURLRequester *kurlreq);
00124                 
00125         protected:
00126                 KURLRequester *m_urlreq;
00127                 KComboBox *m_combo;
00128 };
00129 
00133 class PIInt : public PIEditor
00134 {
00135         Q_OBJECT
00136         public:
00137                 PIInt( const QString &id, Variant *data, QWidget *parent = 0, const char *name = 0);
00138                 ~PIInt();
00139         
00140         protected slots:
00141                 void spinValueChanged( int value );
00142                 virtual void valueChanged( QVariant variant );
00143         
00144         protected:
00145                 KIntSpinBox *spin;
00146 };
00147 
00148 
00152 class PILineEdit : public PIEditor
00153 {
00154         Q_OBJECT
00155         public:
00156                 PILineEdit(QString id, Variant *data, QWidget *parent = 0, const char *name = 0);
00157                 ~PILineEdit();
00158                 
00159         protected slots:
00160                 void slotEditTextChanged();
00161                 virtual void valueChanged( QVariant variant );
00162                 
00163         protected:
00164                 KLineEdit *m_edit;
00165 };
00166 
00167 
00171 class PIStringCombo : public PIEditor
00172 {
00173         Q_OBJECT
00174         public:
00175                 PIStringCombo(QString id, Variant *data, QWidget *parent, const char *name = 0);
00176                 ~PIStringCombo();
00177                 void popup();
00178                 
00179         public slots:
00180                 virtual void valueChanged( QVariant variant );
00181                 void slotComboChanged();
00182                 
00183         protected:
00184                 KComboBox *m_combo;
00185         
00186 };
00187 
00188 #endif

Generated on Tue May 8 17:05:32 2007 for KTechLab by  doxygen 1.5.1