LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_LIBRARY_CMDCOMPONENTSYMBOLVARIANTITEMEDIT_H
21 #define LIBREPCB_LIBRARY_CMDCOMPONENTSYMBOLVARIANTITEMEDIT_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 CmdComponentSymbolVariantItemEdit
40  ******************************************************************************/
41 
46 public:
47  // Constructors / Destructor
50  const CmdComponentSymbolVariantItemEdit& other) = delete;
52  ComponentSymbolVariantItem& item) noexcept;
54 
55  // Setters
56  void setSymbolUuid(const Uuid& uuid) noexcept;
57  void setSymbolPosition(const Point& pos) noexcept;
58  void setSymbolRotation(const Angle& rot) noexcept;
59  void setIsRequired(bool required) noexcept;
60  void setSuffix(const ComponentSymbolVariantItemSuffix& suffix) noexcept;
61  void setPinSignalMap(const ComponentPinSignalMap& map) noexcept;
62 
63  // Operator Overloadings
65  const CmdComponentSymbolVariantItemEdit& rhs) = delete;
66 
67 private: // Methods
69  bool performExecute() override;
70 
72  void performUndo() override;
73 
75  void performRedo() override;
76 
77 private: // Data
79 
92 };
93 
94 /*******************************************************************************
95  * End of File
96  ******************************************************************************/
97 
98 } // namespace library
99 } // namespace librepcb
100 
101 #endif // LIBREPCB_LIBRARY_CMDCOMPONENTSYMBOLVARIANTITEMEDIT_H
void setSuffix(const ComponentSymbolVariantItemSuffix &suffix) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:86
Angle mOldSymbolRot
Definition: cmdcomponentsymbolvariantitemedit.h:84
void setSymbolUuid(const Uuid &uuid) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:63
ComponentSymbolVariantItemSuffix mOldSuffix
Definition: cmdcomponentsymbolvariantitemedit.h:88
ComponentPinSignalMap mNewPinSignalMap
Definition: cmdcomponentsymbolvariantitemedit.h:91
void setPinSignalMap(const ComponentPinSignalMap &map) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:92
type_safe::constrained_type< QString, ComponentSymbolVariantItemSuffixConstraint, ComponentSymbolVariantItemSuffixVerifier > ComponentSymbolVariantItemSuffix
Definition: componentsymbolvariantitemsuffix.h:79
Uuid mOldSymbolUuid
Definition: cmdcomponentsymbolvariantitemedit.h:80
Point mOldSymbolPos
Definition: cmdcomponentsymbolvariantitemedit.h:82
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
bool mOldIsRequired
Definition: cmdcomponentsymbolvariantitemedit.h:86
ComponentPinSignalMap mOldPinSignalMap
Definition: cmdcomponentsymbolvariantitemedit.h:90
void performRedo() override
Redo the command.
Definition: cmdcomponentsymbolvariantitemedit.cpp:123
The CmdComponentSymbolVariantItemEdit class.
Definition: cmdcomponentsymbolvariantitemedit.h:45
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
void setSymbolPosition(const Point &pos) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:69
Uuid mNewSymbolUuid
Definition: cmdcomponentsymbolvariantitemedit.h:81
void performUndo() override
Undo the command.
Definition: cmdcomponentsymbolvariantitemedit.cpp:114
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsymbolvariantitemedit.cpp:102
~CmdComponentSymbolVariantItemEdit() noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:56
Angle mNewSymbolRot
Definition: cmdcomponentsymbolvariantitemedit.h:85
ComponentSymbolVariantItemSuffix mNewSuffix
Definition: cmdcomponentsymbolvariantitemedit.h:89
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
void setSymbolRotation(const Angle &rot) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:75
bool mNewIsRequired
Definition: cmdcomponentsymbolvariantitemedit.h:87
Point mNewSymbolPos
Definition: cmdcomponentsymbolvariantitemedit.h:83
ComponentSymbolVariantItem & mItem
Definition: cmdcomponentsymbolvariantitemedit.h:78
void setIsRequired(bool required) noexcept
Definition: cmdcomponentsymbolvariantitemedit.cpp:81
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The ComponentSymbolVariantItem class represents one symbol of a component symbol variant.
Definition: componentsymbolvariantitem.h:58
CmdComponentSymbolVariantItemEdit & operator=(const CmdComponentSymbolVariantItemEdit &rhs)=delete