LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_LIBRARY_CMDCOMPONENTSYMBOLVARIANTEDIT_H
21 #define LIBREPCB_LIBRARY_CMDCOMPONENTSYMBOLVARIANTEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../componentsymbolvariant.h"
27 
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 namespace library {
37 
38 /*******************************************************************************
39  * Class CmdComponentSymbolVariantEdit
40  ******************************************************************************/
41 
46 public:
47  // Constructors / Destructor
50  delete;
52  ComponentSymbolVariant& variant) noexcept;
54 
55  // Setters
56  void setNorm(const QString& norm) noexcept;
57  void setNames(const LocalizedNameMap& names) noexcept;
58  void setDescriptions(const LocalizedDescriptionMap& descriptions) noexcept;
59  void setSymbolItems(const ComponentSymbolVariantItemList& items) noexcept;
60 
61  // Operator Overloadings
63  const CmdComponentSymbolVariantEdit& rhs) = delete;
64 
65 private: // Methods
67  bool performExecute() override;
68 
70  void performUndo() override;
71 
73  void performRedo() override;
74 
75 private: // Data
77 
78  QString mOldNorm;
79  QString mNewNorm;
86 };
87 
88 /*******************************************************************************
89  * End of File
90  ******************************************************************************/
91 
92 } // namespace library
93 } // namespace librepcb
94 
95 #endif // LIBREPCB_LIBRARY_CMDCOMPONENTSYMBOLVARIANTEDIT_H
CmdComponentSymbolVariantEdit & operator=(const CmdComponentSymbolVariantEdit &rhs)=delete
LocalizedNameMap mNewNames
Definition: cmdcomponentsymbolvariantedit.h:81
QString mOldNorm
Definition: cmdcomponentsymbolvariantedit.h:78
LocalizedNameMap mOldNames
Definition: cmdcomponentsymbolvariantedit.h:80
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsymbolvariantedit.cpp:85
ComponentSymbolVariantItemList mNewSymbolItems
Definition: cmdcomponentsymbolvariantedit.h:85
LocalizedDescriptionMap mOldDescriptions
Definition: cmdcomponentsymbolvariantedit.h:82
QString mNewNorm
Definition: cmdcomponentsymbolvariantedit.h:79
The CmdComponentSymbolVariantEdit class.
Definition: cmdcomponentsymbolvariantedit.h:45
void performUndo() override
Undo the command.
Definition: cmdcomponentsymbolvariantedit.cpp:95
ComponentSymbolVariant & mVariant
Definition: cmdcomponentsymbolvariantedit.h:76
void setNames(const LocalizedNameMap &names) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:63
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:69
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
void performRedo() override
Redo the command.
Definition: cmdcomponentsymbolvariantedit.cpp:102
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition: componentsymbolvariant.h:58
void setSymbolItems(const ComponentSymbolVariantItemList &items) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:75
void setNorm(const QString &norm) noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:58
~CmdComponentSymbolVariantEdit() noexcept
Definition: cmdcomponentsymbolvariantedit.cpp:51
LocalizedDescriptionMap mNewDescriptions
Definition: cmdcomponentsymbolvariantedit.h:83
ComponentSymbolVariantItemList mOldSymbolItems
Definition: cmdcomponentsymbolvariantedit.h:84