• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Member Functions | Protected Attributes | List of all members
KStringListValidator Class Reference

#include <kstringvalidator.h>

Inherits TQValidator.

Public Member Functions

 KStringListValidator (const TQStringList &list=TQStringList(), bool rejecting=true, bool fixupEnabled=false, TQObject *parent=0, const char *name=0)
 
virtual State validate (TQString &input, int &pos) const
 
virtual void fixup (TQString &input) const
 
void setRejecting (bool rejecting)
 
bool isRejecting () const
 
void setFixupEnabled (bool fixupEnabled)
 
bool isFixupEnabled () const
 
void setStringList (const TQStringList &list)
 
TQStringList stringList () const
 

Protected Attributes

TQStringList mStringList
 
bool mRejecting
 
bool mFixupEnabled
 

Detailed Description

A TQValidator to (dis)allow certain strings.

This validator allows you to accept only certain or to accept all but certain strings.

When used in rejecting mode, accepts only strings not in the stringlist. This mode is the default and comes in handy when asking the user for a name of some listed entity. Set the list of already used names to prevent the user from entering duplicate names.

When used in non-rejecting mode, accepts only strings that appear in the stringlist. Use with care! From a user's point of view this mode is hard to grasp.

This validator can also fix strings. In rejecting mode, a number will be appended to the string until it is Acceptable. E.g. if "foo" and "foo 1" are in the stringlist, then fixup will change "foo" to "foo 2", provided "foo 2" isn't in the list of forbidden strings.

In accepting mode, when the input starts with an Acceptable substring, truncates to the longest Acceptable string. When the input is the start of an Acceptable string, completes to the shortest Acceptable string.

NOTE: fixup isn't yet implemented.

Author
Marc Mutz mutz@.nosp@m.kde..nosp@m.org

Definition at line 60 of file kstringvalidator.h.

Constructor & Destructor Documentation

◆ KStringListValidator()

KStringListValidator::KStringListValidator ( const TQStringList &  list = TQStringList(),
bool  rejecting = true,
bool  fixupEnabled = false,
TQObject *  parent = 0,
const char *  name = 0 
)
inline

Construct a new validator.

Parameters
listThe list of strings to (dis)allow.
rejectingSelects the validator's mode (rejecting: true; accepting: false)
fixupEnabledSelects whether to fix strings or not.
parentPassed to lower level constructor.
namePassed to lower level constructor

Definition at line 76 of file kstringvalidator.h.

Member Function Documentation

◆ fixup()

void KStringListValidator::fixup ( TQString &  input) const
virtual

Definition at line 49 of file kstringvalidator.cpp.

◆ isFixupEnabled()

bool KStringListValidator::isFixupEnabled ( ) const
inline

Definition at line 89 of file kstringvalidator.h.

◆ isRejecting()

bool KStringListValidator::isRejecting ( ) const
inline

Definition at line 86 of file kstringvalidator.h.

◆ setFixupEnabled()

void KStringListValidator::setFixupEnabled ( bool  fixupEnabled)
inline

Definition at line 88 of file kstringvalidator.h.

◆ setRejecting()

void KStringListValidator::setRejecting ( bool  rejecting)
inline

Definition at line 85 of file kstringvalidator.h.

◆ setStringList()

void KStringListValidator::setStringList ( const TQStringList &  list)
inline

Definition at line 91 of file kstringvalidator.h.

◆ stringList()

TQStringList KStringListValidator::stringList ( ) const
inline

Definition at line 92 of file kstringvalidator.h.

◆ validate()

TQValidator::State KStringListValidator::validate ( TQString &  input,
int &  pos 
) const
virtual

Definition at line 29 of file kstringvalidator.cpp.

Member Data Documentation

◆ mFixupEnabled

bool KStringListValidator::mFixupEnabled
protected

Definition at line 97 of file kstringvalidator.h.

◆ mRejecting

bool KStringListValidator::mRejecting
protected

Definition at line 96 of file kstringvalidator.h.

◆ mStringList

TQStringList KStringListValidator::mStringList
protected

Definition at line 95 of file kstringvalidator.h.


The documentation for this class was generated from the following files:
  • kstringvalidator.h
  • kstringvalidator.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.