LibrePCB Developers Documentation
cmdpackageedit.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_CMDPACKAGEEDIT_H
21#define LIBREPCB_EDITOR_CMDPACKAGEEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36namespace editor {
37
38/*******************************************************************************
39 * Class CmdPackageEdit
40 ******************************************************************************/
41
46public:
47 // Constructors / Destructor
48 CmdPackageEdit() = delete;
49 CmdPackageEdit(const CmdPackageEdit& other) = delete;
50 explicit CmdPackageEdit(Package& package) noexcept;
51 virtual ~CmdPackageEdit() noexcept;
52
53 // Setters
54 void setAssemblyType(Package::AssemblyType type) noexcept;
55
56 // Operator Overloadings
57 CmdPackageEdit& operator=(const CmdPackageEdit& rhs) = delete;
58
59protected: // Methods
61 virtual bool performExecute() override;
62
64 virtual void performUndo() override;
65
67 virtual void performRedo() override;
68
69private: // Data
71
74};
75
76/*******************************************************************************
77 * End of File
78 ******************************************************************************/
79
80} // namespace editor
81} // namespace librepcb
82
83#endif
The Package class represents a package of a component (including footprint and 3D model)
Definition: package.h:59
The CmdLibraryElementEdit class.
Definition: cmdlibraryelementedit.h:45
The CmdPackageEdit class.
Definition: cmdpackageedit.h:45
virtual void performRedo() override
Redo the command.
Definition: cmdpackageedit.cpp:71
virtual ~CmdPackageEdit() noexcept
Definition: cmdpackageedit.cpp:44
Package::AssemblyType mOldAssemblyType
Definition: cmdpackageedit.h:72
Package::AssemblyType mNewAssemblyType
Definition: cmdpackageedit.h:73
virtual void performUndo() override
Undo the command.
Definition: cmdpackageedit.cpp:66
Package & mPackage
Definition: cmdpackageedit.h:70
void setAssemblyType(Package::AssemblyType type) noexcept
Definition: cmdpackageedit.cpp:51
CmdPackageEdit(const CmdPackageEdit &other)=delete
virtual bool performExecute() override
Execute the command the first time.
Definition: cmdpackageedit.cpp:60
Definition: occmodel.cpp:77