Vidalia 0.2.15
IpValidator.h
Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file IpValidator.h
00013 ** \brief Validates an entered IP address
00014 */
00015 
00016 #ifndef _IPVALIDATOR_H
00017 #define _IPVALIDATOR_H
00018 
00019 #include <QRegExpValidator>
00020 
00021 
00022 class IpValidator : public QRegExpValidator
00023 {
00024 public:
00025   /** Constructor. */
00026   IpValidator(QObject *parent);
00027   /** Validates the given input from position 0. */
00028   QValidator::State validate(QString &input) const;
00029   /** Validates the given input is either a valid IP or a "*". */
00030   QValidator::State validate(QString &input, int &pos) const;
00031 };
00032 
00033 #endif
00034