LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 setCreated(const QDateTime& created) noexcept;
64 void setDeprecated(bool deprecated) noexcept;
65
66 // Operator Overloadings
68 delete;
69
70protected: // Methods
72 virtual bool performExecute() override;
73
75 virtual void performUndo() override;
76
78 virtual void performRedo() override;
79
80private: // Data
82
91 QString mOldAuthor;
92 QString mNewAuthor;
93 QDateTime mOldCreated;
94 QDateTime mNewCreated;
97};
98
99/*******************************************************************************
100 * End of File
101 ******************************************************************************/
102
103} // namespace editor
104} // namespace librepcb
105
106#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:147
QDateTime mOldCreated
Definition cmdlibrarybaseelementedit.h:93
void setName(const QString &locale, const ElementName &name) noexcept
Definition cmdlibrarybaseelementedit.cpp:64
void setVersion(const Version &version) noexcept
Definition cmdlibrarybaseelementedit.cpp:100
LocalizedDescriptionMap mNewDescriptions
Definition cmdlibrarybaseelementedit.h:86
LocalizedKeywordsMap mNewKeywords
Definition cmdlibrarybaseelementedit.h:88
void setDeprecated(bool deprecated) noexcept
Definition cmdlibrarybaseelementedit.cpp:115
LocalizedDescriptionMap mOldDescriptions
Definition cmdlibrarybaseelementedit.h:85
void setNames(const LocalizedNameMap &names) noexcept
Definition cmdlibrarybaseelementedit.cpp:70
virtual void performUndo() override
Undo the command.
Definition cmdlibrarybaseelementedit.cpp:137
void setCreated(const QDateTime &created) noexcept
Definition cmdlibrarybaseelementedit.cpp:110
Version mNewVersion
Definition cmdlibrarybaseelementedit.h:90
bool mOldDeprecated
Definition cmdlibrarybaseelementedit.h:95
LibraryBaseElement & mElement
Definition cmdlibrarybaseelementedit.h:81
Version mOldVersion
Definition cmdlibrarybaseelementedit.h:89
LocalizedNameMap mOldNames
Definition cmdlibrarybaseelementedit.h:83
LocalizedNameMap mNewNames
Definition cmdlibrarybaseelementedit.h:84
bool mNewDeprecated
Definition cmdlibrarybaseelementedit.h:96
virtual ~CmdLibraryBaseElementEdit() noexcept
Definition cmdlibrarybaseelementedit.cpp:57
QString mOldAuthor
Definition cmdlibrarybaseelementedit.h:91
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition cmdlibrarybaseelementedit.cpp:82
void setKeywords(const QString &locale, const QString &keywords) noexcept
Definition cmdlibrarybaseelementedit.cpp:88
virtual bool performExecute() override
Execute the command the first time.
Definition cmdlibrarybaseelementedit.cpp:124
LocalizedKeywordsMap mOldKeywords
Definition cmdlibrarybaseelementedit.h:87
QDateTime mNewCreated
Definition cmdlibrarybaseelementedit.h:94
CmdLibraryBaseElementEdit(const CmdLibraryBaseElementEdit &other)=delete
void setDescription(const QString &locale, const QString &desc) noexcept
Definition cmdlibrarybaseelementedit.cpp:76
void setAuthor(const QString &author) noexcept
Definition cmdlibrarybaseelementedit.cpp:105
QString mNewAuthor
Definition cmdlibrarybaseelementedit.h:92
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