• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • gui
  • liboktetawidgets
addressvalidator.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef ADDRESSVALIDATOR_H
24 #define ADDRESSVALIDATOR_H
25 
26 // Okteta core
27 #include <oktetacore.h>
28 #include <address.h>
29 // Qt
30 #include <QtGui/QValidator>
31 
32 
33 namespace Okteta
34 {
35 
36 class ValueCodec;
37 
38 
39 class AddressValidator : public QValidator
40 {
41  Q_OBJECT
42 
43  public:
44  // matching Okteta::ValueCoding
45  enum Coding { InvalidCoding = -1, HexadecimalCoding=0, DecimalCoding=1, ExpressionCoding=2 };
46  //XXX shouldn't this better be in address.h? Sometime later maybe
47  enum AddressType { InvalidAddressType = -1, AbsoluteAddress = 0, RelativeForwards, RelativeBackwards};
48 
49  public:
50  explicit AddressValidator( QObject* parent, Coding codecId = HexadecimalCoding );
51  virtual ~AddressValidator();
52 
53  public: // QValidator API
54  virtual QValidator::State validate( QString& input, int& pos ) const;
55 
56  public:
57  AddressType addressType() const;
59  void setCodec( Coding codecId );
60 
61  public:
62  Address toAddress( const QString& string, AddressType* type = 0 ) const;
63  QString toString( Address address, AddressType addressType ) const;
64 
65  private:
66  Coding mCodecId;
67  ValueCodec* mValueCodec;
68 
69  static const QRegExp expressionRegex;
70 };
71 
72 }
73 
74 #endif
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AddressValidator::AbsoluteAddress
Definition: addressvalidator.h:47
Okteta::AddressValidator::RelativeBackwards
Definition: addressvalidator.h:47
Okteta::AddressValidator
Definition: addressvalidator.h:39
QObject
Okteta::AddressValidator::ExpressionCoding
Definition: addressvalidator.h:45
Okteta::AddressValidator::validate
virtual QValidator::State validate(QString &input, int &pos) const
Definition: addressvalidator.cpp:63
Okteta::AddressValidator::AddressValidator
AddressValidator(QObject *parent, Coding codecId=HexadecimalCoding)
Definition: addressvalidator.cpp:40
QValidator
Okteta::AddressValidator::toAddress
Address toAddress(const QString &string, AddressType *type=0) const
Definition: addressvalidator.cpp:97
oktetacore.h
Okteta::AddressValidator::InvalidCoding
Definition: addressvalidator.h:45
Okteta::ValueCodec
Class that is able to convert codings to and from hexadecimal, decimal, octal, and binary...
Definition: valuecodec.h:45
address.h
Okteta::AddressValidator::RelativeForwards
Definition: addressvalidator.h:47
Okteta::AddressValidator::~AddressValidator
virtual ~AddressValidator()
Definition: addressvalidator.cpp:158
Okteta::AddressValidator::setCodec
void setCodec(Coding codecId)
Sets one of the value codecs or any char codec.
Definition: addressvalidator.cpp:48
Okteta::AddressValidator::AddressType
AddressType
Definition: addressvalidator.h:47
Okteta::AddressValidator::HexadecimalCoding
Definition: addressvalidator.h:45
Okteta::AddressValidator::Coding
Coding
Definition: addressvalidator.h:45
Okteta::AddressValidator::InvalidAddressType
Definition: addressvalidator.h:47
Okteta::AddressValidator::addressType
AddressType addressType() const
Okteta::AddressValidator::toString
QString toString(Address address, AddressType addressType) const
Definition: addressvalidator.cpp:142
Okteta::AddressValidator::DecimalCoding
Definition: addressvalidator.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal