LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdmoveselectedsymbolitems.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_LIBRARY_EDITOR_CMDMOVESELECTEDSYMBOLITEMS_H
21 #define LIBREPCB_LIBRARY_EDITOR_CMDMOVESELECTEDSYMBOLITEMS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../symboleditorstate.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 
38 class CmdCircleEdit;
39 class CmdTextEdit;
40 class CmdPolygonEdit;
41 
42 namespace library {
43 
44 class CmdSymbolPinEdit;
45 
46 namespace editor {
47 
48 /*******************************************************************************
49  * Class CmdMoveSelectedSymbolItems
50  ******************************************************************************/
51 
59 public:
60  // Constructors / Destructor
61  CmdMoveSelectedSymbolItems() = delete;
64  const Point& startPos) noexcept;
65  ~CmdMoveSelectedSymbolItems() noexcept;
66 
67  // General Methods
68  void setCurrentPosition(const Point& pos) noexcept;
69 
70  // Operator Overloadings
72  delete;
73 
74 private:
75  // Private Methods
76 
78  bool performExecute() override;
79 
80  void deleteAllCommands() noexcept;
81 
82  // Private Member Variables
86 
87  // Move commands
88  QList<CmdSymbolPinEdit*> mPinEditCmds;
89  QList<CmdCircleEdit*> mCircleEditCmds;
90  QList<CmdPolygonEdit*> mPolygonEditCmds;
91  QList<CmdTextEdit*> mTextEditCmds;
92 };
93 
94 /*******************************************************************************
95  * End of File
96  ******************************************************************************/
97 
98 } // namespace editor
99 } // namespace library
100 } // namespace librepcb
101 
102 #endif // LIBREPCB_LIBRARY_EDITOR_CMDMOVESELECTEDSYMBOLITEMS_H
void deleteAllCommands() noexcept
Definition: cmdmoveselectedsymbolitems.cpp:148
Point mDeltaPos
Definition: cmdmoveselectedsymbolitems.h:85
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition: cmdmoveselectedsymbolitems.h:88
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:46
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmdmoveselectedsymbolitems.h:90
The CmdMoveSelectedSymbolItems class.
Definition: cmdmoveselectedsymbolitems.h:58
Point mStartPos
Definition: cmdmoveselectedsymbolitems.h:84
~CmdMoveSelectedSymbolItems() noexcept
Definition: cmdmoveselectedsymbolitems.cpp:85
CmdMoveSelectedSymbolItems & operator=(const CmdMoveSelectedSymbolItems &rhs)=delete
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:81
const SymbolEditorState::Context & mContext
Definition: cmdmoveselectedsymbolitems.h:83
QList< CmdTextEdit * > mTextEditCmds
Definition: cmdmoveselectedsymbolitems.h:91
void setCurrentPosition(const Point &pos) noexcept
Definition: cmdmoveselectedsymbolitems.cpp:93
bool performExecute() override
Execute the command the first time.
Definition: cmdmoveselectedsymbolitems.cpp:119
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmdmoveselectedsymbolitems.h:89