QElectroTech  0.8-dev
numerotationcontext.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef NUMEROTATIONCONTEXT_H
19 #define NUMEROTATIONCONTEXT_H
20 
21 #include <QStringList>
22 #include <QVariant>
23 #include <QDomElement>
24 
31 {
32  public:
34  NumerotationContext (QDomElement &);
35  void clear();
36  bool addValue(const QString &,
37  const QVariant & = QVariant(1),
38  const int = 1,
39  const int = 0);
40  QString operator[] (const int &) const;
41  void operator << (const NumerotationContext &);
42  int size() const;
43  bool isEmpty() const;
44  QStringList itemAt(const int) const;
45  QString validRegExpNum () const;
46  QString validRegExpNumber() const;
47  bool keyIsAcceptable (const QString &) const;
48  bool keyIsNumber(const QString &) const;
49  QDomElement toXml(QDomDocument &, const QString&);
50  void fromXml(QDomElement &);
51  void replaceValue(int, QString);
52 
53  private:
54  QStringList content_;
55 };
56 
57 #endif // NUMEROTATIONCONTEXT_H
NumerotationContext::toXml
QDomElement toXml(QDomDocument &, const QString &)
NumerotationContext::toXml Save the numerotation context in a QDomElement under the element name str.
Definition: numerotationcontext.cpp:150
NumerotationContext::content_
QStringList content_
Definition: numerotationcontext.h:54
NumerotationContext::isEmpty
bool isEmpty() const
NumerotationContext::isEmpty.
Definition: numerotationcontext.cpp:101
NumerotationContext::replaceValue
void replaceValue(int, QString)
NumerotationContext::replaceValue This class replaces the current NC field value with content.
Definition: numerotationcontext.cpp:183
NumerotationContext::validRegExpNumber
QString validRegExpNumber() const
NumerotationContext::validRegExpNumber.
Definition: numerotationcontext.cpp:126
NumerotationContext::keyIsNumber
bool keyIsNumber(const QString &) const
NumerotationContext::keyIsNumber.
Definition: numerotationcontext.cpp:142
NumerotationContext
Definition: numerotationcontext.h:31
QET::findInDomElement
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
Definition: qet.cpp:333
NumerotationContext::size
int size() const
NumerotationContext::size.
Definition: numerotationcontext.cpp:93
NumerotationContext::operator<<
void operator<<(const NumerotationContext &)
NumerotationContext::operator << , append other.
Definition: numerotationcontext.cpp:85
qet.h
NumerotationContext::NumerotationContext
NumerotationContext()
Definition: numerotationcontext.cpp:26
NumerotationContext::clear
void clear()
NumerotationContext::clear, clear the content.
Definition: numerotationcontext.cpp:39
numerotationcontext.h
NumerotationContext::addValue
bool addValue(const QString &, const QVariant &=QVariant(1), const int=1, const int=0)
NumerotationContext::addValue add a new value on the contexte.
Definition: numerotationcontext.cpp:52
NumerotationContext::itemAt
QStringList itemAt(const int) const
NumerotationContext::itemAt.
Definition: numerotationcontext.cpp:110
NumerotationContext::operator[]
QString operator[](const int &) const
NumerotationContext::operator [].
Definition: numerotationcontext.cpp:78
NumerotationContext::validRegExpNum
QString validRegExpNum() const
validRegExpNum
Definition: numerotationcontext.cpp:118
NumerotationContext::keyIsAcceptable
bool keyIsAcceptable(const QString &) const
NumerotationContext::keyIsAcceptable.
Definition: numerotationcontext.cpp:134
NumerotationContext::fromXml
void fromXml(QDomElement &)
NumerotationContext::fromXml load numerotation context from e.
Definition: numerotationcontext.cpp:172