KDb

KDbIdentifierValidator.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2005 Jarosław Staniek <staniek@kde.org>
3 Copyright (C) 2005 Martin Ellis <martin.ellis@kdemail.net>
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.
27class KDB_EXPORT KDbIdentifierValidator : public KDbValidator
28{
29 Q_OBJECT
30public:
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
44protected:
45 KDbValidator::Result internalCheck(const QString &valueName, const QVariant &value,
46 QString *message, QString *details) override;
47
48private:
49 class Private;
50 Private* const d;
51 Q_DISABLE_COPY(KDbIdentifierValidator)
52};
53
54#endif
Validates input for identifier.
A validator extending QValidator with offline-checking for value's validity.
QValidator::State validate(QString &input, int &pos) const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.