LibrePCB Developers Documentation
cmdcomponentsymbolvariantitemedit.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_CMDCOMPONENTSYMBOLVARIANTITEMEDIT_H
21#define LIBREPCB_EDITOR_CMDCOMPONENTSYMBOLVARIANTITEMEDIT_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 CmdComponentSymbolVariantItemEdit
43 ******************************************************************************/
44
49public:
50 // Constructors / Destructor
53 const CmdComponentSymbolVariantItemEdit& other) = delete;
55 ComponentSymbolVariantItem& item) noexcept;
57
58 // Setters
59 void setSymbolUuid(const Uuid& uuid) noexcept;
60 void setSymbolPosition(const Point& pos) noexcept;
61 void setSymbolRotation(const Angle& rot) noexcept;
62 void setIsRequired(bool required) noexcept;
63 void setSuffix(const ComponentSymbolVariantItemSuffix& suffix) noexcept;
64 void setPinSignalMap(const ComponentPinSignalMap& map) noexcept;
65
66 // Operator Overloadings
68 const CmdComponentSymbolVariantItemEdit& rhs) = delete;
69
70private: // Methods
72 bool performExecute() override;
73
75 void performUndo() override;
76
78 void performRedo() override;
79
80private: // Data
82
95};
96
97/*******************************************************************************
98 * Undo Commands
99 ******************************************************************************/
100
113
114/*******************************************************************************
115 * End of File
116 ******************************************************************************/
117
118} // namespace editor
119} // namespace librepcb
120
121#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The ComponentSymbolVariantItem class represents one symbol of a component symbol variant.
Definition: componentsymbolvariantitem.h:54
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The CmdComponentSymbolVariantItemEdit class.
Definition: cmdcomponentsymbolvariantitemedit.h:48
void performRedo() override
Redo the command.
Definition: cmdcomponentsymbolvariantitemedit.cpp:123
void setPinSignalMap(const ComponentPinSignalMap &map) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:92
Angle mNewSymbolRot
Definition: cmdcomponentsymbolvariantitemedit.h:88
CmdComponentSymbolVariantItemEdit(const CmdComponentSymbolVariantItemEdit &other)=delete
Point mOldSymbolPos
Definition: cmdcomponentsymbolvariantitemedit.h:85
void setIsRequired(bool required) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:81
ComponentPinSignalMap mOldPinSignalMap
Definition: cmdcomponentsymbolvariantitemedit.h:93
bool mOldIsRequired
Definition: cmdcomponentsymbolvariantitemedit.h:89
Angle mOldSymbolRot
Definition: cmdcomponentsymbolvariantitemedit.h:87
void performUndo() override
Undo the command.
Definition: cmdcomponentsymbolvariantitemedit.cpp:114
ComponentSymbolVariantItem & mItem
Definition: cmdcomponentsymbolvariantitemedit.h:81
Point mNewSymbolPos
Definition: cmdcomponentsymbolvariantitemedit.h:86
ComponentPinSignalMap mNewPinSignalMap
Definition: cmdcomponentsymbolvariantitemedit.h:94
~CmdComponentSymbolVariantItemEdit() noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:56
ComponentSymbolVariantItemSuffix mOldSuffix
Definition: cmdcomponentsymbolvariantitemedit.h:91
bool mNewIsRequired
Definition: cmdcomponentsymbolvariantitemedit.h:90
void setSymbolPosition(const Point &pos) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:69
void setSuffix(const ComponentSymbolVariantItemSuffix &suffix) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:86
Uuid mOldSymbolUuid
Definition: cmdcomponentsymbolvariantitemedit.h:83
void setSymbolRotation(const Angle &rot) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:75
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsymbolvariantitemedit.cpp:102
Uuid mNewSymbolUuid
Definition: cmdcomponentsymbolvariantitemedit.h:84
ComponentSymbolVariantItemSuffix mNewSuffix
Definition: cmdcomponentsymbolvariantitemedit.h:92
void setSymbolUuid(const Uuid &uuid) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:63
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
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ComponentSymbolVariantItemSuffixConstraint, ComponentSymbolVariantItemSuffixVerifier > ComponentSymbolVariantItemSuffix
Definition: componentsymbolvariantitemsuffix.h:89
Definition: componentsymbolvariantitem.h:144