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