libyui-qt
2.53.0
QY2CharValidator.h
1
/*
2
Copyright (C) 2000-2012 Novell, Inc
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: QY2CharValidator.h
20
21
Author: Stefan Hundhammer <sh@suse.de>
22
23
This is a pure Qt object - it can be used independently of YaST2.
24
25
/-*/
26
27
28
#ifndef QY2CharValidator_h
29
#define QY2CharValidator_h
30
31
#include <qvalidator.h>
32
33
34
class
QY2CharValidator
:
public
QValidator
35
{
36
Q_OBJECT
37
38
public
:
39
40
/**
41
* Constructor.
42
*
43
* Create a validator object that checks for input characters being any one
44
* of 'validChars'. If this is empty, any input is accepted.
45
**/
46
QY2CharValidator
(
const
QString & initialValidChars,
47
QObject * parent = 0,
48
const
char
* name = 0 );
49
50
/**
51
* Destructor.
52
**/
53
~QY2CharValidator
();
54
55
/**
56
* Check user input.
57
*
58
* Reimplemented from @ref QValidator.
59
**/
60
virtual
State
validate
( QString & input,
int
& pos )
const
;
61
62
/**
63
* Set the valid input characters.
64
* If 'newValidChars' is empty, any input is accepted.
65
**/
66
void
setValidChars
(
const
QString & newValidChars )
67
{ _validChars = newValidChars; }
68
69
/**
70
* Retrieve the valid input characters.
71
**/
72
QString
validChars
()
const
{
return
_validChars; }
73
74
protected
:
75
76
QString _validChars;
77
};
78
79
#endif // QY2CharValidator_h
QY2CharValidator
Definition:
QY2CharValidator.h:35
QY2CharValidator::validChars
QString validChars() const
Retrieve the valid input characters.
Definition:
QY2CharValidator.h:72
QY2CharValidator::setValidChars
void setValidChars(const QString &newValidChars)
Set the valid input characters.
Definition:
QY2CharValidator.h:66
QY2CharValidator::validate
virtual State validate(QString &input, int &pos) const
Check user input.
Definition:
QY2CharValidator.cc:51
QY2CharValidator::~QY2CharValidator
~QY2CharValidator()
Destructor.
Definition:
QY2CharValidator.cc:44
QY2CharValidator::QY2CharValidator
QY2CharValidator(const QString &initialValidChars, QObject *parent=0, const char *name=0)
Constructor.
Definition:
QY2CharValidator.cc:34
src
QY2CharValidator.h
Generated by
1.8.18