LibrePCB Developers Documentation
cmdcomponentpinsignalmapitemedit.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_CMDCOMPONENTPINSIGNALMAPITEMEDIT_H
21 #define LIBREPCB_EDITOR_CMDCOMPONENTPINSIGNALMAPITEMEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../../undocommand.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 
38 class ComponentPinSignalMapItem;
39 
40 namespace editor {
41 
42 /*******************************************************************************
43  * Class CmdComponentPinSignalMapItemEdit
44  ******************************************************************************/
45 
50 public:
51  // Constructors / Destructor
54  const CmdComponentPinSignalMapItemEdit& other) = delete;
56  ComponentPinSignalMapItem& item) noexcept;
58 
59  // Setters
60  void setSignalUuid(const tl::optional<Uuid>& uuid) noexcept;
61  void setDisplayType(const CmpSigPinDisplayType& type) noexcept;
62 
63  // Operator Overloadings
65  const CmdComponentPinSignalMapItemEdit& 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 
80  tl::optional<Uuid> mOldSignalUuid;
81  tl::optional<Uuid> mNewSignalUuid;
84 };
85 
86 /*******************************************************************************
87  * End of File
88  ******************************************************************************/
89 
90 } // namespace editor
91 } // namespace librepcb
92 
93 #endif
~CmdComponentPinSignalMapItemEdit() noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:49
CmpSigPinDisplayType mOldDisplayType
Definition: cmdcomponentpinsignalmapitemedit.h:82
void setSignalUuid(const tl::optional< Uuid > &uuid) noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:56
tl::optional< Uuid > mNewSignalUuid
Definition: cmdcomponentpinsignalmapitemedit.h:81
Definition: occmodel.cpp:77
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentpinsignalmapitemedit.cpp:72
The CmpSigPinDisplayType clas.
Definition: cmpsigpindisplaytype.h:40
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
The CmdComponentPinSignalMapItemEdit class.
Definition: cmdcomponentpinsignalmapitemedit.h:49
tl::optional< Uuid > mOldSignalUuid
Definition: cmdcomponentpinsignalmapitemedit.h:80
void performRedo() override
Redo the command.
Definition: cmdcomponentpinsignalmapitemedit.cpp:85
The ComponentPinSignalMapItem class maps a symbol pin to a component signal.
Definition: componentpinsignalmap.h:50
void setDisplayType(const CmpSigPinDisplayType &type) noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:62
ComponentPinSignalMapItem & mItem
Definition: cmdcomponentpinsignalmapitemedit.h:78
void performUndo() override
Undo the command.
Definition: cmdcomponentpinsignalmapitemedit.cpp:80
CmpSigPinDisplayType mNewDisplayType
Definition: cmdcomponentpinsignalmapitemedit.h:83
CmdComponentPinSignalMapItemEdit & operator=(const CmdComponentPinSignalMapItemEdit &rhs)=delete