LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdlibraryelementedit.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_CMDLIBRARYELEMENTEDIT_H
21 #define LIBREPCB_LIBRARY_CMDLIBRARYELEMENTEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../libraryelement.h"
28 
29 #include <QtCore>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 namespace library {
36 
37 /*******************************************************************************
38  * Class CmdLibraryElementEdit
39  ******************************************************************************/
40 
45 public:
46  // Constructors / Destructor
47  CmdLibraryElementEdit() = delete;
48  CmdLibraryElementEdit(const CmdLibraryElementEdit& other) = delete;
49  explicit CmdLibraryElementEdit(LibraryElement& element,
50  const QString& text) noexcept;
51  virtual ~CmdLibraryElementEdit() noexcept;
52 
53  // Setters
54  void setCategories(const QSet<Uuid>& uuids) noexcept;
55 
56  // Operator Overloadings
58 
59 protected: // Methods
61  virtual bool performExecute() override;
62 
64  virtual void performUndo() override;
65 
67  virtual void performRedo() override;
68 
69 private: // Data
71 
72  QSet<Uuid> mOldCategories;
73  QSet<Uuid> mNewCategories;
74 };
75 
76 /*******************************************************************************
77  * End of File
78  ******************************************************************************/
79 
80 } // namespace library
81 } // namespace librepcb
82 
83 #endif // LIBREPCB_LIBRARY_CMDLIBRARYELEMENTEDIT_H
virtual ~CmdLibraryElementEdit() noexcept
Definition: cmdlibraryelementedit.cpp:45
virtual void performUndo() override
Undo the command.
Definition: cmdlibraryelementedit.cpp:67
virtual bool performExecute() override
Execute the command the first time.
Definition: cmdlibraryelementedit.cpp:61
The CmdLibraryBaseElementEdit class.
Definition: cmdlibrarybaseelementedit.h:45
CmdLibraryElementEdit & operator=(const CmdLibraryElementEdit &rhs)=delete
LibraryElement & mElement
Definition: cmdlibraryelementedit.h:70
The CmdLibraryElementEdit class.
Definition: cmdlibraryelementedit.h:44
void setCategories(const QSet< Uuid > &uuids) noexcept
Definition: cmdlibraryelementedit.cpp:52
virtual void performRedo() override
Redo the command.
Definition: cmdlibraryelementedit.cpp:72
The LibraryElement class extends the LibraryBaseElement class with some attributes and methods which ...
Definition: libraryelement.h:45
QSet< Uuid > mOldCategories
Definition: cmdlibraryelementedit.h:72
QSet< Uuid > mNewCategories
Definition: cmdlibraryelementedit.h:73