1 | /* |
2 | SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com> |
3 | SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net> |
4 | SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | |
7 | #ifndef KEMAILVALIDATOR_H |
8 | #define KEMAILVALIDATOR_H |
9 | |
10 | #include "kcompletion_export.h" |
11 | |
12 | #include <QValidator> |
13 | |
14 | /*! |
15 | * \class KEmailValidator |
16 | * \inmodule KCompletion |
17 | * |
18 | * \brief An input validator that checks for valid email addresses. |
19 | * |
20 | * \sa KEmailAddress::isValidSimpleAddress |
21 | * \since 6.0 |
22 | */ |
23 | class KCOMPLETION_EXPORT KEmailValidator : public QValidator |
24 | { |
25 | Q_OBJECT |
26 | public: |
27 | explicit KEmailValidator(QObject *parent = nullptr); |
28 | ~KEmailValidator(); |
29 | |
30 | State validate(QString &str, int &pos) const override; |
31 | void fixup(QString &str) const override; |
32 | }; |
33 | |
34 | #endif |
35 | |