LibrePCB Developers Documentation
cmdcomponentsymbolvariantedit.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_EDITOR_CMDCOMPONENTSYMBOLVARIANTEDIT_H
21 #define LIBREPCB_EDITOR_CMDCOMPONENTSYMBOLVARIANTEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../../cmd/cmdlistelementinsert.h"
27 #include "../../cmd/cmdlistelementremove.h"
28 #include "../../cmd/cmdlistelementsswap.h"
29 #include "../../undocommand.h"
30 
32 
33 #include <QtCore>
34 
35 /*******************************************************************************
36  * Namespace / Forward Declarations
37  ******************************************************************************/
38 namespace librepcb {
39 namespace editor {
40 
41 /*******************************************************************************
42  * Class CmdComponentSymbolVariantEdit
43  ******************************************************************************/
44 
49 public:
50  // Constructors / Destructor
53  delete;
55  ComponentSymbolVariant& variant) noexcept;
57 
58  // Setters
59  void setNorm(const QString& norm) noexcept;
60  void setNames(const LocalizedNameMap& names) noexcept;
61  void setDescriptions(const LocalizedDescriptionMap& descriptions) noexcept;
62  void setSymbolItems(const ComponentSymbolVariantItemList& items) noexcept;
63 
64  // Operator Overloadings
66  const CmdComponentSymbolVariantEdit& rhs) = delete;
67 
68 private: // Methods
70  bool performExecute() override;
71 
73  void performUndo() override;
74 
76  void performRedo() override;
77 
78 private: // Data
80 
81  QString mOldNorm;
82  QString mNewNorm;
89 };
90 
91 /*******************************************************************************
92  * Undo Commands
93  ******************************************************************************/
94 
100  CmdListElementRemove<ComponentSymbolVariant,
101  ComponentSymbolVariantListNameProvider,
104  CmdListElementsSwap<ComponentSymbolVariant,
105  ComponentSymbolVariantListNameProvider,
107 
108 /*******************************************************************************
109  * End of File
110  ******************************************************************************/
111 
112 } // namespace editor
113 } // namespace librepcb
114 
115 #endif
LocalizedNameMap mNewNames
Definition: cmdcomponentsymbolvariantedit.h:84
CmdComponentSymbolVariantEdit & operator=(const CmdComponentSymbolVariantEdit &rhs)=delete
~CmdComponentSymbolVariantEdit() noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:51
QString mOldNorm
Definition: cmdcomponentsymbolvariantedit.h:81
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:46
LocalizedDescriptionMap mNewDescriptions
Definition: cmdcomponentsymbolvariantedit.h:86
void performRedo() override
Redo the command.
Definition: cmdcomponentsymbolvariantedit.cpp:102
ComponentSymbolVariantItemList mNewSymbolItems
Definition: cmdcomponentsymbolvariantedit.h:88
Definition: occmodel.cpp:77
QString mNewNorm
Definition: cmdcomponentsymbolvariantedit.h:82
Definition: componentsymbolvariant.h:142
Event
Definition: componentsymbolvariant.h:56
void performUndo() override
Undo the command.
Definition: cmdcomponentsymbolvariantedit.cpp:95
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsymbolvariantedit.cpp:85
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
The CmdComponentSymbolVariantEdit class.
Definition: cmdcomponentsymbolvariantedit.h:48
ComponentSymbolVariant & mVariant
Definition: cmdcomponentsymbolvariantedit.h:79
LocalizedNameMap mOldNames
Definition: cmdcomponentsymbolvariantedit.h:83
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:46
ComponentSymbolVariantItemList mOldSymbolItems
Definition: cmdcomponentsymbolvariantedit.h:87
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:69
void setNames(const LocalizedNameMap &names) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:63
void setSymbolItems(const ComponentSymbolVariantItemList &items) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:75
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition: componentsymbolvariant.h:53
void setNorm(const QString &norm) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:58
LocalizedDescriptionMap mOldDescriptions
Definition: cmdcomponentsymbolvariantedit.h:85