LibrePCB Developers Documentation
cmdpackagepadedit.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_CMDPACKAGEPADEDIT_H
21#define LIBREPCB_EDITOR_CMDPACKAGEPADEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../cmd/cmdlistelementinsert.h"
27#include "../../cmd/cmdlistelementremove.h"
28#include "../../cmd/cmdlistelementsswap.h"
29#include "../../undocommand.h"
30
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdPackagePadEdit
43 ******************************************************************************/
44
48class CmdPackagePadEdit final : public UndoCommand {
49public:
50 // Constructors / Destructor
52 CmdPackagePadEdit(const CmdPackagePadEdit& other) = delete;
53 explicit CmdPackagePadEdit(PackagePad& pad) noexcept;
54 ~CmdPackagePadEdit() noexcept;
55
56 // Setters
57 void setName(const CircuitIdentifier& name) noexcept;
58
59 // Operator Overloadings
60 CmdPackagePadEdit& operator=(const CmdPackagePadEdit& rhs) = delete;
61
62private:
63 // Private Methods
64
66 bool performExecute() override;
67
69 void performUndo() override;
70
72 void performRedo() override;
73
74 // Private Member Variables
75
76 // Attributes from the constructor
78
79 // General Attributes
82};
83
84/*******************************************************************************
85 * Undo Commands
86 ******************************************************************************/
87
90 PackagePad::Event>;
93 PackagePad::Event>;
96 PackagePad::Event>;
97
98/*******************************************************************************
99 * End of File
100 ******************************************************************************/
101
102} // namespace editor
103} // namespace librepcb
104
105#endif
The PackagePad class represents one logical pad of a package.
Definition: packagepad.h:47
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:46
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:46
The CmdPackagePadEdit class.
Definition: cmdpackagepadedit.h:48
void performRedo() override
Redo the command.
Definition: cmdpackagepadedit.cpp:71
PackagePad & mPad
Definition: cmdpackagepadedit.h:77
CircuitIdentifier mOldName
Definition: cmdpackagepadedit.h:80
CmdPackagePadEdit(const CmdPackagePadEdit &other)=delete
void performUndo() override
Undo the command.
Definition: cmdpackagepadedit.cpp:67
~CmdPackagePadEdit() noexcept
Definition: cmdpackagepadedit.cpp:44
void setName(const CircuitIdentifier &name) noexcept
Definition: cmdpackagepadedit.cpp:51
bool performExecute() override
Execute the command the first time.
Definition: cmdpackagepadedit.cpp:60
CircuitIdentifier mNewName
Definition: cmdpackagepadedit.h:81
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
Definition: packagepad.h:98