LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_LIBRARY_CMDCOMPONENTPINSIGNALMAPITEMEDIT_H
21 #define LIBREPCB_LIBRARY_CMDCOMPONENTPINSIGNALMAPITEMEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../cmpsigpindisplaytype.h"
27 
29 #include <librepcb/common/uuid.h>
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 namespace library {
38 
39 class ComponentPinSignalMapItem;
40 
41 /*******************************************************************************
42  * Class CmdComponentPinSignalMapItemEdit
43  ******************************************************************************/
44 
49 public:
50  // Constructors / Destructor
53  const CmdComponentPinSignalMapItemEdit& other) = delete;
55  ComponentPinSignalMapItem& item) noexcept;
57 
58  // Setters
59  void setSignalUuid(const tl::optional<Uuid>& uuid) noexcept;
60  void setDisplayType(const CmpSigPinDisplayType& type) noexcept;
61 
62  // Operator Overloadings
64  const CmdComponentPinSignalMapItemEdit& rhs) = delete;
65 
66 private: // Methods
68  bool performExecute() override;
69 
71  void performUndo() override;
72 
74  void performRedo() override;
75 
76 private: // Data
78 
79  tl::optional<Uuid> mOldSignalUuid;
80  tl::optional<Uuid> mNewSignalUuid;
83 };
84 
85 /*******************************************************************************
86  * End of File
87  ******************************************************************************/
88 
89 } // namespace library
90 } // namespace librepcb
91 
92 #endif // LIBREPCB_LIBRARY_CMDCOMPONENTPINSIGNALMAPITEMEDIT_H
void setDisplayType(const CmpSigPinDisplayType &type) noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:62
The CmpSigPinDisplayType clas.
Definition: cmpsigpindisplaytype.h:43
void setSignalUuid(const tl::optional< Uuid > &uuid) noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:56
The CmdComponentPinSignalMapItemEdit class.
Definition: cmdcomponentpinsignalmapitemedit.h:48
~CmdComponentPinSignalMapItemEdit() noexcept
Definition: cmdcomponentpinsignalmapitemedit.cpp:49
ComponentPinSignalMapItem & mItem
Definition: cmdcomponentpinsignalmapitemedit.h:77
tl::optional< Uuid > mOldSignalUuid
Definition: cmdcomponentpinsignalmapitemedit.h:79
CmpSigPinDisplayType mNewDisplayType
Definition: cmdcomponentpinsignalmapitemedit.h:82
The ComponentPinSignalMapItem class maps a symbol pin to a component signal.
Definition: componentpinsignalmap.h:55
tl::optional< Uuid > mNewSignalUuid
Definition: cmdcomponentpinsignalmapitemedit.h:80
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentpinsignalmapitemedit.cpp:72
CmpSigPinDisplayType mOldDisplayType
Definition: cmdcomponentpinsignalmapitemedit.h:81
void performRedo() override
Redo the command.
Definition: cmdcomponentpinsignalmapitemedit.cpp:85
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
void performUndo() override
Undo the command.
Definition: cmdcomponentpinsignalmapitemedit.cpp:80
CmdComponentPinSignalMapItemEdit & operator=(const CmdComponentPinSignalMapItemEdit &rhs)=delete