# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# knumvalidator.h

    00001 /**********************************************************************
    00002 **
    00003 ** $Id: knumvalidator.h 353316 2004-10-10 10:36:39Z bhards $
    00004 **
    00005 ** Copyright (C) 1999 Glen Parker <glenebob@nwlink.com>
    00006 ** Copyright (C) 2002 Marc Mutz <mutz@kde.org>
    00007 **
    00008 ** This library is free software; you can redistribute it and/or
    00009 ** modify it under the terms of the GNU Library General Public
    00010 ** License as published by the Free Software Foundation; either
    00011 ** version 2 of the License, or (at your option) any later version.
    00012 **
    00013 ** This library is distributed in the hope that it will be useful,
    00014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00016 ** Library General Public License for more details.
    00017 **
    00018 ** You should have received a copy of the GNU Library General Public
    00019 ** License along with this library; if not, write to the Free
    00020 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    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

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:19 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003