20#ifndef LIBREPCB_EDITOR_ADDCOMPONENTDIALOG_H
21#define LIBREPCB_EDITOR_ADDCOMPONENTDIALOG_H
26#include "../workspace/categorytreemodel.h"
46class ComponentSymbolVariant;
50class WorkspaceLibraryDb;
51class WorkspaceSettings;
55class DefaultGraphicsLayerProvider;
56class FootprintGraphicsItem;
58class PartInformationProvider;
59class PartInformationToolTip;
60class SymbolGraphicsItem;
63class AddComponentDialog;
90 QHash<FilePath, SearchResultDevice>
devices;
104 const QStringList& localeOrder,
105 const QStringList& normOrder,
106 QWidget* parent =
nullptr);
144 const QString keyword,
145 const std::optional<Uuid>& selectedDevice = std::nullopt)
noexcept;
146 virtual bool eventFilter(QObject* obj, QEvent* e)
noexcept override;
149 virtual bool event(QEvent*
event)
noexcept override;
154 const QModelIndex& previous)
noexcept;
156 QTreeWidgetItem* previous)
noexcept;
158 int column)
noexcept;
166 const QString& input,
167 const std::optional<Uuid>& selectedDevice = std::nullopt,
168 bool selectFirstDevice =
false);
169 SearchResult
search(
const QString& input);
173 std::shared_ptr<const ComponentSymbolVariant> symbVar);
176 void addPartItem(std::shared_ptr<Part> part, QTreeWidgetItem* parent);
179 virtual
void accept() noexcept override;
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 Device class represents an instance of a component (a "real" component)
Definition device.h:55
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The Package class represents a package of a component (including footprint and 3D model)
Definition package.h:59
The Part class.
Definition part.h:46
The Symbol class represents the part of a component which is added to schematics.
Definition symbol.h:55
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The WorkspaceLibraryDb class.
Definition workspacelibrarydb.h:58
Container for all workspace related settings.
Definition workspacesettings.h:60
The AddComponentDialog class.
Definition addcomponentdialog.h:73
void treeComponents_itemExpanded(QTreeWidgetItem *item) noexcept
Definition addcomponentdialog.cpp:429
void treeComponents_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) noexcept
Definition addcomponentdialog.cpp:362
QScopedPointer< FootprintGraphicsItem > mPreviewFootprintGraphicsItem
Definition addcomponentdialog.h:207
void selectComponentByKeyword(const QString keyword, const std::optional< Uuid > &selectedDevice=std::nullopt) noexcept
Definition addcomponentdialog.cpp:294
std::shared_ptr< const Device > getSelectedDevice() const noexcept
Definition addcomponentdialog.h:117
std::optional< Package::AssemblyType > getSelectedPackageAssemblyType() const noexcept
Definition addcomponentdialog.cpp:279
QList< std::shared_ptr< SymbolGraphicsItem > > mPreviewSymbolGraphicsItems
Definition addcomponentdialog.h:206
void updatePartsInformation(int downloadDelayMs=0) noexcept
Definition addcomponentdialog.cpp:912
QScopedPointer< PartInformationToolTip > mPartToolTip
Definition addcomponentdialog.h:191
uint mPartInfoProgress
Definition addcomponentdialog.h:192
void setSelectedSymbVar(std::shared_ptr< const ComponentSymbolVariant > symbVar)
Definition addcomponentdialog.cpp:818
void customComponentsContextMenuRequested(const QPoint &pos) noexcept
Definition addcomponentdialog.cpp:450
std::shared_ptr< const Component > mSelectedComponent
Definition addcomponentdialog.h:200
const WorkspaceLibraryDb & mDb
Definition addcomponentdialog.h:182
std::shared_ptr< const ComponentSymbolVariant > getSelectedSymbolVariant() const noexcept
Definition addcomponentdialog.h:113
QScopedPointer< Ui::AddComponentDialog > mUi
Definition addcomponentdialog.h:186
QScopedPointer< GraphicsScene > mDevicePreviewScene
Definition addcomponentdialog.h:188
QScopedPointer< DefaultGraphicsLayerProvider > mGraphicsLayerProvider
Definition addcomponentdialog.h:189
std::optional< Uuid > mSelectedCategoryUuid
Definition addcomponentdialog.h:199
bool getAutoOpenAgain() const noexcept
Check if dialog shall be opened again after the current component.
Definition addcomponentdialog.cpp:286
std::shared_ptr< const Device > mSelectedDevice
Definition addcomponentdialog.h:202
void addPartItem(std::shared_ptr< Part > part, QTreeWidgetItem *parent)
Definition addcomponentdialog.cpp:888
void treeCategories_currentItemChanged(const QModelIndex ¤t, const QModelIndex &previous) noexcept
Definition addcomponentdialog.cpp:348
void cbxSymbVar_currentIndexChanged(int index) noexcept
Definition addcomponentdialog.cpp:436
QScopedPointer< CategoryTreeModel > mCategoryTreeModel
Definition addcomponentdialog.h:190
virtual bool event(QEvent *event) noexcept override
Definition addcomponentdialog.cpp:318
qint64 mUpdatePartInformationDownloadStart
Definition addcomponentdialog.h:194
void searchComponents(const QString &input, const std::optional< Uuid > &selectedDevice=std::nullopt, bool selectFirstDevice=false)
Definition addcomponentdialog.cpp:496
void setSelectedDevice(std::shared_ptr< const Device > dev)
Definition addcomponentdialog.cpp:848
QScopedPointer< QAction > mActionCopyMpn
Definition addcomponentdialog.h:210
SearchResult search(const QString &input)
Definition addcomponentdialog.cpp:590
void setSelectedCategory(const std::optional< Uuid > &categoryUuid)
Definition addcomponentdialog.cpp:710
void setNormOrder(const QStringList &order) noexcept
Definition addcomponentdialog.h:140
const WorkspaceSettings & mSettings
Definition addcomponentdialog.h:183
void treeComponents_itemDoubleClicked(QTreeWidgetItem *item, int column) noexcept
Definition addcomponentdialog.cpp:415
std::shared_ptr< const Part > mSelectedPart
Definition addcomponentdialog.h:204
void setSelectedPart(std::shared_ptr< const Part > part)
Definition addcomponentdialog.cpp:882
void searchEditTextChanged(const QString &text) noexcept
Definition addcomponentdialog.cpp:329
~AddComponentDialog() noexcept
Definition addcomponentdialog.cpp:256
void schedulePartsInformationUpdate() noexcept
Definition addcomponentdialog.cpp:908
QStringList mNormOrder
Definition addcomponentdialog.h:185
void setSelectedComponent(std::shared_ptr< const Component > cmp)
Definition addcomponentdialog.cpp:784
std::shared_ptr< const ComponentSymbolVariant > mSelectedSymbVar
Definition addcomponentdialog.h:201
bool mUpdatePartInformationOnExpand
Definition addcomponentdialog.h:195
QString mCurrentSearchTerm
Definition addcomponentdialog.h:196
bool mUpdatePartInformationScheduled
Definition addcomponentdialog.h:193
std::shared_ptr< const Component > getSelectedComponent() const noexcept
Definition addcomponentdialog.h:110
QScopedPointer< GraphicsScene > mComponentPreviewScene
Definition addcomponentdialog.h:187
std::shared_ptr< const Part > getSelectedPart() const noexcept
Definition addcomponentdialog.h:120
QStringList mLocaleOrder
Definition addcomponentdialog.h:184
std::unique_ptr< Package > mSelectedPackage
Definition addcomponentdialog.h:203
void setLocaleOrder(const QStringList &order) noexcept
Definition addcomponentdialog.cpp:269
QList< std::shared_ptr< Symbol > > mPreviewSymbols
Definition addcomponentdialog.h:205
virtual bool eventFilter(QObject *obj, QEvent *e) noexcept override
Definition addcomponentdialog.cpp:304
virtual void accept() noexcept override
Definition addcomponentdialog.cpp:998
The CategoryTreeModel class.
Definition categorytreemodel.h:48
The DefaultGraphicsLayerProvider class.
Definition defaultgraphicslayerprovider.h:46
The GraphicsScene class.
Definition graphicsscene.h:45
The SymbolGraphicsItem class.
Definition symbolgraphicsitem.h:56
Definition occmodel.cpp:76
Definition addcomponentdialog.h:87
bool deprecated
Definition addcomponentdialog.h:89
bool match
Definition addcomponentdialog.h:91
QString name
Definition addcomponentdialog.h:88
QHash< FilePath, SearchResultDevice > devices
Definition addcomponentdialog.h:90
Definition addcomponentdialog.h:77
bool deprecated
Definition addcomponentdialog.h:80
std::optional< Uuid > uuid
Definition addcomponentdialog.h:78
bool match
Definition addcomponentdialog.h:84
QString name
Definition addcomponentdialog.h:79
PartList parts
Definition addcomponentdialog.h:83
FilePath pkgFp
Definition addcomponentdialog.h:81
QString pkgName
Definition addcomponentdialog.h:82
Definition addcomponentdialog.h:94
int partsCount
Definition addcomponentdialog.h:97
QHash< FilePath, SearchResultComponent > components
Definition addcomponentdialog.h:95
int deviceCount
Definition addcomponentdialog.h:96