LibrePCB Developers Documentation
zonepropertiesdialog.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_ZONEPROPERTIESDIALOG_H
21#define LIBREPCB_EDITOR_ZONEPROPERTIESDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27#include <QtWidgets>
28
29/*******************************************************************************
30 * Namespace / Forward Declarations
31 ******************************************************************************/
32namespace librepcb {
33
34class BI_Zone;
35class Layer;
36class LengthUnit;
37class Zone;
38
39namespace editor {
40
41class IF_GraphicsLayerProvider;
42class UndoStack;
43
44namespace Ui {
45class ZonePropertiesDialog;
46}
47
48/*******************************************************************************
49 * Class ZonePropertiesDialog
50 ******************************************************************************/
51
55class ZonePropertiesDialog final : public QDialog {
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
62 ZonePropertiesDialog(Zone& zone, UndoStack& undoStack,
63 const LengthUnit& lengthUnit,
65 const QString& settingsPrefix,
66 QWidget* parent = nullptr) noexcept;
67 ZonePropertiesDialog(BI_Zone& zone, UndoStack& undoStack,
68 const LengthUnit& lengthUnit,
70 const QString& settingsPrefix,
71 QWidget* parent = nullptr) noexcept;
72 ~ZonePropertiesDialog() noexcept;
73
74 // Setters
75 void setReadOnly(bool readOnly) noexcept;
76
77 // Operator Overloadings
78 ZonePropertiesDialog& operator=(const ZonePropertiesDialog& rhs) = delete;
79
80private: // Methods
81 ZonePropertiesDialog(Zone* libZone, BI_Zone* boardZone,
82 const QList<const Layer*> allLayers,
83 UndoStack& undoStack, const LengthUnit& lengthUnit,
85 const QString& settingsPrefix,
86 QWidget* parent = nullptr) noexcept;
87 template <typename T>
88 void load(const T& obj, const QSet<const Layer*> checkedLayers) noexcept;
89 void buttonBoxClicked(QAbstractButton* button) noexcept;
90 bool applyChanges() noexcept;
91 template <typename T>
92 void applyChanges(T& cmd);
93
94private: // Data
98 QScopedPointer<Ui::ZonePropertiesDialog> mUi;
99};
100
101/*******************************************************************************
102 * End of File
103 ******************************************************************************/
104
105} // namespace editor
106} // namespace librepcb
107
108#endif
The BI_Zone class.
Definition: bi_zone.h:46
The Layer class provides all supported geometry layers.
Definition: layer.h:42
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Zone class.
Definition: zone.h:43
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
The ZonePropertiesDialog class.
Definition: zonepropertiesdialog.h:55
Zone * mLibraryObj
Definition: zonepropertiesdialog.h:95
QScopedPointer< Ui::ZonePropertiesDialog > mUi
Definition: zonepropertiesdialog.h:98
BI_Zone * mBoardObj
Definition: zonepropertiesdialog.h:96
void setReadOnly(bool readOnly) noexcept
Definition: zonepropertiesdialog.cpp:131
ZonePropertiesDialog(const ZonePropertiesDialog &other)=delete
void load(const T &obj, const QSet< const Layer * > checkedLayers) noexcept
Definition: zonepropertiesdialog.cpp:154
UndoStack & mUndoStack
Definition: zonepropertiesdialog.h:97
bool applyChanges() noexcept
Definition: zonepropertiesdialog.cpp:189
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition: zonepropertiesdialog.cpp:170
Definition: occmodel.cpp:77