LibrePCB Developers Documentation
stroketextpropertiesdialog.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_STROKETEXTPROPERTIESDIALOG_H
21#define LIBREPCB_EDITOR_STROKETEXTPROPERTIESDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27#include <QtWidgets>
28
29/*******************************************************************************
30 * Namespace / Forward Declarations
31 ******************************************************************************/
32namespace librepcb {
33
34class BI_StrokeText;
35class Layer;
36class LengthUnit;
37class StrokeFont;
38class StrokeText;
39
40namespace editor {
41
42class UndoStack;
43
44namespace Ui {
45class StrokeTextPropertiesDialog;
46}
47
48/*******************************************************************************
49 * Class StrokeTextPropertiesDialog
50 ******************************************************************************/
51
55class StrokeTextPropertiesDialog final : public QDialog {
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
63 const QSet<const Layer*>& layers,
64 const LengthUnit& lengthUnit,
65 const QString& settingsPrefix,
66 QWidget* parent = nullptr) noexcept;
68 const QSet<const Layer*>& layers,
69 const LengthUnit& lengthUnit,
70 const QString& settingsPrefix,
71 QWidget* parent = nullptr) noexcept;
73
74 // Setters
75 void setReadOnly(bool readOnly) noexcept;
76
77 // Operator Overloadings
79 delete;
80
81private: // Methods
83 UndoStack& undoStack,
84 const QSet<const Layer*>& layers,
85 const LengthUnit& lengthUnit,
86 const QString& settingsPrefix,
87 QWidget* parent = nullptr) noexcept;
88 template <typename T>
89 void load(const T& obj, const StrokeFont& font) noexcept;
90 void on_buttonBox_clicked(QAbstractButton* button);
91 bool applyChanges() noexcept;
92 template <typename T>
93 void applyChanges(T& cmd);
94
95private: // Data
99 QScopedPointer<Ui::StrokeTextPropertiesDialog> mUi;
100};
101
102/*******************************************************************************
103 * End of File
104 ******************************************************************************/
105
106} // namespace editor
107} // namespace librepcb
108
109#endif
The BI_StrokeText class.
Definition: bi_stroketext.h:49
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 StrokeFont class.
Definition: strokefont.h:56
The StrokeText class.
Definition: stroketext.h:51
The StrokeTextPropertiesDialog class.
Definition: stroketextpropertiesdialog.h:55
void load(const T &obj, const StrokeFont &font) noexcept
Definition: stroketextpropertiesdialog.cpp:131
StrokeText * mLibraryObj
Definition: stroketextpropertiesdialog.h:96
QScopedPointer< Ui::StrokeTextPropertiesDialog > mUi
Definition: stroketextpropertiesdialog.h:99
void on_buttonBox_clicked(QAbstractButton *button)
Definition: stroketextpropertiesdialog.cpp:167
BI_StrokeText * mBoardObj
Definition: stroketextpropertiesdialog.h:97
void setReadOnly(bool readOnly) noexcept
Definition: stroketextpropertiesdialog.cpp:100
UndoStack & mUndoStack
Definition: stroketextpropertiesdialog.h:98
bool applyChanges() noexcept
Definition: stroketextpropertiesdialog.cpp:186
StrokeTextPropertiesDialog(const StrokeTextPropertiesDialog &other)=delete
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77