LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdlibrarycategoryedit.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_CMDLIBRARYCATEGORYEDIT_H
21 #define LIBREPCB_LIBRARY_CMDLIBRARYCATEGORYEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../../cmd/cmdlibrarybaseelementedit.h"
27 #include "../librarycategory.h"
28 
29 #include <QtCore>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 namespace library {
36 
37 /*******************************************************************************
38  * Class CmdLibraryCategoryEdit
39  ******************************************************************************/
40 
45 public:
46  // Constructors / Destructor
47  CmdLibraryCategoryEdit() = delete;
48  CmdLibraryCategoryEdit(const CmdLibraryCategoryEdit& other) = delete;
49  explicit CmdLibraryCategoryEdit(LibraryCategory& category) noexcept;
50  virtual ~CmdLibraryCategoryEdit() noexcept;
51 
52  // Setters
53  void setParentUuid(const tl::optional<Uuid>& parentUuid) noexcept;
54 
55  // Operator Overloadings
57 
58 private: // Methods
60  virtual bool performExecute() override;
61 
63  virtual void performUndo() override;
64 
66  virtual void performRedo() override;
67 
68 private: // Data
70 
71  tl::optional<Uuid> mOldParentUuid;
72  tl::optional<Uuid> mNewParentUuid;
73 };
74 
75 /*******************************************************************************
76  * End of File
77  ******************************************************************************/
78 
79 } // namespace library
80 } // namespace librepcb
81 
82 #endif // LIBREPCB_LIBRARY_CMDLIBRARYCATEGORYEDIT_H
tl::optional< Uuid > mNewParentUuid
Definition: cmdlibrarycategoryedit.h:72
virtual bool performExecute() override
Execute the command the first time.
Definition: cmdlibrarycategoryedit.cpp:62
virtual void performRedo() override
Redo the command.
Definition: cmdlibrarycategoryedit.cpp:73
virtual void performUndo() override
Undo the command.
Definition: cmdlibrarycategoryedit.cpp:68
void setParentUuid(const tl::optional< Uuid > &parentUuid) noexcept
Definition: cmdlibrarycategoryedit.cpp:52
The CmdLibraryBaseElementEdit class.
Definition: cmdlibrarybaseelementedit.h:45
The CmdLibraryCategoryEdit class.
Definition: cmdlibrarycategoryedit.h:44
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition: librarycategory.h:44
tl::optional< Uuid > mOldParentUuid
Definition: cmdlibrarycategoryedit.h:71
virtual ~CmdLibraryCategoryEdit() noexcept
Definition: cmdlibrarycategoryedit.cpp:45
LibraryCategory & mCategory
Definition: cmdlibrarycategoryedit.h:69
CmdLibraryCategoryEdit & operator=(const CmdLibraryCategoryEdit &rhs)=delete