20#ifndef LIBREPCB_EDITOR_LIBRARYEDITOR_H
21#define LIBREPCB_EDITOR_LIBRARYEDITOR_H
26#include "../graphics/graphicslayer.h"
43class TransactionalFileSystem;
48class ExclusiveActionGroup;
49class LibraryOverviewWidget;
51class StandardEditorCommandHandler;
52class UndoStackActionGroup;
80 const QString& name) const noexcept
override {
81 foreach (
const std::shared_ptr<GraphicsLayer>& layer,
mLayers) {
82 if (layer->getName() == name) {
92 QList<std::shared_ptr<GraphicsLayer>>
getAllLayers() const noexcept
override {
144 template <typename EditWidgetType>
146 bool isNewElement) noexcept;
167 void closeEvent(QCloseEvent* event) noexcept override;
168 bool closeAllTabs(
bool withNonClosable,
bool askForSave) noexcept;
169 void addLayer(const QString& name) noexcept;
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The Library class represents a library directory.
Definition: library.h:46
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The ExclusiveActionGroup class groups multiple QAction's together.
Definition: exclusiveactiongroup.h:54
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:53
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
The LibraryEditor class.
Definition: libraryeditor.h:66
QScopedPointer< QAction > mActionGenerateOutline
Definition: libraryeditor.h:232
EditorWidgetBase * mCurrentEditorWidget
Definition: libraryeditor.h:177
void setAvailableFeatures(const QSet< EditorWidgetBase::Feature > &features) noexcept
Definition: libraryeditor.cpp:991
EditorWidgetBase::Context createContext(bool isNewElement) noexcept
Definition: libraryeditor.cpp:984
QScopedPointer< QAction > mActionZoomFit
Definition: libraryeditor.h:208
void duplicatePackageTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:365
QScopedPointer< QAction > mActionExportImage
Definition: libraryeditor.h:196
QScopedPointer< QAction > mActionToolSpecialPadEdgeConnector
Definition: libraryeditor.h:249
void duplicateLibraryElement(NewElementWizardContext::ElementType type, const FilePath &fp)
Definition: libraryeditor.cpp:1075
QScopedPointer< QAction > mActionSave
Definition: libraryeditor.h:186
QScopedPointer< UndoStackActionGroup > mUndoStackActionGroup
Definition: libraryeditor.h:259
QScopedPointer< QAction > mActionCut
Definition: libraryeditor.h:214
void closeTabIfOpen(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:282
void newDeviceTriggered() noexcept
Definition: libraryeditor.cpp:320
QScopedPointer< QAction > mActionMoveAlign
Definition: libraryeditor.h:227
~LibraryEditor() noexcept
Definition: libraryeditor.cpp:253
QScopedPointer< QAction > mActionZoomIn
Definition: libraryeditor.h:209
QScopedPointer< QAction > mActionCopy
Definition: libraryeditor.h:215
QScopedPointer< QAction > mActionToolRect
Definition: libraryeditor.h:237
QScopedPointer< QAction > mActionKeyboardShortcutsReference
Definition: libraryeditor.h:184
void addLayer(const QString &name) noexcept
Definition: libraryeditor.cpp:1185
QScopedPointer< QAction > mActionMirrorHorizontal
Definition: libraryeditor.h:223
void newLibraryElement(NewElementWizardContext::ElementType type)
Definition: libraryeditor.cpp:1064
QScopedPointer< QAction > mActionQuit
Definition: libraryeditor.h:191
QScopedPointer< ExclusiveActionGroup > mToolsActionGroup
Definition: libraryeditor.h:260
QScopedPointer< QAction > mActionToolHole
Definition: libraryeditor.h:254
QScopedPointer< QAction > mActionMoveDown
Definition: libraryeditor.h:220
QScopedPointer< QAction > mActionGridIncrease
Definition: libraryeditor.h:205
QScopedPointer< QAction > mActionHelperTools
Definition: libraryeditor.h:231
void duplicateComponentTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:369
QScopedPointer< QAction > mActionToolValue
Definition: libraryeditor.h:243
QScopedPointer< QAction > mActionCloseTab
Definition: libraryeditor.h:188
QScopedPointer< QAction > mActionCloseAllTabs
Definition: libraryeditor.h:189
QScopedPointer< QAction > mActionGridProperties
Definition: libraryeditor.h:204
void setActiveEditorWidget(EditorWidgetBase *widget)
Definition: libraryeditor.cpp:1039
void newPackageCategoryTriggered() noexcept
Definition: libraryeditor.cpp:304
QScopedPointer< QAction > mActionReNumberPads
Definition: libraryeditor.h:256
bool closeAllTabs(bool withNonClosable, bool askForSave) noexcept
Definition: libraryeditor.cpp:1163
QList< std::shared_ptr< GraphicsLayer > > mLayers
Definition: libraryeditor.h:176
QScopedPointer< QAction > mActionToolSpecialPadTest
Definition: libraryeditor.h:250
QScopedPointer< QAction > mActionAbort
Definition: libraryeditor.h:234
QScopedPointer< QToolBar > mToolBarEdit
Definition: libraryeditor.h:264
QScopedPointer< QAction > mActionRotateCcw
Definition: libraryeditor.h:221
void createMenus() noexcept
Definition: libraryeditor.cpp:875
QScopedPointer< QAction > mActionToolArc
Definition: libraryeditor.h:240
QScopedPointer< QAction > mActionRescanLibraries
Definition: libraryeditor.h:193
QScopedPointer< QAction > mActionAboutLibrePcb
Definition: libraryeditor.h:181
void editNewLibraryElement(NewElementWizardContext::ElementType type, const FilePath &fp)
Definition: libraryeditor.cpp:1086
bool mIsOpenedReadOnly
Definition: libraryeditor.h:173
bool closeTab(int index) noexcept
Definition: libraryeditor.cpp:425
QScopedPointer< QAction > mActionSelectAll
Definition: libraryeditor.h:203
std::shared_ptr< GraphicsLayer > getLayer(const QString &name) const noexcept override
Definition: libraryeditor.h:79
QScopedPointer< QToolBar > mToolBarTools
Definition: libraryeditor.h:268
QScopedPointer< QAction > mActionMoveUp
Definition: libraryeditor.h:219
QScopedPointer< QToolBar > mToolBarFile
Definition: libraryeditor.h:263
void updateTabTitles() noexcept
Definition: libraryeditor.cpp:1112
QScopedPointer< QAction > mActionPreviousPage
Definition: libraryeditor.h:201
QScopedPointer< QAction > mActionImportDxf
Definition: libraryeditor.h:194
void createToolBars() noexcept
Definition: libraryeditor.cpp:766
QScopedPointer< QAction > mActionCloseWindow
Definition: libraryeditor.h:190
void duplicateSymbolTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:361
void currentTabChanged(int index) noexcept
Definition: libraryeditor.cpp:410
QScopedPointer< QAction > mActionToolSelect
Definition: libraryeditor.h:235
QList< std::shared_ptr< GraphicsLayer > > getAllLayers() const noexcept override
Definition: libraryeditor.h:92
QScopedPointer< QAction > mActionWebsite
Definition: libraryeditor.h:185
QScopedPointer< QAction > mActionToolSpecialPadGlobalFiducial
Definition: libraryeditor.h:252
void editDeviceTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:345
QScopedPointer< QAction > mActionUndo
Definition: libraryeditor.h:212
QScopedPointer< QAction > mActionRotateCw
Definition: libraryeditor.h:222
QScopedPointer< SearchToolBar > mToolBarSearch
Definition: libraryeditor.h:266
QScopedPointer< QAction > mActionToolLine
Definition: libraryeditor.h:236
QScopedPointer< QAction > mActionFlipVertical
Definition: libraryeditor.h:226
QScopedPointer< QAction > mActionMoveLeft
Definition: libraryeditor.h:217
QScopedPointer< QToolBar > mToolBarCommand
Definition: libraryeditor.h:267
QScopedPointer< QAction > mActionProperties
Definition: libraryeditor.h:229
bool closeAndDestroy(bool askForSave) noexcept
Close the library editor (this will destroy this object!)
Definition: libraryeditor.cpp:263
QScopedPointer< StandardEditorCommandHandler > mStandardCommandHandler
Definition: libraryeditor.h:175
QScopedPointer< QAction > mActionSaveAll
Definition: libraryeditor.h:187
void editComponentCategoryTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:324
QScopedPointer< QAction > mActionToolCircle
Definition: libraryeditor.h:239
QScopedPointer< QAction > mActionExportPdf
Definition: libraryeditor.h:197
void tabCountChanged() noexcept
Definition: libraryeditor.cpp:1138
QScopedPointer< QAction > mActionToggleBgImage
Definition: libraryeditor.h:207
QScopedPointer< QToolBar > mToolBarView
Definition: libraryeditor.h:265
void editComponentTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:341
Library * mLibrary
Definition: libraryeditor.h:178
QScopedPointer< QAction > mActionToolSmtPadStandard
Definition: libraryeditor.h:245
void newComponentCategoryTriggered() noexcept
Definition: libraryeditor.cpp:300
QScopedPointer< QAction > mActionToolSpecialPadThermal
Definition: libraryeditor.h:247
QScopedPointer< QAction > mActionToolName
Definition: libraryeditor.h:242
QScopedPointer< QAction > mActionToolPolygon
Definition: libraryeditor.h:238
void newSymbolTriggered() noexcept
Definition: libraryeditor.cpp:308
void editPackageCategoryTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:329
Workspace & mWorkspace
Definition: libraryeditor.h:172
QScopedPointer< QAction > mActionGenerateCourtyard
Definition: libraryeditor.h:233
QScopedPointer< QAction > mActionOnlineDocumentation
Definition: libraryeditor.h:183
QScopedPointer< QAction > mActionFileManager
Definition: libraryeditor.h:192
void newComponentTriggered() noexcept
Definition: libraryeditor.cpp:316
QScopedPointer< QAction > mActionFind
Definition: libraryeditor.h:202
void editSymbolTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:333
QScopedPointer< Ui::LibraryEditor > mUi
Definition: libraryeditor.h:174
QScopedPointer< QAction > mActionMoveRight
Definition: libraryeditor.h:218
void keyPressEvent(QKeyEvent *event) noexcept override
Definition: libraryeditor.cpp:1142
QScopedPointer< QAction > mActionImportEagleLibrary
Definition: libraryeditor.h:195
void duplicateComponentCategoryTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:349
void newPackageTriggered() noexcept
Definition: libraryeditor.cpp:312
void closeEvent(QCloseEvent *event) noexcept override
Definition: libraryeditor.cpp:1155
void duplicateDeviceTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:373
LibraryEditor(const LibraryEditor &other)=delete
QScopedPointer< QAction > mActionPaste
Definition: libraryeditor.h:216
void duplicatePackageCategoryTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:355
void createActions() noexcept
Definition: libraryeditor.cpp:477
QScopedPointer< QAction > mActionPrint
Definition: libraryeditor.h:198
QScopedPointer< QAction > mActionGridDecrease
Definition: libraryeditor.h:206
void editPackageTriggered(const FilePath &fp) noexcept
Definition: libraryeditor.cpp:337
QScopedPointer< QAction > mActionNextPage
Definition: libraryeditor.h:200
QScopedPointer< QAction > mActionRedo
Definition: libraryeditor.h:213
LibraryEditor & operator=(const LibraryEditor &rhs)=delete
QScopedPointer< QAction > mActionToolThtPad
Definition: libraryeditor.h:246
void tabCloseRequested(int index) noexcept
Definition: libraryeditor.cpp:415
QScopedPointer< QAction > mActionAboutQt
Definition: libraryeditor.h:182
QScopedPointer< QAction > mActionMirrorVertical
Definition: libraryeditor.h:224
QScopedPointer< QAction > mActionToolMeasure
Definition: libraryeditor.h:255
QScopedPointer< QAction > mActionRemove
Definition: libraryeditor.h:230
QScopedPointer< QAction > mActionFlipHorizontal
Definition: libraryeditor.h:225
QScopedPointer< QAction > mActionToolSpecialPadLocalFiducial
Definition: libraryeditor.h:251
QScopedPointer< QAction > mActionToolSpecialPadBga
Definition: libraryeditor.h:248
QScopedPointer< QAction > mActionToolZone
Definition: libraryeditor.h:253
QScopedPointer< QAction > mActionZoomOut
Definition: libraryeditor.h:210
QScopedPointer< QAction > mActionToggle3D
Definition: libraryeditor.h:211
void editLibraryElementTriggered(const FilePath &fp, bool isNewElement) noexcept
Definition: libraryeditor.cpp:378
QScopedPointer< QAction > mActionToolText
Definition: libraryeditor.h:241
QScopedPointer< QAction > mActionToolPin
Definition: libraryeditor.h:244
QScopedPointer< QAction > mActionNewElement
Definition: libraryeditor.h:199
QScopedPointer< QAction > mActionSnapToGrid
Definition: libraryeditor.h:228
The NewElementWizardContext class.
Definition: newelementwizardcontext.h:58
Helper to handle some of the librepcb::editor::EditorCommand actions.
Definition: standardeditorcommandhandler.h:48
The UndoStackActionGroup class groups an undo-QAction and redo-QAction together and optionally connec...
Definition: undostackactiongroup.h:45
Definition: occmodel.cpp:77