QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
addterminalstripcommand.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 ADDTERMINALSTRIPCOMMAND_H
19#define ADDTERMINALSTRIPCOMMAND_H
20
21#include <QUndoCommand>
22#include <QPointer>
23#include <QVector>
24
25class TerminalStrip;
26class QETProject;
27class Element;
28
29class AddTerminalStripCommand : public QUndoCommand
30{
31 public:
32 AddTerminalStripCommand(TerminalStrip *strip, QETProject *project, QUndoCommand *parent = nullptr);
33 ~AddTerminalStripCommand() override;
34
35 void undo() override;
36 void redo() override;
37
38 private:
39 QPointer<TerminalStrip> m_strip;
40 QPointer<QETProject> m_project;
41};
42
43class RemoveTerminalStripCommand : public QUndoCommand
44{
45 public:
46 RemoveTerminalStripCommand(TerminalStrip *strip, QETProject *project, QUndoCommand *parent = nullptr);
48
49 void undo() override;
50 void redo() override;
51
52 private:
53 QPointer<TerminalStrip> m_strip;
54 QPointer<QETProject> m_project;
55 QVector<QPointer<Element>> m_elements;
56};
57
58#endif // ADDTERMINALSTRIPCOMMAND_H
Definition addterminalstripcommand.h:30
QPointer< QETProject > m_project
Definition addterminalstripcommand.h:40
QPointer< TerminalStrip > m_strip
Definition addterminalstripcommand.h:39
void redo() override
Definition addterminalstripcommand.cpp:50
void undo() override
Definition addterminalstripcommand.cpp:44
~AddTerminalStripCommand() override
Definition addterminalstripcommand.cpp:41
Definition element.h:43
Definition qetproject.h:62
Definition addterminalstripcommand.h:44
QPointer< TerminalStrip > m_strip
Definition addterminalstripcommand.h:53
~RemoveTerminalStripCommand() override
Definition addterminalstripcommand.cpp:71
QPointer< QETProject > m_project
Definition addterminalstripcommand.h:54
QVector< QPointer< Element > > m_elements
Definition addterminalstripcommand.h:55
void undo() override
Definition addterminalstripcommand.cpp:74
void redo() override
Definition addterminalstripcommand.cpp:84
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45