KDEUI
kstringvalidator.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 #ifndef KSTRINGVALIDATOR_H
00023 #define KSTRINGVALIDATOR_H
00024
00025 #include <kdeui_export.h>
00026
00027 #include <QtCore/QStringList>
00028 #include <QtGui/QValidator>
00029
00060 class KDEUI_EXPORT KStringListValidator : public QValidator
00061 {
00062 Q_OBJECT
00063 Q_PROPERTY( QStringList stringList READ stringList WRITE setStringList )
00064 Q_PROPERTY( bool rejecting READ isRejecting WRITE setRejecting )
00065 Q_PROPERTY( bool fixupEnabled READ isFixupEnabled WRITE setFixupEnabled )
00066
00067 public:
00078 explicit KStringListValidator( const QStringList &list = QStringList(),
00079 bool rejecting = true, bool fixupEnabled = false,
00080 QObject *parent = 0 );
00081
00085 ~KStringListValidator();
00086
00092 void setRejecting( bool rejecting );
00093
00097 bool isRejecting() const;
00098
00103 void setFixupEnabled( bool fixupEnabled );
00104
00108 bool isFixupEnabled() const;
00109
00114 void setStringList( const QStringList & list );
00115
00119 QStringList stringList() const;
00120
00124 virtual State validate( QString & input, int & pos ) const;
00125
00129 virtual void fixup( QString & input ) const;
00130
00131 private:
00132 class Private;
00133 Private* const d;
00134 };
00135
00153 class KDEUI_EXPORT KMimeTypeValidator : public QValidator
00154 {
00155 Q_OBJECT
00156
00157 public:
00161 explicit KMimeTypeValidator( QObject* parent = 0 );
00162
00166 ~KMimeTypeValidator();
00167
00174 virtual State validate( QString & input, int & pos ) const;
00175
00179 virtual void fixup( QString & input ) const;
00180
00181 private:
00182 class Private;
00183 Private* const d;
00184 };
00185
00186 #endif // KSTRINGVALIDATOR_H