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_PROJECT_CMDDEVICEINSTANCEEDITALL_H
21 #define LIBREPCB_PROJECT_CMDDEVICEINSTANCEEDITALL_H
22 
23 /*******************************************************************************
24  *  Includes
25  ******************************************************************************/
26 #include <librepcb/common/undocommandgroup.h>
27 #include <librepcb/common/units/all_length_units.h>
28 
29 #include <QtCore>
30 
31 /*******************************************************************************
32  *  Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 class CmdStrokeTextEdit;
37 
38 namespace project {
39 
40 class BI_Device;
41 class CmdDeviceInstanceEdit;
42 
43 /*******************************************************************************
44  *  Class CmdDeviceInstanceEditAll
45  ******************************************************************************/
46 
47 /**
48  * @brief The CmdDeviceInstanceEditAll class
49  */
50 class CmdDeviceInstanceEditAll final : public UndoCommandGroup {
51 public:
52   // Constructors / Destructor
53   explicit CmdDeviceInstanceEditAll(BI_Device& dev) noexcept;
54   ~CmdDeviceInstanceEditAll() noexcept;
55 
56   // General Methods
57   void setPosition(const Point& pos, bool immediate) noexcept;
58   void translate(const Point& deltaPos, bool immediate) noexcept;
59   void setRotation(const Angle& angle, bool immediate) noexcept;
60   void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
61   void setMirrored(bool mirrored, bool immediate);
62   void mirror(const Point& center, Qt::Orientation orientation, bool immediate);
63 
64 private:
65   CmdDeviceInstanceEdit* mDevEditCmd;
66   QVector<CmdStrokeTextEdit*> mTextEditCmds;
67 };
68 
69 /*******************************************************************************
70  *  End of File
71  ******************************************************************************/
72 
73 }  // namespace project
74 }  // namespace librepcb
75 
76 #endif  // LIBREPCB_PROJECT_CMDDEVICEINSTANCEEDITALL_H
77