LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 ******************************************************************************/
38namespace librepcb {
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdComponentSymbolVariantEdit
43 ******************************************************************************/
44
49public:
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
63 // Operator Overloadings
65 const CmdComponentSymbolVariantEdit& rhs) = delete;
66
67private: // Methods
69 bool performExecute() override;
70
72 void performUndo() override;
73
75 void performRedo() override;
76
77private: // Data
79
80 QString mOldNorm;
81 QString mNewNorm;
86};
87
88/*******************************************************************************
89 * Undo Commands
90 ******************************************************************************/
91
104
105/*******************************************************************************
106 * End of File
107 ******************************************************************************/
108
109} // namespace editor
110} // namespace librepcb
111
112#endif
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition componentsymbolvariant.h:53
The CmdComponentSymbolVariantEdit class.
Definition cmdcomponentsymbolvariantedit.h:48
void performRedo() override
Redo the command.
Definition cmdcomponentsymbolvariantedit.cpp:92
LocalizedDescriptionMap mNewDescriptions
Definition cmdcomponentsymbolvariantedit.h:85
ComponentSymbolVariant & mVariant
Definition cmdcomponentsymbolvariantedit.h:78
LocalizedDescriptionMap mOldDescriptions
Definition cmdcomponentsymbolvariantedit.h:84
CmdComponentSymbolVariantEdit(const CmdComponentSymbolVariantEdit &other)=delete
void setNames(const LocalizedNameMap &names) noexcept
Definition cmdcomponentsymbolvariantedit.cpp:61
void performUndo() override
Undo the command.
Definition cmdcomponentsymbolvariantedit.cpp:86
~CmdComponentSymbolVariantEdit() noexcept
Definition cmdcomponentsymbolvariantedit.cpp:49
void setNorm(const QString &norm) noexcept
Definition cmdcomponentsymbolvariantedit.cpp:56
LocalizedNameMap mOldNames
Definition cmdcomponentsymbolvariantedit.h:82
LocalizedNameMap mNewNames
Definition cmdcomponentsymbolvariantedit.h:83
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition cmdcomponentsymbolvariantedit.cpp:67
QString mNewNorm
Definition cmdcomponentsymbolvariantedit.h:81
bool performExecute() override
Execute the command the first time.
Definition cmdcomponentsymbolvariantedit.cpp:77
QString mOldNorm
Definition cmdcomponentsymbolvariantedit.h:80
The CmdListElementInsert class.
Definition cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition cmdlistelementremove.h:46
The CmdListElementsSwap class.
Definition cmdlistelementsswap.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
CmdListElementRemove< ComponentSymbolVariant, ComponentSymbolVariantListNameProvider, ComponentSymbolVariant::Event > CmdComponentSymbolVariantRemove
Definition cmdcomponentsymbolvariantedit.h:99
CmdListElementsSwap< ComponentSymbolVariant, ComponentSymbolVariantListNameProvider, ComponentSymbolVariant::Event > CmdComponentSymbolVariantsSwap
Definition cmdcomponentsymbolvariantedit.h:103
CmdListElementInsert< ComponentSymbolVariant, ComponentSymbolVariantListNameProvider, ComponentSymbolVariant::Event > CmdComponentSymbolVariantInsert
Definition cmdcomponentsymbolvariantedit.h:95
Definition occmodel.cpp:77
Definition componentsymbolvariant.h:142