LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_LIBRARY_CMDPACKAGEPADEDIT_H
21 #define LIBREPCB_LIBRARY_CMDPACKAGEPADEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../packagepad.h"
27 
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 namespace library {
37 
38 /*******************************************************************************
39  * Class CmdPackagePadEdit
40  ******************************************************************************/
41 
45 class CmdPackagePadEdit final : public UndoCommand {
46 public:
47  // Constructors / Destructor
48  CmdPackagePadEdit() = delete;
49  CmdPackagePadEdit(const CmdPackagePadEdit& other) = delete;
50  explicit CmdPackagePadEdit(PackagePad& pad) noexcept;
51  ~CmdPackagePadEdit() noexcept;
52 
53  // Setters
54  void setName(const CircuitIdentifier& name) noexcept;
55 
56  // Operator Overloadings
57  CmdPackagePadEdit& operator=(const CmdPackagePadEdit& rhs) = delete;
58 
59 private:
60  // Private Methods
61 
63  bool performExecute() override;
64 
66  void performUndo() override;
67 
69  void performRedo() override;
70 
71  // Private Member Variables
72 
73  // Attributes from the constructor
75 
76  // General Attributes
79 };
80 
81 /*******************************************************************************
82  * End of File
83  ******************************************************************************/
84 
85 } // namespace library
86 } // namespace librepcb
87 
88 #endif // LIBREPCB_LIBRARY_CMDPACKAGEPADEDIT_H
CmdPackagePadEdit & operator=(const CmdPackagePadEdit &rhs)=delete
void performRedo() override
Redo the command.
Definition: cmdpackagepadedit.cpp:71
CircuitIdentifier mOldName
Definition: cmdpackagepadedit.h:77
The CmdPackagePadEdit class.
Definition: cmdpackagepadedit.h:45
void performUndo() override
Undo the command.
Definition: cmdpackagepadedit.cpp:67
CircuitIdentifier mNewName
Definition: cmdpackagepadedit.h:78
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:89
bool performExecute() override
Execute the command the first time.
Definition: cmdpackagepadedit.cpp:60
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:52
void setName(const CircuitIdentifier &name) noexcept
Definition: cmdpackagepadedit.cpp:51
~CmdPackagePadEdit() noexcept
Definition: cmdpackagepadedit.cpp:44
PackagePad & mPad
Definition: cmdpackagepadedit.h:74
The PackagePad class represents one logical pad of a package.
Definition: packagepad.h:51