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  ******************************************************************************/
34 namespace librepcb {
35 
36 class BI_Device;
37 class LengthUnit;
38 class Part;
39 class Project;
40 class Workspace;
41 
42 namespace editor {
43 
44 class UndoCommand;
45 class UndoStack;
46 
47 namespace Ui {
48 class DeviceInstancePropertiesDialog;
49 }
50 
51 /*******************************************************************************
52  * Class DeviceInstancePropertiesDialog
53  ******************************************************************************/
54 
58 class DeviceInstancePropertiesDialog final : public QDialog {
59  Q_OBJECT
60 
61 public:
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 
77 private: // 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 
84 private: // Data
90  std::shared_ptr<Part> mSelectedPart; // Avoid dangling reference.
91  QScopedPointer<Ui::DeviceInstancePropertiesDialog> mUi;
92 };
93 
94 /*******************************************************************************
95  * End of File
96  ******************************************************************************/
97 
98 } // namespace editor
99 } // namespace librepcb
100 
101 #endif
std::shared_ptr< Part > mSelectedPart
Definition: deviceinstancepropertiesdialog.h:90
QScopedPointer< Ui::DeviceInstancePropertiesDialog > mUi
Definition: deviceinstancepropertiesdialog.h:91
const Workspace & mWorkspace
Definition: deviceinstancepropertiesdialog.h:85
The DeviceInstancePropertiesDialog class.
Definition: deviceinstancepropertiesdialog.h:58
Definition: occmodel.cpp:77
The BI_Device class.
Definition: bi_device.h:57
BI_Device & mDevice
Definition: deviceinstancepropertiesdialog.h:87
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
AttributeList mAttributes
Definition: deviceinstancepropertiesdialog.h:89
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
UndoStack & mUndoStack
Definition: deviceinstancepropertiesdialog.h:88
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:54
Project & mProject
Definition: deviceinstancepropertiesdialog.h:86