]> SALOME platform Git repositories - modules/gui.git/blob - src/QDS/QDS_Validator.h
Salome HOME
a8c70a7db4a6a24cd05aaccf82312712de97b1d6
[modules/gui.git] / src / QDS / QDS_Validator.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef QDS_VALIDATOR_H
23 #define QDS_VALIDATOR_H
24
25 #include "QDS.h"
26
27 #include <QValidator>
28
29 class QDS_EXPORT QDS_IntegerValidator : public QIntValidator
30 {
31 public:
32   QDS_IntegerValidator( QObject* p = 0 );
33   QDS_IntegerValidator( const QString& f, QObject* p = 0 );
34   virtual ~QDS_IntegerValidator();
35
36   virtual State validate( QString&, int& ) const;
37
38 private:
39   QString myFilter;    //!< string filter
40 };
41
42 class QDS_DoubleValidator : public QDoubleValidator
43 {
44 public:
45   QDS_DoubleValidator( QObject* p = 0 );
46   QDS_DoubleValidator( const QString& f, QObject* p = 0 );
47   virtual ~QDS_DoubleValidator();
48
49   virtual State validate( QString&, int& ) const;
50
51 private:
52   QString myFilter;    //!< string filter
53 };
54
55 class QDS_EXPORT QDS_StringValidator : public QValidator
56 {
57 public:
58   QDS_StringValidator( QObject* p = 0 );
59   QDS_StringValidator( const QString& f, QObject* p = 0 );
60   QDS_StringValidator( const QString& ft, const QString& fg, QObject* p = 0 );
61   virtual ~QDS_StringValidator();
62
63   virtual State validate( QString&, int& ) const;
64
65   int           length() const;
66   void          setLength( const int );
67
68 private:
69   int           myLen;        //!< string length
70   QString       myFlags;      //!< string format flags
71   QString       myFilter;     //!< string filter
72 };
73
74 #endif