QElectroTech  0.70
numerotationcontextcommands.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 NUMEROTATIONCONTEXTCOMMANDS_H
19 #define NUMEROTATIONCONTEXTCOMMANDS_H
20 
21 #include "numerotationcontext.h"
22 
23 class NumStrategy;
24 class Diagram;
25 
30 {
31  public:
36  QString toRepresentedString ();
37 
38  private:
39  void setNumStrategy (const QString &);
40 
44 };
45 
47 {
48  public:
49  NumStrategy (Diagram * = nullptr);
50  virtual ~NumStrategy ();
51  virtual QString toRepresentedString (const QString) const = 0;
52  virtual NumerotationContext next (const NumerotationContext &, const int) const = 0;
53  virtual NumerotationContext previous (const NumerotationContext &, const int) const = 0;
54 
55  protected:
56  NumerotationContext nextString (const NumerotationContext &, const int) const;
57  NumerotationContext nextNumber (const NumerotationContext &, const int) const;
58  NumerotationContext previousNumber (const NumerotationContext &, const int) const;
59 
61 };
62 
63 class UnitNum: public NumStrategy
64 {
65  public:
66  UnitNum (Diagram *);
67  QString toRepresentedString(const QString) const override;
68  NumerotationContext next (const NumerotationContext &, const int) const override;
69  NumerotationContext previous (const NumerotationContext &, const int) const override;
70 };
71 
72 class UnitFNum: public NumStrategy
73 {
74  public:
75  UnitFNum (Diagram *);
76  QString toRepresentedString(const QString) const override;
77  NumerotationContext next (const NumerotationContext &, const int) const override;
78  NumerotationContext previous (const NumerotationContext &, const int) const override;
79 };
80 
81 class TenNum: public NumStrategy
82 {
83  public:
84  TenNum (Diagram *);
85  QString toRepresentedString(const QString) const override;
86  NumerotationContext next (const NumerotationContext &, const int) const override;
87  NumerotationContext previous (const NumerotationContext &, const int) const override;
88 };
89 
90 class TenFNum: public NumStrategy
91 {
92  public:
93  TenFNum (Diagram *);
94  QString toRepresentedString(const QString) const override;
95  NumerotationContext next (const NumerotationContext &, const int) const override;
96  NumerotationContext previous (const NumerotationContext &, const int) const override;
97 };
98 
99 class HundredNum: public NumStrategy
100 {
101  public:
102  HundredNum (Diagram *);
103  QString toRepresentedString(const QString) const override;
104  NumerotationContext next (const NumerotationContext &, const int) const override;
105  NumerotationContext previous (const NumerotationContext &, const int) const override;
106 };
107 
109 {
110  public:
111  HundredFNum (Diagram *);
112  QString toRepresentedString(const QString) const override;
113  NumerotationContext next (const NumerotationContext &, const int) const override;
114  NumerotationContext previous (const NumerotationContext &, const int) const override;
115 };
116 
117 class StringNum: public NumStrategy
118 {
119  public:
120  StringNum (Diagram *);
121  QString toRepresentedString(const QString) const override;
122  NumerotationContext next (const NumerotationContext &, const int) const override;
123  NumerotationContext previous (const NumerotationContext &, const int) const override;
124 };
125 
126 class IdFolioNum: public NumStrategy
127 {
128  public:
129  IdFolioNum (Diagram *);
130  QString toRepresentedString(const QString) const override;
131  NumerotationContext next (const NumerotationContext &, const int) const override;
132  NumerotationContext previous (const NumerotationContext &, const int) const override;
133 };
134 
135 class FolioNum: public NumStrategy
136 {
137  public:
138  FolioNum (Diagram *);
139  QString toRepresentedString(const QString) const override;
140  NumerotationContext next (const NumerotationContext &, const int) const override;
141  NumerotationContext previous (const NumerotationContext &, const int) const override;
142 };
143 
144 class PlantNum: public NumStrategy
145 {
146  public:
147  PlantNum (Diagram *);
148  QString toRepresentedString(const QString) const override;
149  NumerotationContext next (const NumerotationContext &, const int) const override;
150  NumerotationContext previous (const NumerotationContext &, const int) const override;
151 };
152 
153 class LocmachNum: public NumStrategy
154 {
155  public:
156  LocmachNum (Diagram *);
157  QString toRepresentedString(const QString) const override;
158  NumerotationContext next (const NumerotationContext &, const int) const override;
159  NumerotationContext previous (const NumerotationContext &, const int) const override;
160 };
161 
162 
164 {
165  public:
167  QString toRepresentedString(const QString) const override;
168  NumerotationContext next (const NumerotationContext &, const int) const override;
169  NumerotationContext previous (const NumerotationContext &, const int) const override;
170 };
171 
173 {
174  public:
176  QString toRepresentedString(const QString) const override;
177  NumerotationContext next (const NumerotationContext &, const int) const override;
178  NumerotationContext previous (const NumerotationContext &, const int) const override;
179 };
180 
182 {
183  public:
185  QString toRepresentedString(const QString) const override;
186  NumerotationContext next (const NumerotationContext &, const int) const override;
187  NumerotationContext previous (const NumerotationContext &, const int) const override;
188 };
189 
190 
191 #endif // NUMEROTATIONCONTEXTCOMMANDS_H
NumerotationContext next(const NumerotationContext &, const int) const override
ElementColumnNum::next.
QString toRepresentedString(const QString) const override
UnitNum::toRepresentedString.
QString toRepresentedString(const QString) const override
UnitFNum::toRepresentedString.
NumerotationContext previous(const NumerotationContext &, const int) const override
UnitFNum::previous.
NumerotationContext previousNumber(const NumerotationContext &, const int) const
NumStrategy::previousNumber.
NumerotationContext nextString(const NumerotationContext &, const int) const
NumStrategy::nextString.
NumerotationContext previous(const NumerotationContext &, const int) const override
UnitNum::previous.
NumerotationContext previous(const NumerotationContext &, const int) const override
PlantNum::previous.
NumerotationContext previous(const NumerotationContext &, const int) const override
TenNum::previous.
NumerotationContext next()
NumerotationContextCommands::next.
NumerotationContext previous(const NumerotationContext &, const int) const override
HundredNum::previous.
QString toRepresentedString(const QString) const override
FolioNum::toRepresentedString.
QString toRepresentedString(const QString) const override
ElementLineNum::toRepresentedString.
NumerotationContext previous(const NumerotationContext &, const int) const override
TenFNum::previous.
NumerotationContext next(const NumerotationContext &, const int) const override
TenFNum::next.
QString toRepresentedString(const QString) const override
PlantNum::toRepresentedString.
NumerotationContext next(const NumerotationContext &, const int) const override
ElementPrefixNum::next.
virtual NumerotationContext previous(const NumerotationContext &, const int) const =0
NumerotationContext next(const NumerotationContext &, const int) const override
UnitNum::next.
QString toRepresentedString(const QString) const override
LocmachNum::toRepresentedString.
QString toRepresentedString(const QString) const override
ElementColumnNum::toRepresentedString.
QString toRepresentedString(const QString) const override
StringNum::toRepresentedString.
QString toRepresentedString(const QString) const override
IdFolioNum::toRepresentedString.
NumerotationContext previous()
NumerotationContextCommands::previous.
NumStrategy(Diagram *=nullptr)
NumerotationContextCommands(const NumerotationContext &, Diagram *=nullptr)
Constructor.
NumerotationContext next(const NumerotationContext &, const int) const override
IdFolioNum::next.
NumerotationContext next(const NumerotationContext &, const int) const override
HundredFNum::next.
NumerotationContext next(const NumerotationContext &, const int) const override
TenNum::next.
NumerotationContext previous(const NumerotationContext &, const int) const override
HundredFNum::previous.
QString toRepresentedString(const QString) const override
HundredFNum::toRepresentedString.
NumerotationContext previous(const NumerotationContext &, const int) const override
FolioNum::previous.
NumerotationContext previous(const NumerotationContext &, const int) const override
ElementPrefixNum::previous.
virtual NumerotationContext next(const NumerotationContext &, const int) const =0
NumerotationContext next(const NumerotationContext &, const int) const override
UnitFNum::next.
NumerotationContext previous(const NumerotationContext &, const int) const override
IdFolioNum::previous.
NumerotationContext next(const NumerotationContext &, const int) const override
FolioNum::next.
NumerotationContext nextNumber(const NumerotationContext &, const int) const
NumStrategy::nextNumber.
NumerotationContext previous(const NumerotationContext &, const int) const override
ElementLineNum::previous.
virtual QString toRepresentedString(const QString) const =0
NumerotationContext next(const NumerotationContext &, const int) const override
LocmachNum::next.
QString toRepresentedString(const QString) const override
TenFNum::toRepresentedString.
NumerotationContext previous(const NumerotationContext &, const int) const override
StringNum::previous.
QString toRepresentedString(const QString) const override
HundredNum::toRepresentedString.
NumerotationContext previous(const NumerotationContext &, const int) const override
ElementColumnNum::previous.
NumerotationContext next(const NumerotationContext &, const int) const override
HundredNum::next.
NumerotationContext next(const NumerotationContext &, const int) const override
ElementLineNum::next.
void setNumStrategy(const QString &)
NumerotationContextCommands::setNumStrategy apply the good strategy relative to . ...
NumerotationContext next(const NumerotationContext &, const int) const override
PlantNum::next.
NumerotationContext previous(const NumerotationContext &, const int) const override
LocmachNum::previous.
QString toRepresentedString(const QString) const override
ElementPrefixNum::toRepresentedString.
NumerotationContext next(const NumerotationContext &, const int) const override
StringNum::next.
QString toRepresentedString(const QString) const override
TenNum::toRepresentedString.
QString toRepresentedString()
NumerotationContextCommands::toFinalString.