LibrePCB Developers Documentation
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_EDITOR_COMPONENTSYMBOLVARIANTEDITDIALOG_H
21#define LIBREPCB_EDITOR_COMPONENTSYMBOLVARIANTEDITDIALOG_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 Component;
39class Symbol;
40class Workspace;
41
42namespace editor {
43
44class DefaultGraphicsLayerProvider;
45class GraphicsScene;
46class LibraryElementCache;
47class SymbolGraphicsItem;
48
49namespace Ui {
50class ComponentSymbolVariantEditDialog;
51}
52
53/*******************************************************************************
54 * Class ComponentSymbolVariantEditDialog
55 ******************************************************************************/
56
60class ComponentSymbolVariantEditDialog final : public QDialog {
61 Q_OBJECT
62
63public:
64 // Constructors / Destructor
67 const ComponentSymbolVariantEditDialog& other) = delete;
69 const Workspace& ws, std::shared_ptr<const Component> cmp,
70 std::shared_ptr<ComponentSymbolVariant> symbVar,
71 QWidget* parent = nullptr) noexcept;
73
74 // Setters
75 void setReadOnly(bool readOnly) noexcept;
76
77 // Operator Overloadings
79 const ComponentSymbolVariantEditDialog& rhs) = delete;
80
81private: // Methods
82 void accept() noexcept override;
83 void schedulePreviewUpdate() noexcept;
84 void schedulePreviewTextsUpdate() noexcept;
85 void updatePreview() noexcept;
86
87private: // Data
89 std::shared_ptr<const Component> mComponent;
96
99 QList<std::shared_ptr<Symbol>> mSymbols;
100 QList<std::shared_ptr<SymbolGraphicsItem>> mGraphicsItems;
101};
102
103/*******************************************************************************
104 * End of File
105 ******************************************************************************/
106
107} // namespace editor
108} // namespace librepcb
109
110#endif
The Component class represents a "generic" device in the library.
Definition: component.h:73
The ComponentSymbolVariant class represents a symbol variant of a component.
Definition: componentsymbolvariant.h:53
The Symbol class represents the part of a component which is added to schematics.
Definition: symbol.h:55
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The ComponentSymbolVariantEditDialog class.
Definition: componentsymbolvarianteditdialog.h:60
QList< std::shared_ptr< SymbolGraphicsItem > > mGraphicsItems
Definition: componentsymbolvarianteditdialog.h:100
QScopedPointer< Ui::ComponentSymbolVariantEditDialog > mUi
Definition: componentsymbolvarianteditdialog.h:95
bool mPreviewUpdateScheduled
Definition: componentsymbolvarianteditdialog.h:97
std::shared_ptr< ComponentSymbolVariant > mOriginalSymbVar
Definition: componentsymbolvarianteditdialog.h:90
void setReadOnly(bool readOnly) noexcept
Definition: componentsymbolvarianteditdialog.cpp:114
QScopedPointer< GraphicsScene > mGraphicsScene
Definition: componentsymbolvarianteditdialog.h:92
void updatePreview() noexcept
Definition: componentsymbolvarianteditdialog.cpp:163
std::shared_ptr< const Component > mComponent
Definition: componentsymbolvarianteditdialog.h:89
ComponentSymbolVariant mSymbVar
Definition: componentsymbolvarianteditdialog.h:91
QScopedPointer< DefaultGraphicsLayerProvider > mGraphicsLayerProvider
Definition: componentsymbolvarianteditdialog.h:93
ComponentSymbolVariantEditDialog(const ComponentSymbolVariantEditDialog &other)=delete
const Workspace & mWorkspace
Definition: componentsymbolvarianteditdialog.h:88
void schedulePreviewUpdate() noexcept
Definition: componentsymbolvarianteditdialog.cpp:147
std::shared_ptr< LibraryElementCache > mLibraryElementCache
Definition: componentsymbolvarianteditdialog.h:94
bool mPreviewTextsUpdateScheduled
Definition: componentsymbolvarianteditdialog.h:98
QList< std::shared_ptr< Symbol > > mSymbols
Definition: componentsymbolvarianteditdialog.h:99
void schedulePreviewTextsUpdate() noexcept
Definition: componentsymbolvarianteditdialog.cpp:155
void accept() noexcept override
Definition: componentsymbolvarianteditdialog.cpp:133
The DefaultGraphicsLayerProvider class.
Definition: defaultgraphicslayerprovider.h:46
The GraphicsScene class.
Definition: graphicsscene.h:45
Cache for fast access to library elements.
Definition: libraryelementcache.h:55
The SymbolGraphicsItem class.
Definition: symbolgraphicsitem.h:56
Definition: occmodel.cpp:77