kdeui
knumvalidator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __KNUMVALIDATOR_H
00025 #define __KNUMVALIDATOR_H
00026
00027 #include <qvalidator.h>
00028
00029 #include <kdelibs_export.h>
00030
00031 class QWidget;
00032 class QString;
00033
00044 class KDEUI_EXPORT KIntValidator : public QValidator {
00045
00046 public:
00050 KIntValidator ( QWidget * parent, int base = 10, const char * name = 0 );
00054 KIntValidator ( int bottom, int top, QWidget * parent, int base = 10, const char * name = 0 );
00058 virtual ~KIntValidator ();
00062 virtual State validate ( QString &, int & ) const;
00066 virtual void fixup ( QString & ) const;
00070 virtual void setRange ( int bottom, int top );
00074 virtual void setBase ( int base );
00078 virtual int bottom () const;
00082 virtual int top () const;
00086 virtual int base () const;
00087
00088 private:
00089 int _base;
00090 int _min;
00091 int _max;
00092
00093 };
00094
00095 class KFloatValidatorPrivate;
00096
00109 class KDEUI_EXPORT KFloatValidator : public QValidator {
00110
00111 public:
00115 KFloatValidator ( QWidget * parent, const char * name = 0 );
00119 KFloatValidator ( double bottom, double top, QWidget * parent, const char * name = 0 );
00123 KFloatValidator ( double bottom, double top, bool localeAware, QWidget * parent, const char * name = 0 );
00127 virtual ~KFloatValidator ();
00131 virtual State validate ( QString &, int & ) const;
00135 virtual void fixup ( QString & ) const;
00139 virtual void setRange ( double bottom, double top );
00143 virtual double bottom () const;
00147 virtual double top () const;
00153 void setAcceptLocalizedNumbers(bool b);
00158 bool acceptLocalizedNumbers() const;
00159
00160 private:
00161 double _min;
00162 double _max;
00163
00164 KFloatValidatorPrivate *d;
00165 };
00166
00181 class KDEUI_EXPORT KDoubleValidator : public QDoubleValidator {
00182 Q_OBJECT
00183 Q_PROPERTY( bool acceptLocalizedNumbers READ acceptLocalizedNumbers WRITE setAcceptLocalizedNumbers )
00184 public:
00188 KDoubleValidator( QObject * parent, const char * name=0 );
00192 KDoubleValidator( double bottom, double top, int decimals,
00193 QObject * parent, const char * name=0 );
00196 virtual ~KDoubleValidator();
00197
00199 virtual QValidator::State validate( QString & input, int & pos ) const;
00200
00202 bool acceptLocalizedNumbers() const;
00204 void setAcceptLocalizedNumbers( bool accept );
00205
00206 private:
00207 typedef QDoubleValidator base;
00208 class Private;
00209 Private * d;
00210 };
00211
00212 #endif