1 /*
2  * Copyright 2013-2015  Christian Dávid <christian-david@web.de>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef IBANVALIDATOR_H
19 #define IBANVALIDATOR_H
20 
21 #include "kmm_widgets_export.h"
22 
23 #include <QValidator>
24 
25 #include "kmymoneyvalidationfeedback.h"
26 
27 namespace eWidgets { namespace ValidationFeedback { enum class MessageType; } }
28 
29 class KMM_WIDGETS_EXPORT ibanValidator : public QValidator
30 {
31   Q_OBJECT
32 
33 public:
34   explicit ibanValidator(QObject* parent = 0);
35   State validate(QString& , int&) const final override;
36   State validate(const QString&) const;
37   void fixup(QString&) const final override;
38 
39   static QPair<eWidgets::ValidationFeedback::MessageType, QString> validateWithMessage(const QString&);
40 };
41 
42 #endif // IBANVALIDATOR_H
43