LibrePCB Developers Documentation
Loading...
Searching...
No Matches
footprintclipboarddata.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_FOOTPRINTCLIPBOARDDATA_H
21#define LIBREPCB_EDITOR_FOOTPRINTCLIPBOARDDATA_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26
34
35#include <QtCore>
36#include <QtWidgets>
37
38#include <memory>
39
40/*******************************************************************************
41 * Namespace / Forward Declarations
42 ******************************************************************************/
43namespace librepcb {
44namespace editor {
45
46class IF_GraphicsLayerProvider;
47
48/*******************************************************************************
49 * Class FootprintClipboardData
50 ******************************************************************************/
51
56public:
57 // Constructors / Destructor
60 FootprintClipboardData(const Uuid& footprintUuid,
61 const PackagePadList& packagePads,
62 const Point& cursorPos) noexcept;
63 explicit FootprintClipboardData(const SExpression& node);
64 ~FootprintClipboardData() noexcept;
65
66 // Getters
67 bool getItemCount() const noexcept {
70 }
71 const Uuid& getFootprintUuid() const noexcept { return mFootprintUuid; }
72 const Point& getCursorPos() const noexcept { return mCursorPos; }
74 const PackagePadList& getPackagePads() const noexcept { return mPackagePads; }
76 const FootprintPadList& getFootprintPads() const noexcept {
77 return mFootprintPads;
78 }
79 PolygonList& getPolygons() noexcept { return mPolygons; }
80 const PolygonList& getPolygons() const noexcept { return mPolygons; }
81 CircleList& getCircles() noexcept { return mCircles; }
82 const CircleList& getCircles() const noexcept { return mCircles; }
84 const StrokeTextList& getStrokeTexts() const noexcept { return mStrokeTexts; }
85 ZoneList& getZones() noexcept { return mZones; }
86 const ZoneList& getZones() const noexcept { return mZones; }
87 HoleList& getHoles() noexcept { return mHoles; }
88 const HoleList& getHoles() const noexcept { return mHoles; }
89
90 // General Methods
91 std::unique_ptr<QMimeData> toMimeData(const IF_GraphicsLayerProvider& lp);
92 static std::unique_ptr<FootprintClipboardData> fromMimeData(
93 const QMimeData* mime);
94
95 // Operator Overloadings
97
98private: // Methods
99 QPixmap generatePixmap(const IF_GraphicsLayerProvider& lp) noexcept;
100 static QString getMimeType() noexcept;
101
102private: // Data
112};
113
114/*******************************************************************************
115 * End of File
116 ******************************************************************************/
117
118} // namespace editor
119} // namespace librepcb
120
121#endif
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The SExpression class.
Definition sexpression.h:69
int count() const noexcept
Definition serializableobjectlist.h:199
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The FootprintClipboardData class.
Definition footprintclipboarddata.h:55
PackagePadList & getPackagePads() noexcept
Definition footprintclipboarddata.h:73
PackagePadList mPackagePads
Definition footprintclipboarddata.h:104
HoleList & getHoles() noexcept
Definition footprintclipboarddata.h:87
static QString getMimeType() noexcept
Definition footprintclipboarddata.cpp:160
const FootprintPadList & getFootprintPads() const noexcept
Definition footprintclipboarddata.h:76
const Uuid & getFootprintUuid() const noexcept
Definition footprintclipboarddata.h:71
ZoneList & getZones() noexcept
Definition footprintclipboarddata.h:85
PolygonList & getPolygons() noexcept
Definition footprintclipboarddata.h:79
CircleList mCircles
Definition footprintclipboarddata.h:108
const PackagePadList & getPackagePads() const noexcept
Definition footprintclipboarddata.h:74
Uuid mFootprintUuid
Definition footprintclipboarddata.h:103
const PolygonList & getPolygons() const noexcept
Definition footprintclipboarddata.h:80
bool getItemCount() const noexcept
Definition footprintclipboarddata.h:67
const HoleList & getHoles() const noexcept
Definition footprintclipboarddata.h:88
const ZoneList & getZones() const noexcept
Definition footprintclipboarddata.h:86
ZoneList mZones
Definition footprintclipboarddata.h:110
FootprintClipboardData & operator=(const FootprintClipboardData &rhs)=delete
const Point & getCursorPos() const noexcept
Definition footprintclipboarddata.h:72
const CircleList & getCircles() const noexcept
Definition footprintclipboarddata.h:82
~FootprintClipboardData() noexcept
Definition footprintclipboarddata.cpp:68
static std::unique_ptr< FootprintClipboardData > fromMimeData(const QMimeData *mime)
Definition footprintclipboarddata.cpp:113
FootprintClipboardData(const FootprintClipboardData &other)=delete
FootprintPadList mFootprintPads
Definition footprintclipboarddata.h:106
PolygonList mPolygons
Definition footprintclipboarddata.h:107
StrokeTextList & getStrokeTexts() noexcept
Definition footprintclipboarddata.h:83
CircleList & getCircles() noexcept
Definition footprintclipboarddata.h:81
const StrokeTextList & getStrokeTexts() const noexcept
Definition footprintclipboarddata.h:84
HoleList mHoles
Definition footprintclipboarddata.h:111
std::unique_ptr< QMimeData > toMimeData(const IF_GraphicsLayerProvider &lp)
Definition footprintclipboarddata.cpp:75
FootprintPadList & getFootprintPads() noexcept
Definition footprintclipboarddata.h:75
StrokeTextList mStrokeTexts
Definition footprintclipboarddata.h:109
Point mCursorPos
Definition footprintclipboarddata.h:105
QPixmap generatePixmap(const IF_GraphicsLayerProvider &lp) noexcept
Definition footprintclipboarddata.cpp:130
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition graphicslayer.h:111
Definition occmodel.cpp:76