LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmddeviceinstanceadd.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_PROJECT_CMDDEVICEINSTANCEADD_H
21 #define LIBREPCB_PROJECT_CMDDEVICEINSTANCEADD_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
28 #include <librepcb/common/uuid.h>
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 namespace library {
38 class Device;
39 }
40 
41 namespace project {
42 
43 class Board;
44 class ComponentInstance;
45 class BI_Device;
46 
47 /*******************************************************************************
48  * Class CmdDeviceInstanceAdd
49  ******************************************************************************/
50 
54 class CmdDeviceInstanceAdd final : public UndoCommand {
55 public:
56  // Constructors / Destructor
57  explicit CmdDeviceInstanceAdd(BI_Device& device) noexcept;
58  ~CmdDeviceInstanceAdd() noexcept;
59 
60 private: // Methods
62  bool performExecute() override;
63 
65  void performUndo() override;
66 
68  void performRedo() override;
69 
70 private: // Data
72 };
73 
74 /*******************************************************************************
75  * End of File
76  ******************************************************************************/
77 
78 } // namespace project
79 } // namespace librepcb
80 
81 #endif // LIBREPCB_PROJECT_CMDDEVICEINSTANCEADD_H
BI_Device & mDeviceInstance
Definition: cmddeviceinstanceadd.h:71
~CmdDeviceInstanceAdd() noexcept
Definition: cmddeviceinstanceadd.cpp:44
The CmdDeviceInstanceAdd class.
Definition: cmddeviceinstanceadd.h:54
void performUndo() override
Undo the command.
Definition: cmddeviceinstanceadd.cpp:56
void performRedo() override
Redo the command.
Definition: cmddeviceinstanceadd.cpp:60
CmdDeviceInstanceAdd(BI_Device &device) noexcept
Definition: cmddeviceinstanceadd.cpp:40
bool performExecute() override
Execute the command the first time.
Definition: cmddeviceinstanceadd.cpp:51
The BI_Device class.
Definition: bi_device.h:62
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47