LibrePCB Developers Documentation
cmdnetclassedit.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_CMDNETCLASSEDIT_H
21#define LIBREPCB_EDITOR_CMDNETCLASSEDIT_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 NetClass;
38
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdNetClassEdit
43 ******************************************************************************/
44
48class CmdNetClassEdit final : public UndoCommand {
49public:
50 // Constructors / Destructor
51 explicit CmdNetClassEdit(NetClass& netclass) noexcept;
52 ~CmdNetClassEdit() noexcept;
53
54 // Setters
55 void setName(const ElementName& name) noexcept;
56
57private:
58 // Private Methods
59
61 bool performExecute() override;
62
64 void performUndo() override;
65
67 void performRedo() override;
68
69 // Private Member Variables
70
71 // Attributes from the constructor
73
74 // General Attributes
77};
78
79/*******************************************************************************
80 * End of File
81 ******************************************************************************/
82
83} // namespace editor
84} // namespace librepcb
85
86#endif
The NetClass class.
Definition: netclass.h:46
The CmdNetClassEdit class.
Definition: cmdnetclassedit.h:48
void performRedo() override
Redo the command.
Definition: cmdnetclassedit.cpp:73
void setName(const ElementName &name) noexcept
Definition: cmdnetclassedit.cpp:54
~CmdNetClassEdit() noexcept
Definition: cmdnetclassedit.cpp:47
NetClass & mNetClass
Definition: cmdnetclassedit.h:72
void performUndo() override
Undo the command.
Definition: cmdnetclassedit.cpp:69
ElementName mNewName
Definition: cmdnetclassedit.h:76
ElementName mOldName
Definition: cmdnetclassedit.h:75
CmdNetClassEdit(NetClass &netclass) noexcept
Definition: cmdnetclassedit.cpp:40
bool performExecute() override
Execute the command the first time.
Definition: cmdnetclassedit.cpp:63
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84