LibrePCB Developers Documentation
cmdnetsignaledit.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_CMDNETSIGNALEDIT_H
21#define LIBREPCB_EDITOR_CMDNETSIGNALEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class Circuit;
38class NetSignal;
39
40namespace editor {
41
42/*******************************************************************************
43 * Class CmdNetSignalSetName
44 ******************************************************************************/
45
49class CmdNetSignalEdit final : public UndoCommand {
50public:
51 // Constructors / Destructor
52 CmdNetSignalEdit(Circuit& circuit, NetSignal& netsignal) noexcept;
53 ~CmdNetSignalEdit() noexcept;
54
55 // Setters
56 void setName(const CircuitIdentifier& name, bool isAutoName) noexcept;
57
58private:
59 // Private Methods
60
62 bool performExecute() override;
63
65 void performUndo() override;
66
68 void performRedo() override;
69
70 // Private Member Variables
71
72 // Attributes from the constructor
75
76 // General Attributes
81};
82
83/*******************************************************************************
84 * End of File
85 ******************************************************************************/
86
87} // namespace editor
88} // namespace librepcb
89
90#endif
The Circuit class represents all electrical connections in a project (drawn in the schematics)
Definition: circuit.h:70
The NetSignal class.
Definition: netsignal.h:50
The CmdNetSignalSetName class.
Definition: cmdnetsignaledit.h:49
void performRedo() override
Redo the command.
Definition: cmdnetsignaledit.cpp:79
Circuit & mCircuit
Definition: cmdnetsignaledit.h:73
CircuitIdentifier mOldName
Definition: cmdnetsignaledit.h:77
bool mOldIsAutoName
Definition: cmdnetsignaledit.h:79
void performUndo() override
Undo the command.
Definition: cmdnetsignaledit.cpp:75
bool mNewIsAutoName
Definition: cmdnetsignaledit.h:80
CmdNetSignalEdit(Circuit &circuit, NetSignal &netsignal) noexcept
Definition: cmdnetsignaledit.cpp:40
void setName(const CircuitIdentifier &name, bool isAutoName) noexcept
Definition: cmdnetsignaledit.cpp:58
NetSignal & mNetSignal
Definition: cmdnetsignaledit.h:74
~CmdNetSignalEdit() noexcept
Definition: cmdnetsignaledit.cpp:51
bool performExecute() override
Execute the command the first time.
Definition: cmdnetsignaledit.cpp:69
CircuitIdentifier mNewName
Definition: cmdnetsignaledit.h:78
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:96