F:/KPlato/koffice/libs/koproperty/editors/spinbox.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004  Alexander Dymo <cloudtemple@mskat.net>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KPROPERTY_SPINBOX_H
00022 #define KPROPERTY_SPINBOX_H
00023 
00024 #include <knuminput.h>
00025 
00026 #include "../widget.h"
00027 //Added by qt3to4:
00028 #include <QEvent>
00029 
00030 namespace KoProperty {
00031 
00032 class IntEdit;
00033 class DoubleEdit;
00034 
00035 // Int Editor
00036 
00037 class IntSpinBox : public KIntSpinBox
00038 {
00039         Q_OBJECT
00040 
00041         public:
00042                 IntSpinBox(int lower, int upper, int step, int value, int base=10,
00043                         IntEdit *parent=0);
00044                 virtual ~IntSpinBox() {;}
00045 
00046                 virtual void setValue(const QVariant &value);
00047 
00048                 virtual bool eventFilter(QObject *o, QEvent *e);
00049                 QLineEdit * lineEdit() const { return KIntSpinBox::lineEdit(); }
00050 };
00051 
00052 class KOPROPERTY_EXPORT IntEdit : public Widget
00053 {
00054         Q_OBJECT
00055 
00056         public:
00057                 IntEdit(Property *property, QWidget *parent=0);
00058                 virtual ~IntEdit();
00059 
00060                 virtual QVariant value() const;
00061                 virtual void setValue(const QVariant &value, bool emitChange=true);
00062                 virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
00063 
00064         protected:
00065                 virtual void setReadOnlyInternal(bool readOnly);
00066                 void updateSpinWidgets();
00067 
00068         protected slots:
00069                 void slotValueChanged(int value);
00070 
00071         private:
00072                 IntSpinBox  *m_edit;
00073 };
00074 
00075 // Double editor
00076 
00077 class DoubleSpinBox : public KDoubleSpinBox
00078 {
00079         Q_OBJECT
00080 
00081         public:
00083                 DoubleSpinBox(double lower, double upper, double step, double value=0,
00084                         int precision=2, DoubleEdit *parent=0);
00085                 virtual ~DoubleSpinBox() {;}
00086 
00087                 virtual bool eventFilter(QObject *o, QEvent *e);
00088                 QLineEdit * lineEdit() const { return KDoubleSpinBox::lineEdit(); }
00089 
00090         public slots:
00091                 virtual void setValue( const QVariant& value );
00092 };
00093 
00094 class KOPROPERTY_EXPORT DoubleEdit : public Widget
00095 {
00096         Q_OBJECT
00097 
00098         public:
00099                 DoubleEdit(Property *property, QWidget *parent=0);
00100                 virtual ~DoubleEdit();
00101 
00102                 virtual QVariant value() const;
00103                 virtual void setValue(const QVariant &value, bool emitChange=true);
00104                 virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
00105 
00106         protected:
00107                 virtual void setReadOnlyInternal(bool readOnly);
00108                 void updateSpinWidgets();
00109 
00110         protected slots:
00111                 void slotValueChanged(double value);
00112 
00113         private:
00114                 DoubleSpinBox  *m_edit;
00115 };
00116 
00117 }
00118 
00119 #endif

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1