LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdcomponentsignaledit.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_CMDCOMPONENTSIGNALEDIT_H
21 #define LIBREPCB_LIBRARY_CMDCOMPONENTSIGNALEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../componentsignal.h"
27 
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 namespace library {
37 
38 /*******************************************************************************
39  * Class CmdComponentSignalEdit
40  ******************************************************************************/
41 
45 class CmdComponentSignalEdit final : public UndoCommand {
46 public:
47  // Constructors / Destructor
48  CmdComponentSignalEdit() = delete;
49  CmdComponentSignalEdit(const CmdComponentSignalEdit& other) = delete;
50  explicit CmdComponentSignalEdit(ComponentSignal& signal) noexcept;
51  ~CmdComponentSignalEdit() noexcept;
52 
53  // Setters
54  void setName(const CircuitIdentifier& name) noexcept;
55  void setRole(const SignalRole& role) noexcept;
56  void setForcedNetName(const QString& name) noexcept;
57  void setIsRequired(bool required) noexcept;
58  void setIsNegated(bool negated) noexcept;
59  void setIsClock(bool clock) noexcept;
60 
61  // Operator Overloadings
63 
64 private: // Methods
66  bool performExecute() override;
67 
69  void performUndo() override;
70 
72  void performRedo() override;
73 
74 private: // Data
76 
89 };
90 
91 /*******************************************************************************
92  * End of File
93  ******************************************************************************/
94 
95 } // namespace library
96 } // namespace librepcb
97 
98 #endif // LIBREPCB_LIBRARY_CMDCOMPONENTSIGNALEDIT_H
void setIsNegated(bool negated) noexcept
Definition: cmdcomponentsignaledit.cpp:81
void setIsClock(bool clock) noexcept
Definition: cmdcomponentsignaledit.cpp:86
SignalRole mOldRole
Definition: cmdcomponentsignaledit.h:79
~CmdComponentSignalEdit() noexcept
Definition: cmdcomponentsignaledit.cpp:54
The ComponentSignal class represents one signal of a component.
Definition: componentsignal.h:49
ComponentSignal & mSignal
Definition: cmdcomponentsignaledit.h:75
bool mOldIsNegated
Definition: cmdcomponentsignaledit.h:85
CircuitIdentifier mNewName
Definition: cmdcomponentsignaledit.h:78
void performUndo() override
Undo the command.
Definition: cmdcomponentsignaledit.cpp:107
void setIsRequired(bool required) noexcept
Definition: cmdcomponentsignaledit.cpp:76
bool mNewIsNegated
Definition: cmdcomponentsignaledit.h:86
void setRole(const SignalRole &role) noexcept
Definition: cmdcomponentsignaledit.cpp:66
QString mOldForcedNetName
Definition: cmdcomponentsignaledit.h:81
CmdComponentSignalEdit & operator=(const CmdComponentSignalEdit &rhs)=delete
The SignalRole class provides all supported electrical signal roles.
Definition: signalrole.h:42
bool mOldIsRequired
Definition: cmdcomponentsignaledit.h:83
void setName(const CircuitIdentifier &name) noexcept
Definition: cmdcomponentsignaledit.cpp:61
void performRedo() override
Redo the command.
Definition: cmdcomponentsignaledit.cpp:116
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:89
QString mNewForcedNetName
Definition: cmdcomponentsignaledit.h:82
bool mNewIsClock
Definition: cmdcomponentsignaledit.h:88
The CmdComponentSignalEdit class.
Definition: cmdcomponentsignaledit.h:45
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
bool mOldIsClock
Definition: cmdcomponentsignaledit.h:87
SignalRole mNewRole
Definition: cmdcomponentsignaledit.h:80
bool performExecute() override
Execute the command the first time.
Definition: cmdcomponentsignaledit.cpp:95
CircuitIdentifier mOldName
Definition: cmdcomponentsignaledit.h:77
bool mNewIsRequired
Definition: cmdcomponentsignaledit.h:84
void setForcedNetName(const QString &name) noexcept
Definition: cmdcomponentsignaledit.cpp:71