LibrePCB Developers Documentation
deviceinstancepropertiesdialog.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_DEVICEINSTANCEPROPERTIESDIALOG_H
21#define LIBREPCB_EDITOR_DEVICEINSTANCEPROPERTIESDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class BI_Device;
37class LengthUnit;
38class Part;
39class Project;
40class Workspace;
41
42namespace editor {
43
44class UndoCommand;
45class UndoStack;
46
47namespace Ui {
48class DeviceInstancePropertiesDialog;
49}
50
51/*******************************************************************************
52 * Class DeviceInstancePropertiesDialog
53 ******************************************************************************/
54
58class DeviceInstancePropertiesDialog final : public QDialog {
59 Q_OBJECT
60
61public:
62 // Constructors / Destructor
65 delete;
67 BI_Device& device, UndoStack& undoStack,
68 const LengthUnit& lengthUnit,
69 const QString& settingsPrefix,
70 QWidget* parent) noexcept;
72
73 // Operator Overloadings
75 const DeviceInstancePropertiesDialog& rhs) = delete;
76
77private: // Methods
78 void setSelectedPart(std::shared_ptr<Part> part) noexcept;
79 void buttonBoxClicked(QAbstractButton* button) noexcept;
80 void keyPressEvent(QKeyEvent* e) noexcept override;
81 void accept() noexcept override;
82 bool applyChanges() noexcept;
83
84private: // Data
90 std::shared_ptr<Part> mSelectedPart; // Avoid dangling reference.
92};
93
94/*******************************************************************************
95 * End of File
96 ******************************************************************************/
97
98} // namespace editor
99} // namespace librepcb
100
101#endif
The BI_Device class.
Definition: bi_device.h:57
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Part class.
Definition: part.h:46
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The DeviceInstancePropertiesDialog class.
Definition: deviceinstancepropertiesdialog.h:58
void keyPressEvent(QKeyEvent *e) noexcept override
Definition: deviceinstancepropertiesdialog.cpp:173
BI_Device & mDevice
Definition: deviceinstancepropertiesdialog.h:87
const Workspace & mWorkspace
Definition: deviceinstancepropertiesdialog.h:85
UndoStack & mUndoStack
Definition: deviceinstancepropertiesdialog.h:88
Project & mProject
Definition: deviceinstancepropertiesdialog.h:86
std::shared_ptr< Part > mSelectedPart
Definition: deviceinstancepropertiesdialog.h:90
AttributeList mAttributes
Definition: deviceinstancepropertiesdialog.h:89
void setSelectedPart(std::shared_ptr< Part > part) noexcept
Definition: deviceinstancepropertiesdialog.cpp:142
~DeviceInstancePropertiesDialog() noexcept
Definition: deviceinstancepropertiesdialog.cpp:133
DeviceInstancePropertiesDialog(const DeviceInstancePropertiesDialog &other)=delete
bool applyChanges() noexcept
Definition: deviceinstancepropertiesdialog.cpp:193
QScopedPointer< Ui::DeviceInstancePropertiesDialog > mUi
Definition: deviceinstancepropertiesdialog.h:91
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition: deviceinstancepropertiesdialog.cpp:155
void accept() noexcept override
Definition: deviceinstancepropertiesdialog.cpp:187
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77