LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdlibrarybaseelementedit.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_CMDLIBRARYBASEELEMENTEDIT_H
21 #define LIBREPCB_LIBRARY_CMDLIBRARYBASEELEMENTEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../librarybaseelement.h"
27 
29 
30 #include <QtCore>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 namespace library {
37 
38 /*******************************************************************************
39  * Class CmdLibraryBaseElementEdit
40  ******************************************************************************/
41 
46 public:
47  // Constructors / Destructor
48  CmdLibraryBaseElementEdit() = delete;
51  const QString& text) noexcept;
52  virtual ~CmdLibraryBaseElementEdit() noexcept;
53 
54  // Setters
55  void setName(const QString& locale, const ElementName& name) noexcept;
56  void setNames(const LocalizedNameMap& names) noexcept;
57  void setDescription(const QString& locale, const QString& desc) noexcept;
58  void setDescriptions(const LocalizedDescriptionMap& descriptions) noexcept;
59  void setKeywords(const QString& locale, const QString& keywords) noexcept;
60  void setKeywords(const LocalizedKeywordsMap& keywords) noexcept;
61  void setVersion(const Version& version) noexcept;
62  void setAuthor(const QString& author) noexcept;
63  void setDeprecated(bool deprecated) noexcept;
64 
65  // Operator Overloadings
67  delete;
68 
69 protected: // Methods
71  virtual bool performExecute() override;
72 
74  virtual void performUndo() override;
75 
77  virtual void performRedo() override;
78 
79 private: // Data
81 
90  QString mOldAuthor;
91  QString mNewAuthor;
94 };
95 
96 /*******************************************************************************
97  * End of File
98  ******************************************************************************/
99 
100 } // namespace library
101 } // namespace librepcb
102 
103 #endif // LIBREPCB_LIBRARY_CMDLIBRARYBASEELEMENTEDIT_H
The Version class represents a version number in the format "1.42.7".
Definition: version.h:60
void setKeywords(const QString &locale, const QString &keywords) noexcept
Definition: cmdlibrarybaseelementedit.cpp:86
QString mOldAuthor
Definition: cmdlibrarybaseelementedit.h:90
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition: cmdlibrarybaseelementedit.cpp:80
LocalizedDescriptionMap mNewDescriptions
Definition: cmdlibrarybaseelementedit.h:85
void setName(const QString &locale, const ElementName &name) noexcept
Definition: cmdlibrarybaseelementedit.cpp:62
Version mNewVersion
Definition: cmdlibrarybaseelementedit.h:89
void setDescription(const QString &locale, const QString &desc) noexcept
Definition: cmdlibrarybaseelementedit.cpp:74
virtual void performRedo() override
Redo the command.
Definition: cmdlibrarybaseelementedit.cpp:138
Version mOldVersion
Definition: cmdlibrarybaseelementedit.h:88
The CmdLibraryBaseElementEdit class.
Definition: cmdlibrarybaseelementedit.h:45
virtual void performUndo() override
Undo the command.
Definition: cmdlibrarybaseelementedit.cpp:129
bool mNewDeprecated
Definition: cmdlibrarybaseelementedit.h:93
virtual bool performExecute() override
Execute the command the first time.
Definition: cmdlibrarybaseelementedit.cpp:117
LocalizedNameMap mNewNames
Definition: cmdlibrarybaseelementedit.h:83
The LibraryBaseElement class.
Definition: librarybaseelement.h:52
void setDeprecated(bool deprecated) noexcept
Definition: cmdlibrarybaseelementedit.cpp:108
QString mNewAuthor
Definition: cmdlibrarybaseelementedit.h:91
LocalizedNameMap mOldNames
Definition: cmdlibrarybaseelementedit.h:82
void setAuthor(const QString &author) noexcept
Definition: cmdlibrarybaseelementedit.cpp:103
void setVersion(const Version &version) noexcept
Definition: cmdlibrarybaseelementedit.cpp:98
LibraryBaseElement & mElement
Definition: cmdlibrarybaseelementedit.h:80
LocalizedKeywordsMap mOldKeywords
Definition: cmdlibrarybaseelementedit.h:86
void setNames(const LocalizedNameMap &names) noexcept
Definition: cmdlibrarybaseelementedit.cpp:68
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:52
CmdLibraryBaseElementEdit & operator=(const CmdLibraryBaseElementEdit &rhs)=delete
bool mOldDeprecated
Definition: cmdlibrarybaseelementedit.h:92
virtual ~CmdLibraryBaseElementEdit() noexcept
Definition: cmdlibrarybaseelementedit.cpp:55
LocalizedKeywordsMap mNewKeywords
Definition: cmdlibrarybaseelementedit.h:87
LocalizedDescriptionMap mOldDescriptions
Definition: cmdlibrarybaseelementedit.h:84
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:92