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 | An input validator that checks for valid email addresses. |
16 | @see KEmailAddress::isValidSimpleAddress |
17 | @since 6.0 |
18 | */ |
19 | class KCOMPLETION_EXPORT KEmailValidator : public QValidator |
20 | { |
21 | Q_OBJECT |
22 | public: |
23 | explicit KEmailValidator(QObject *parent = nullptr); |
24 | ~KEmailValidator(); |
25 | |
26 | State validate(QString &str, int &pos) const override; |
27 | void fixup(QString &str) const override; |
28 | }; |
29 | |
30 | #endif |
31 | |