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