LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
componentsymbolvarianteditdialog.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_LIBRARY_EDITOR_COMPONENTSYMBOLVARIANTEDITDIALOG_H
21 #define LIBREPCB_LIBRARY_EDITOR_COMPONENTSYMBOLVARIANTEDITDIALOG_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class DefaultGraphicsLayerProvider;
38 class GraphicsScene;
39 
40 namespace workspace {
41 class Workspace;
42 }
43 
44 namespace library {
45 
46 class Component;
47 class Symbol;
48 class SymbolGraphicsItem;
49 class LibraryElementCache;
50 
51 namespace editor {
52 
53 namespace Ui {
54 class ComponentSymbolVariantEditDialog;
55 }
56 
57 /*******************************************************************************
58  * Class ComponentSymbolVariantEditDialog
59  ******************************************************************************/
60 
64 class ComponentSymbolVariantEditDialog final : public QDialog {
65  Q_OBJECT
66 
67 public:
68  // Constructors / Destructor
71  const ComponentSymbolVariantEditDialog& other) = delete;
73  const Component& cmp,
74  ComponentSymbolVariant& symbVar,
75  QWidget* parent = nullptr) noexcept;
77 
78  // Operator Overloadings
80  const ComponentSymbolVariantEditDialog& rhs) = delete;
81 
82 private: // Methods
83  void accept() noexcept override;
84  void updateGraphicsItems() noexcept;
85 
86 private: // Data
91  QScopedPointer<GraphicsScene> mGraphicsScene;
92  QScopedPointer<DefaultGraphicsLayerProvider> mGraphicsLayerProvider;
93  std::shared_ptr<LibraryElementCache> mLibraryElementCache;
94  QScopedPointer<Ui::ComponentSymbolVariantEditDialog> mUi;
95 
96  QList<std::shared_ptr<Symbol>> mSymbols;
97  QList<std::shared_ptr<SymbolGraphicsItem>> mGraphicsItems;
98 };
99 
100 /*******************************************************************************
101  * End of File
102  ******************************************************************************/
103 
104 } // namespace editor
105 } // namespace library
106 } // namespace librepcb
107 
108 #endif // LIBREPCB_LIBRARY_EDITOR_COMPONENTSYMBOLVARIANTEDITDIALOG_H
void accept() noexceptoverride
Definition: componentsymbolvarianteditdialog.cpp:96
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:62
~ComponentSymbolVariantEditDialog() noexcept
Definition: componentsymbolvarianteditdialog.cpp:89
QList< std::shared_ptr< SymbolGraphicsItem > > mGraphicsItems
Definition: componentsymbolvarianteditdialog.h:97
std::shared_ptr< LibraryElementCache > mLibraryElementCache
Definition: componentsymbolvarianteditdialog.h:93
QScopedPointer< Ui::ComponentSymbolVariantEditDialog > mUi
Definition: componentsymbolvarianteditdialog.h:94
The ComponentSymbolVariantEditDialog class.
Definition: componentsymbolvarianteditdialog.h:64
const Component & mComponent
Definition: componentsymbolvarianteditdialog.h:88
void updateGraphicsItems() noexcept
Definition: componentsymbolvarianteditdialog.cpp:110
QScopedPointer< DefaultGraphicsLayerProvider > mGraphicsLayerProvider
Definition: componentsymbolvarianteditdialog.h:92
ComponentSymbolVariantEditDialog & operator=(const ComponentSymbolVariantEditDialog &rhs)=delete
ComponentSymbolVariant & mOriginalSymbVar
Definition: componentsymbolvarianteditdialog.h:89
QList< std::shared_ptr< Symbol > > mSymbols
Definition: componentsymbolvarianteditdialog.h:96
ComponentSymbolVariant mSymbVar
Definition: componentsymbolvarianteditdialog.h:90
QScopedPointer< GraphicsScene > mGraphicsScene
Definition: componentsymbolvarianteditdialog.h:91
const workspace::Workspace & mWorkspace
Definition: componentsymbolvarianteditdialog.h:87
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition: componentsymbolvariant.h:58
The Component class represents a "generic" device in the library.
Definition: component.h:73