LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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
55 const QList<Package::AlternativeName>& names) noexcept;
56 void setAssemblyType(Package::AssemblyType type) noexcept;
57 void setMinCopperClearance(const UnsignedLength& clr) noexcept;
58
59 // Operator Overloadings
60 CmdPackageEdit& operator=(const CmdPackageEdit& rhs) = delete;
61
62protected: // Methods
64 virtual bool performExecute() override;
65
67 virtual void performUndo() override;
68
70 virtual void performRedo() override;
71
72private: // Data
74
75 QList<Package::AlternativeName> mOldAlternativeNames;
76 QList<Package::AlternativeName> mNewAlternativeNames;
81};
82
83/*******************************************************************************
84 * End of File
85 ******************************************************************************/
86
87} // namespace editor
88} // namespace librepcb
89
90#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:90
virtual ~CmdPackageEdit() noexcept
Definition cmdpackageedit.cpp:48
UnsignedLength mOldMinCopperClearance
Definition cmdpackageedit.h:79
Package::AssemblyType mOldAssemblyType
Definition cmdpackageedit.h:77
QList< Package::AlternativeName > mNewAlternativeNames
Definition cmdpackageedit.h:76
Package::AssemblyType mNewAssemblyType
Definition cmdpackageedit.h:78
virtual void performUndo() override
Undo the command.
Definition cmdpackageedit.cpp:83
Package & mPackage
Definition cmdpackageedit.h:73
void setAssemblyType(Package::AssemblyType type) noexcept
Definition cmdpackageedit.cpp:61
CmdPackageEdit(const CmdPackageEdit &other)=delete
QList< Package::AlternativeName > mOldAlternativeNames
Definition cmdpackageedit.h:75
void setMinCopperClearance(const UnsignedLength &clr) noexcept
Definition cmdpackageedit.cpp:66
void setAlternativeNames(const QList< Package::AlternativeName > &names) noexcept
Definition cmdpackageedit.cpp:55
virtual bool performExecute() override
Execute the command the first time.
Definition cmdpackageedit.cpp:75
UnsignedLength mNewMinCopperClearance
Definition cmdpackageedit.h:80
Definition occmodel.cpp:77
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694