QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
searchandreplaceworker.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 SEARCHANDREPLACEWORKER_H
19#define SEARCHANDREPLACEWORKER_H
20
21#include "../conductorproperties.h"
22#include "../titleblockproperties.h"
23
24#include <QDate>
25
26class Diagram;
27class Element;
29class Conductor;
30class QLineEdit;
31class QCheckBox;
32
34{
35 //Who :
36 // 0 == diagram
37 // 1 == element
38 // 2 == conductor
39 // 3 == independant text
40 int who = -1;
41 QString what;
42 QString search;
43 QString replace;
44};
45
52{
53 public:
55
56 void replaceDiagram(QList <Diagram *> diagram_list);
57 void replaceDiagram(Diagram *diagram);
58 void replaceElement(QList <Element *> list);
59 void replaceElement(Element *element);
60 void replaceIndiText(QList<IndependentTextItem *> list);
62 void replaceConductor(QList <Conductor *> list);
63 void replaceConductor(Conductor *conductor);
64 void replaceAdvanced (
65 QList<Diagram *> diagrams = QList<Diagram *>(),
66 QList<Element *> elements = QList<Element *>(),
67 QList<IndependentTextItem *>
68 texts = QList<IndependentTextItem *>(),
69 QList<Conductor *>
70 conductors = QList<Conductor *>());
71
72 static QString eraseText()
73 {return QString("XXXXXXXXXXXXXXXXXXX");}
74 static QDate eraseDate() {return QDate(1900, 1, 1);}
75 static void setupLineEdit(QLineEdit *l,
76 QCheckBox *cb,
77 QString str);
79
81 const ConductorProperties &original,
82 const ConductorProperties &change);
83 static QString applyChange(const QString &original,
84 const QString &change);
85
86 private:
90
93 QString m_indi_text;
96
98};
99
100#endif // SEARCHANDREPLACEWORKER_H
Definition conductor.h:43
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition conductorproperties.h:68
Definition diagramcontext.h:57
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition element.h:43
Definition independenttextitem.h:28
Definition searchandreplacewidget.h:40
The SearchAndReplaceWorker class This class is the worker use to change properties when use the searc...
Definition searchandreplaceworker.h:52
void replaceElement(QList< Element * > list)
SearchAndReplaceWorker::replaceElement Replace all properties of each elements in list All element mu...
Definition searchandreplaceworker.cpp:104
TitleBlockProperties m_titleblock_properties
Definition searchandreplaceworker.h:91
DiagramContext m_element_context
Definition searchandreplaceworker.h:92
void replaceAdvanced(QList< Diagram * > diagrams=QList< Diagram * >(), QList< Element * > elements=QList< Element * >(), QList< IndependentTextItem * > texts=QList< IndependentTextItem * >(), QList< Conductor * > conductors=QList< Conductor * >())
SearchAndReplaceWorker::replaceAdvanced Apply the change of text according to the current advancedStr...
Definition searchandreplaceworker.cpp:251
static void setupLineEdit(QLineEdit *l, QCheckBox *cb, QString str)
SearchAndReplaceWorker::setupLineEdit With search and replace, when the variable to edit is a text,...
Definition searchandreplaceworker.cpp:379
void replaceConductor(QList< Conductor * > list)
SearchAndReplaceWorker::replaceConductor Replace all properties of each conductor in list All conduct...
Definition searchandreplaceworker.cpp:199
static ConductorProperties applyChange(const ConductorProperties &original, const ConductorProperties &change)
SearchAndReplaceWorker::applyChange.
Definition searchandreplaceworker.cpp:414
static QDate eraseDate()
Definition searchandreplaceworker.h:74
static ConductorProperties invalidConductorProperties()
Definition searchandreplaceworker.cpp:388
void replaceDiagram(QList< Diagram * > diagram_list)
SearchAndReplaceWorker::replaceDiagram Replace all properties of each diagram in diagram_list,...
Definition searchandreplaceworker.cpp:42
QString m_indi_text
Definition searchandreplaceworker.h:93
ConductorProperties m_conductor_properties
Definition searchandreplaceworker.h:94
static QString eraseText()
Definition searchandreplaceworker.h:72
SearchAndReplaceWorker()
Definition searchandreplaceworker.cpp:30
void replaceIndiText(QList< IndependentTextItem * > list)
SearchAndReplaceWorker::replaceIndiText Replace all displayed text of independent text of list Each m...
Definition searchandreplaceworker.cpp:160
advancedReplaceStruct m_advanced_struct
Definition searchandreplaceworker.h:95
Definition titleblockproperties.h:29
Definition searchandreplaceworker.h:34
QString what
Definition searchandreplaceworker.h:41
QString replace
Definition searchandreplaceworker.h:43
QString search
Definition searchandreplaceworker.h:42
int who
Definition searchandreplaceworker.h:40