22 #ifndef __KSTRINGVALIDATOR_H__
23 #define __KSTRINGVALIDATOR_H__
25 #include <tqvalidator.h>
26 #include <tqstringlist.h>
28 #include <tdelibs_export.h>
62 TQ_PROPERTY( TQStringList stringList READ stringList WRITE setStringList )
63 TQ_PROPERTY(
bool rejecting READ isRejecting WRITE setRejecting )
64 TQ_PROPERTY(
bool fixupEnabled READ isFixupEnabled WRITE setFixupEnabled )
77 bool rejecting=
true,
bool fixupEnabled=
false,
78 TQObject * parent=0,
const char * name=0 )
79 : TQValidator( parent, name ), mStringList( list ),
80 mRejecting( rejecting ), mFixupEnabled( fixupEnabled ) {}
82 virtual State validate( TQString & input,
int & pos )
const;
83 virtual void fixup( TQString & input )
const;
85 void setRejecting(
bool rejecting ) { mRejecting = rejecting; }
86 bool isRejecting()
const {
return mRejecting; }
88 void setFixupEnabled(
bool fixupEnabled ) { mFixupEnabled = fixupEnabled; }
89 bool isFixupEnabled()
const {
return mFixupEnabled; }
91 void setStringList(
const TQStringList & list ) { mStringList = list; }
92 TQStringList stringList()
const {
return mStringList; }
95 TQStringList mStringList;
124 : TQValidator( parent, name ) {}
132 virtual State validate( TQString & input,
int & pos )
const;
136 virtual void fixup( TQString & input )
const;
A TQValidator for mime types.
A TQValidator to (dis)allow certain strings.
KStringListValidator(const TQStringList &list=TQStringList(), bool rejecting=true, bool fixupEnabled=false, TQObject *parent=0, const char *name=0)
Construct a new validator.