Vidalia  0.2.21
IpValidator.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file IpValidator.h
13 ** \brief Validates an entered IP address
14 */
15 
16 #ifndef _IPVALIDATOR_H
17 #define _IPVALIDATOR_H
18 
19 #include <QRegExpValidator>
20 
21 
22 class IpValidator : public QRegExpValidator
23 {
24 public:
25  /** Constructor. */
26  IpValidator(QObject *parent);
27  /** Validates the given input from position 0. */
28  QValidator::State validate(QString &input) const;
29  /** Validates the given input is either a valid IP or a "*". */
30  QValidator::State validate(QString &input, int &pos) const;
31 };
32 
33 #endif
34