QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
numerotationcontext.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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 const int = 0,
41 const QString & = QString());
44 static QString formatOf(const QStringList &item);
45 QString operator[] (const int &) const;
47 int size() const;
48 bool isEmpty() const;
49 QStringList itemAt(const int) const;
50 QString validRegExpNum () const;
51 QString validRegExpNumber() const;
52 bool keyIsAcceptable (const QString &) const;
53 bool keyIsNumber(const QString &) const;
54 QDomElement toXml(QDomDocument &, const QString&);
55 void fromXml(QDomElement &);
56 void replaceValue(int, QString);
57 void replaceIncrease(int, int);
61 static QString formatValue(const QStringList &item);
62
63 private:
64 QStringList content_;
65};
66
67#endif // NUMEROTATIONCONTEXT_H
static QString formatValue(const QStringList &item)
NumerotationContext::formatValue.
Definition numerotationcontext.cpp:262
void fromXml(QDomElement &)
NumerotationContext::fromXml load numerotation context from e.
Definition numerotationcontext.cpp:201
bool addValue(const QString &, const QVariant &=QVariant(1), const int=1, const int=0, const int=0, const QString &=QString())
NumerotationContext::addValue add a new value on the contexte.
Definition numerotationcontext.cpp:61
QDomElement toXml(QDomDocument &, const QString &)
NumerotationContext::toXml Save the numerotation context in a QDomElement under the element name str.
Definition numerotationcontext.cpp:173
QString operator[](const int &) const
NumerotationContext::operator [].
Definition numerotationcontext.cpp:93
QString validRegExpNumber() const
NumerotationContext::validRegExpNumber.
Definition numerotationcontext.cpp:146
static QString formatOf(const QStringList &item)
NumerotationContext::formatOf.
Definition numerotationcontext.cpp:247
void replaceValue(int, QString)
NumerotationContext::replaceValue This class replaces the current NC field value with content.
Definition numerotationcontext.cpp:212
bool isEmpty() const
NumerotationContext::isEmpty.
Definition numerotationcontext.cpp:118
QString validRegExpNum() const
validRegExpNum
Definition numerotationcontext.cpp:137
QStringList content_
Definition numerotationcontext.h:64
bool keyIsNumber(const QString &) const
NumerotationContext::keyIsNumber.
Definition numerotationcontext.cpp:164
QStringList itemAt(const int) const
NumerotationContext::itemAt.
Definition numerotationcontext.cpp:128
NumerotationContext()
Definition numerotationcontext.cpp:28
bool keyIsAcceptable(const QString &) const
NumerotationContext::keyIsAcceptable.
Definition numerotationcontext.cpp:155
void operator<<(const NumerotationContext &)
NumerotationContext::operator << , append other.
Definition numerotationcontext.cpp:101
void replaceIncrease(int, int)
NumerotationContext::replaceIncrease Change how much this part advances per step, leaving its current...
Definition numerotationcontext.cpp:231
int size() const
NumerotationContext::size.
Definition numerotationcontext.cpp:109
void clear()
NumerotationContext::clear, clear the content.
Definition numerotationcontext.cpp:42