LibrePCB Developers Documentation
cmdprojectedit.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_CMDPROJECTEDIT_H
21#define LIBREPCB_EDITOR_CMDPROJECTEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40class Project;
41
42namespace editor {
43
44/*******************************************************************************
45 * Class CmdProjectEdit
46 ******************************************************************************/
47
51class CmdProjectEdit final : public UndoCommand {
52public:
53 // Constructors / Destructor
54 explicit CmdProjectEdit(Project& project) noexcept;
55 ~CmdProjectEdit() noexcept;
56
57 // Setters
58 void setName(const ElementName& newName) noexcept;
59 void setAuthor(const QString& newAuthor) noexcept;
60 void setVersion(const FileProofName& newVersion) noexcept;
61 void setAttributes(const AttributeList& attributes) noexcept;
62 void setLocaleOrder(const QStringList& order) noexcept;
63 void setNormOrder(const QStringList& order) noexcept;
64 void setOutputBaseDir(const QString& dir) noexcept;
65 void setOutputJobs(const OutputJobList& jobs) noexcept;
66
67private:
68 // Private Methods
69
71 bool performExecute() override;
72
74 void performUndo() override;
75
77 void performRedo() override;
78
79 // Private Member Variables
80
81 // General
83
84 // Misc
87 QString mOldAuthor;
88 QString mNewAuthor;
93 QStringList mOldLocaleOrder;
94 QStringList mNewLocaleOrder;
95 QStringList mOldNormOrder;
96 QStringList mNewNormOrder;
99};
100
101/*******************************************************************************
102 * End of File
103 ******************************************************************************/
104
105} // namespace editor
106} // namespace librepcb
107
108#endif
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The CmdProjectEdit class.
Definition: cmdprojectedit.h:51
FileProofName mNewVersion
Definition: cmdprojectedit.h:90
void performRedo() override
Redo the command.
Definition: cmdprojectedit.cpp:127
AttributeList mNewAttributes
Definition: cmdprojectedit.h:92
AttributeList mOldAttributes
Definition: cmdprojectedit.h:91
QStringList mNewLocaleOrder
Definition: cmdprojectedit.h:94
QStringList mOldLocaleOrder
Definition: cmdprojectedit.h:93
void performUndo() override
Undo the command.
Definition: cmdprojectedit.cpp:117
~CmdProjectEdit() noexcept
Definition: cmdprojectedit.cpp:58
QStringList mOldNormOrder
Definition: cmdprojectedit.h:95
OutputJobList mOldOutputJobs
Definition: cmdprojectedit.h:97
ElementName mNewName
Definition: cmdprojectedit.h:86
OutputJobList mNewOutputJobs
Definition: cmdprojectedit.h:98
void setOutputBaseDir(const QString &dir) noexcept
Project & mProject
Definition: cmdprojectedit.h:82
void setNormOrder(const QStringList &order) noexcept
Definition: cmdprojectedit.cpp:90
void setOutputJobs(const OutputJobList &jobs) noexcept
Definition: cmdprojectedit.cpp:95
QStringList mNewNormOrder
Definition: cmdprojectedit.h:96
CmdProjectEdit(Project &project) noexcept
Definition: cmdprojectedit.cpp:39
ElementName mOldName
Definition: cmdprojectedit.h:85
QString mOldAuthor
Definition: cmdprojectedit.h:87
void setVersion(const FileProofName &newVersion) noexcept
Definition: cmdprojectedit.cpp:75
void setName(const ElementName &newName) noexcept
Definition: cmdprojectedit.cpp:65
void setAttributes(const AttributeList &attributes) noexcept
Definition: cmdprojectedit.cpp:80
FileProofName mOldVersion
Definition: cmdprojectedit.h:89
bool performExecute() override
Execute the command the first time.
Definition: cmdprojectedit.cpp:104
void setLocaleOrder(const QStringList &order) noexcept
Definition: cmdprojectedit.cpp:85
void setAuthor(const QString &newAuthor) noexcept
Definition: cmdprojectedit.cpp:70
QString mNewAuthor
Definition: cmdprojectedit.h:88
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, FileProofNameConstraint, FileProofNameVerifier > FileProofName
Definition: fileproofname.h:89
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84