LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 "../../cmd/cmdlistelementinsert.h"
27#include "../../cmd/cmdlistelementremove.h"
28#include "../../undocommand.h"
29
33
34#include <QtCore>
35
36/*******************************************************************************
37 * Namespace / Forward Declarations
38 ******************************************************************************/
39namespace librepcb {
40
41class ComponentPinSignalMapItem;
42
43namespace editor {
44
45/*******************************************************************************
46 * Class CmdComponentPinSignalMapItemEdit
47 ******************************************************************************/
48
53public:
54 // Constructors / Destructor
57 const CmdComponentPinSignalMapItemEdit& other) = delete;
59 const std::shared_ptr<ComponentPinSignalMapItem>& item) noexcept;
61
62 // Setters
63 void setSignalUuid(const std::optional<Uuid>& uuid) noexcept;
64 void setDisplayType(const CmpSigPinDisplayType& type) noexcept;
65
66 // Operator Overloadings
68 const CmdComponentPinSignalMapItemEdit& rhs) = delete;
69
70private: // Methods
72 bool performExecute() override;
73
75 void performUndo() override;
76
78 void performRedo() override;
79
80private: // Data
82
87};
88
89/*******************************************************************************
90 * Undo Commands
91 ******************************************************************************/
92
101
102/*******************************************************************************
103 * End of File
104 ******************************************************************************/
105
106} // namespace editor
107} // namespace librepcb
108
109#endif
The CmpSigPinDisplayType clas.
Definition cmpsigpindisplaytype.h:40
The ComponentPinSignalMapItem class maps a symbol pin to a component signal.
Definition componentpinsignalmap.h:50
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The CmdComponentPinSignalMapItemEdit class.
Definition cmdcomponentpinsignalmapitemedit.h:52
void performRedo() override
Redo the command.
Definition cmdcomponentpinsignalmapitemedit.cpp:85
CmdComponentPinSignalMapItemEdit(const CmdComponentPinSignalMapItemEdit &other)=delete
std::optional< Uuid > mOldSignalUuid
Definition cmdcomponentpinsignalmapitemedit.h:83
void setDisplayType(const CmpSigPinDisplayType &type) noexcept
Definition cmdcomponentpinsignalmapitemedit.cpp:62
CmpSigPinDisplayType mOldDisplayType
Definition cmdcomponentpinsignalmapitemedit.h:85
void performUndo() override
Undo the command.
Definition cmdcomponentpinsignalmapitemedit.cpp:80
std::optional< Uuid > mNewSignalUuid
Definition cmdcomponentpinsignalmapitemedit.h:84
void setSignalUuid(const std::optional< Uuid > &uuid) noexcept
Definition cmdcomponentpinsignalmapitemedit.cpp:56
~CmdComponentPinSignalMapItemEdit() noexcept
Definition cmdcomponentpinsignalmapitemedit.cpp:49
CmpSigPinDisplayType mNewDisplayType
Definition cmdcomponentpinsignalmapitemedit.h:86
std::shared_ptr< ComponentPinSignalMapItem > mItem
Definition cmdcomponentpinsignalmapitemedit.h:81
bool performExecute() override
Execute the command the first time.
Definition cmdcomponentpinsignalmapitemedit.cpp:72
The CmdListElementInsert class.
Definition cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition cmdlistelementremove.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
CmdListElementRemove< ComponentPinSignalMapItem, ComponentPinSignalMapNameProvider, ComponentPinSignalMapItem::Event > CmdComponentPinSignalMapItemRemove
Definition cmdcomponentpinsignalmapitemedit.h:100
CmdListElementInsert< ComponentPinSignalMapItem, ComponentPinSignalMapNameProvider, ComponentPinSignalMapItem::Event > CmdComponentPinSignalMapItemInsert
Definition cmdcomponentpinsignalmapitemedit.h:96
Definition occmodel.cpp:77
Definition uuid.h:186
Definition componentpinsignalmap.h:115