LibrePCB Developers Documentation
symbolpinpropertiesdialog.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_SYMBOLPINPROPERTIESDIALOG_H
21#define LIBREPCB_EDITOR_SYMBOLPINPROPERTIESDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class LengthUnit;
39class SymbolPin;
40
41namespace editor {
42
43class UndoStack;
44
45namespace Ui {
46class SymbolPinPropertiesDialog;
47}
48
49/*******************************************************************************
50 * Class SymbolPinPropertiesDialog
51 ******************************************************************************/
52
56class SymbolPinPropertiesDialog final : public QDialog {
57 Q_OBJECT
58
59public:
60 // Constructors / Destructor
63 SymbolPinPropertiesDialog(std::shared_ptr<SymbolPin> pin,
64 UndoStack& undoStack, const LengthUnit& lengthUnit,
65 const QString& settingsPrefix,
66 QWidget* parent = nullptr) noexcept;
67 ~SymbolPinPropertiesDialog() noexcept;
68
69 // Setters
70 void setReadOnly(bool readOnly) noexcept;
71
72 // Operator Overloadings
74 delete;
75
76private: // Methods
77 void updateNamePositionTooltip(const UnsignedLength& length) noexcept;
78 void on_buttonBox_clicked(QAbstractButton* button);
79 bool applyChanges() noexcept;
80
81private: // Data
82 std::shared_ptr<SymbolPin> mSymbolPin;
84 QScopedPointer<Ui::SymbolPinPropertiesDialog> mUi;
85};
86
87/*******************************************************************************
88 * End of File
89 ******************************************************************************/
90
91} // namespace editor
92} // namespace librepcb
93
94#endif
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The SymbolPin class represents one pin of a symbol.
Definition: symbolpin.h:51
The SymbolPinPropertiesDialog class.
Definition: symbolpinpropertiesdialog.h:56
void on_buttonBox_clicked(QAbstractButton *button)
Definition: symbolpinpropertiesdialog.cpp:141
void setReadOnly(bool readOnly) noexcept
Definition: symbolpinpropertiesdialog.cpp:108
std::shared_ptr< SymbolPin > mSymbolPin
Definition: symbolpinpropertiesdialog.h:82
void updateNamePositionTooltip(const UnsignedLength &length) noexcept
Definition: symbolpinpropertiesdialog.cpp:134
UndoStack & mUndoStack
Definition: symbolpinpropertiesdialog.h:83
SymbolPinPropertiesDialog(const SymbolPinPropertiesDialog &other)=delete
bool applyChanges() noexcept
Definition: symbolpinpropertiesdialog.cpp:160
QScopedPointer< Ui::SymbolPinPropertiesDialog > mUi
Definition: symbolpinpropertiesdialog.h:84
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696