1/*
2 Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com>
3 Copyright (C) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#ifndef EMAILVALIDATOR_H
22#define EMAILVALIDATOR_H
23
24#include "kpimutils_export.h"
25
26#include <QValidator>
27
28namespace KPIMUtils {
29
30/**
31 A validator that enforces correct email addresses.
32 @see KPIMUtils::isValidSimpleAddress
33*/
34class KPIMUTILS_EXPORT EmailValidator : public QValidator //krazy:exclude=dpointer
35{
36 public:
37 EmailValidator( QObject *parent );
38
39 virtual State validate( QString &str, int &pos ) const;
40
41 virtual void fixup( QString &str ) const;
42};
43
44}
45
46#endif
47