KDb

KDbIdentifierValidator.h
1 /* This file is part of the KDE project
2  Copyright (C) 2003-2005 JarosÅ‚aw Staniek <[email protected]>
3  Copyright (C) 2005 Martin Ellis <[email protected]>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this program; see the file COPYING. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KDB_TOOLS_IDENTIFIER_H
22 #define KDB_TOOLS_IDENTIFIER_H
23 
24 #include "KDbValidator.h"
25 
26 //! Validates input for identifier.
27 class KDB_EXPORT KDbIdentifierValidator : public KDbValidator
28 {
29  Q_OBJECT
30 public:
31  explicit KDbIdentifierValidator(QObject * parent = nullptr);
32 
33  ~KDbIdentifierValidator() override;
34 
35  State validate(QString &input, int &pos) const override;
36 
37  //! @return true if upper-case letters in the input are replaced to lower-case.
38  //! @c false by default.
39  bool isLowerCaseForced() const;
40 
41  //! If @a set is true, upper-case letters in the input are replaced to lower-case.
42  void setLowerCaseForced(bool set);
43 
44 protected:
45  KDbValidator::Result internalCheck(const QString &valueName, const QVariant &value,
46  QString *message, QString *details) override;
47 
48 private:
49  class Private;
50  Private* const d;
52 };
53 
54 #endif
QValidator::State validate(QString &input, int &pos) const override
Validates input for identifier.
A validator extending QValidator with offline-checking for value's validity.
Definition: KDbValidator.h:41
Q_DISABLE_COPY(Class)
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:21:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.