LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdpastesymbolitems.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_CMDPASTESYMBOLITEMS_H
21 #define LIBREPCB_LIBRARY_EDITOR_CMDPASTESYMBOLITEMS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
28 
29 #include <QtCore>
30 
31 #include <memory>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 namespace library {
38 
39 class Symbol;
40 class SymbolGraphicsItem;
41 
42 namespace editor {
43 
44 class SymbolClipboardData;
45 
46 /*******************************************************************************
47  * Class CmdPasteSymbolItems
48  ******************************************************************************/
49 
53 class CmdPasteSymbolItems final : public UndoCommandGroup {
54 public:
55  // Constructors / Destructor
56  CmdPasteSymbolItems() = delete;
57  CmdPasteSymbolItems(const CmdPasteSymbolItems& other) = delete;
58  CmdPasteSymbolItems(Symbol& symbol, SymbolGraphicsItem& graphicsItem,
59  std::unique_ptr<SymbolClipboardData> data,
60  const Point& posOffset) noexcept;
61  ~CmdPasteSymbolItems() noexcept;
62 
63  // Operator Overloadings
65 
66 protected: // Methods
68  bool performExecute() override;
69 
70 private: // Data
73  std::unique_ptr<SymbolClipboardData> mData;
75 };
76 
77 /*******************************************************************************
78  * End of File
79  ******************************************************************************/
80 
81 } // namespace editor
82 } // namespace library
83 } // namespace librepcb
84 
85 #endif // LIBREPCB_LIBRARY_EDITOR_CMDPASTESYMBOLITEMS_H
CmdPasteSymbolItems & operator=(const CmdPasteSymbolItems &rhs)=delete
bool performExecute() override
Execute the command the first time.
Definition: cmdpastesymbolitems.cpp:68
~CmdPasteSymbolItems() noexcept
Definition: cmdpastesymbolitems.cpp:61
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:43
The Symbol class represents the part of a component which is added to schematics. ...
Definition: symbol.h:57
Point mPosOffset
Definition: cmdpastesymbolitems.h:74
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
std::unique_ptr< SymbolClipboardData > mData
Definition: cmdpastesymbolitems.h:73
SymbolGraphicsItem & mGraphicsItem
Definition: cmdpastesymbolitems.h:72
The CmdPasteSymbolItems class.
Definition: cmdpastesymbolitems.h:53
The SymbolGraphicsItem class.
Definition: symbolgraphicsitem.h:58
Symbol & mSymbol
Definition: cmdpastesymbolitems.h:71