00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 #ifndef QDS_VALIDATOR_H 00024 #define QDS_VALIDATOR_H 00025 00026 #include "QDS.h" 00027 00028 #include <QValidator> 00029 00030 class QDS_EXPORT QDS_IntegerValidator : public QIntValidator 00031 { 00032 public: 00033 QDS_IntegerValidator( QObject* p = 0 ); 00034 QDS_IntegerValidator( const QString& f, QObject* p = 0 ); 00035 virtual ~QDS_IntegerValidator(); 00036 00037 virtual State validate( QString&, int& ) const; 00038 00039 private: 00040 QString myFilter; 00041 }; 00042 00043 class QDS_DoubleValidator : public QDoubleValidator 00044 { 00045 public: 00046 QDS_DoubleValidator( QObject* p = 0 ); 00047 QDS_DoubleValidator( const QString& f, QObject* p = 0 ); 00048 virtual ~QDS_DoubleValidator(); 00049 00050 virtual State validate( QString&, int& ) const; 00051 00052 private: 00053 QString myFilter; 00054 }; 00055 00056 class QDS_EXPORT QDS_StringValidator : public QValidator 00057 { 00058 public: 00059 QDS_StringValidator( QObject* p = 0 ); 00060 QDS_StringValidator( const QString& f, QObject* p = 0 ); 00061 QDS_StringValidator( const QString& ft, const QString& fg, QObject* p = 0 ); 00062 virtual ~QDS_StringValidator(); 00063 00064 virtual State validate( QString&, int& ) const; 00065 00066 int length() const; 00067 void setLength( const int ); 00068 00069 private: 00070 int myLen; 00071 QString myFlags; 00072 QString myFilter; 00073 }; 00074 00075 #endif