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:127
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:233
EditorWidgetBase * mCurrentEditorWidget
Definition libraryeditor.h:177
void setAvailableFeatures(const QSet< EditorWidgetBase::Feature > &features) noexcept
Definition libraryeditor.cpp:998
EditorWidgetBase::Context createContext(bool isNewElement) noexcept
Definition libraryeditor.cpp:991
QScopedPointer< QAction > mActionZoomFit
Definition libraryeditor.h:209
void duplicatePackageTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:364
QScopedPointer< QAction > mActionExportImage
Definition libraryeditor.h:197
QScopedPointer< QAction > mActionToolSpecialPadEdgeConnector
Definition libraryeditor.h:250
void duplicateLibraryElement(NewElementWizardContext::ElementType type, const FilePath &fp)
Definition libraryeditor.cpp:1082
QScopedPointer< QAction > mActionSave
Definition libraryeditor.h:186
QScopedPointer< UndoStackActionGroup > mUndoStackActionGroup
Definition libraryeditor.h:260
QScopedPointer< QAction > mActionCut
Definition libraryeditor.h:215
void closeTabIfOpen(const FilePath &fp) noexcept
Definition libraryeditor.cpp:281
void newDeviceTriggered() noexcept
Definition libraryeditor.cpp:319
QScopedPointer< QAction > mActionMoveAlign
Definition libraryeditor.h:228
~LibraryEditor() noexcept
Definition libraryeditor.cpp:252
QScopedPointer< QAction > mActionZoomIn
Definition libraryeditor.h:210
QScopedPointer< QAction > mActionCopy
Definition libraryeditor.h:216
QScopedPointer< QAction > mActionToolRect
Definition libraryeditor.h:238
QScopedPointer< QAction > mActionKeyboardShortcutsReference
Definition libraryeditor.h:184
void addLayer(const QString &name) noexcept
Definition libraryeditor.cpp:1192
QScopedPointer< QAction > mActionMirrorHorizontal
Definition libraryeditor.h:224
void newLibraryElement(NewElementWizardContext::ElementType type)
Definition libraryeditor.cpp:1071
QScopedPointer< QAction > mActionQuit
Definition libraryeditor.h:191
QScopedPointer< ExclusiveActionGroup > mToolsActionGroup
Definition libraryeditor.h:261
QScopedPointer< QAction > mActionToolHole
Definition libraryeditor.h:255
QScopedPointer< QAction > mActionMoveDown
Definition libraryeditor.h:221
QScopedPointer< QAction > mActionGridIncrease
Definition libraryeditor.h:206
QScopedPointer< QAction > mActionHelperTools
Definition libraryeditor.h:232
void duplicateComponentTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:368
QScopedPointer< QAction > mActionToolValue
Definition libraryeditor.h:244
QScopedPointer< QAction > mActionCloseTab
Definition libraryeditor.h:188
QScopedPointer< QAction > mActionCloseAllTabs
Definition libraryeditor.h:189
QScopedPointer< QAction > mActionGridProperties
Definition libraryeditor.h:205
void setActiveEditorWidget(EditorWidgetBase *widget)
Definition libraryeditor.cpp:1046
void newPackageCategoryTriggered() noexcept
Definition libraryeditor.cpp:303
QScopedPointer< QAction > mActionReNumberPads
Definition libraryeditor.h:257
bool closeAllTabs(bool withNonClosable, bool askForSave) noexcept
Definition libraryeditor.cpp:1170
QList< std::shared_ptr< GraphicsLayer > > mLayers
Definition libraryeditor.h:176
QScopedPointer< QAction > mActionToolSpecialPadTest
Definition libraryeditor.h:251
QScopedPointer< QAction > mActionAbort
Definition libraryeditor.h:235
QScopedPointer< QToolBar > mToolBarEdit
Definition libraryeditor.h:265
QScopedPointer< QAction > mActionRotateCcw
Definition libraryeditor.h:222
void createMenus() noexcept
Definition libraryeditor.cpp:881
QScopedPointer< QAction > mActionToolArc
Definition libraryeditor.h:241
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:1093
bool mIsOpenedReadOnly
Definition libraryeditor.h:173
bool closeTab(int index) noexcept
Definition libraryeditor.cpp:424
QScopedPointer< QAction > mActionSelectAll
Definition libraryeditor.h:204
std::shared_ptr< GraphicsLayer > getLayer(const QString &name) const noexcept override
Definition libraryeditor.h:79
QScopedPointer< QToolBar > mToolBarTools
Definition libraryeditor.h:269
QScopedPointer< QAction > mActionMoveUp
Definition libraryeditor.h:220
QScopedPointer< QToolBar > mToolBarFile
Definition libraryeditor.h:264
void updateTabTitles() noexcept
Definition libraryeditor.cpp:1119
QScopedPointer< QAction > mActionPreviousPage
Definition libraryeditor.h:202
QScopedPointer< QAction > mActionImportDxf
Definition libraryeditor.h:194
void createToolBars() noexcept
Definition libraryeditor.cpp:772
QScopedPointer< QAction > mActionCloseWindow
Definition libraryeditor.h:190
void duplicateSymbolTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:360
void currentTabChanged(int index) noexcept
Definition libraryeditor.cpp:409
QScopedPointer< QAction > mActionToolSelect
Definition libraryeditor.h:236
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:253
void editDeviceTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:344
QScopedPointer< QAction > mActionUndo
Definition libraryeditor.h:213
QScopedPointer< QAction > mActionRotateCw
Definition libraryeditor.h:223
QScopedPointer< SearchToolBar > mToolBarSearch
Definition libraryeditor.h:267
QScopedPointer< QAction > mActionToolLine
Definition libraryeditor.h:237
QScopedPointer< QAction > mActionFlipVertical
Definition libraryeditor.h:227
QScopedPointer< QAction > mActionMoveLeft
Definition libraryeditor.h:218
QScopedPointer< QToolBar > mToolBarCommand
Definition libraryeditor.h:268
QScopedPointer< QAction > mActionProperties
Definition libraryeditor.h:230
bool closeAndDestroy(bool askForSave) noexcept
Close the library editor (this will destroy this object!)
Definition libraryeditor.cpp:262
QScopedPointer< StandardEditorCommandHandler > mStandardCommandHandler
Definition libraryeditor.h:175
QScopedPointer< QAction > mActionSaveAll
Definition libraryeditor.h:187
void editComponentCategoryTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:323
QScopedPointer< QAction > mActionToolCircle
Definition libraryeditor.h:240
QScopedPointer< QAction > mActionExportPdf
Definition libraryeditor.h:198
void tabCountChanged() noexcept
Definition libraryeditor.cpp:1145
QScopedPointer< QAction > mActionToggleBgImage
Definition libraryeditor.h:208
QScopedPointer< QToolBar > mToolBarView
Definition libraryeditor.h:266
void editComponentTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:340
Library * mLibrary
Definition libraryeditor.h:178
QScopedPointer< QAction > mActionToolSmtPadStandard
Definition libraryeditor.h:246
void newComponentCategoryTriggered() noexcept
Definition libraryeditor.cpp:299
QScopedPointer< QAction > mActionToolSpecialPadThermal
Definition libraryeditor.h:248
QScopedPointer< QAction > mActionToolName
Definition libraryeditor.h:243
QScopedPointer< QAction > mActionToolPolygon
Definition libraryeditor.h:239
void newSymbolTriggered() noexcept
Definition libraryeditor.cpp:307
void editPackageCategoryTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:328
QScopedPointer< QAction > mActionImportKiCadLibrary
Definition libraryeditor.h:196
Workspace & mWorkspace
Definition libraryeditor.h:172
QScopedPointer< QAction > mActionGenerateCourtyard
Definition libraryeditor.h:234
QScopedPointer< QAction > mActionOnlineDocumentation
Definition libraryeditor.h:183
QScopedPointer< QAction > mActionFileManager
Definition libraryeditor.h:192
void newComponentTriggered() noexcept
Definition libraryeditor.cpp:315
QScopedPointer< QAction > mActionFind
Definition libraryeditor.h:203
void editSymbolTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:332
QScopedPointer< Ui::LibraryEditor > mUi
Definition libraryeditor.h:174
QScopedPointer< QAction > mActionMoveRight
Definition libraryeditor.h:219
void keyPressEvent(QKeyEvent *event) noexcept override
Definition libraryeditor.cpp:1149
QScopedPointer< QAction > mActionImportEagleLibrary
Definition libraryeditor.h:195
void duplicateComponentCategoryTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:348
void newPackageTriggered() noexcept
Definition libraryeditor.cpp:311
void closeEvent(QCloseEvent *event) noexcept override
Definition libraryeditor.cpp:1162
void duplicateDeviceTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:372
LibraryEditor(const LibraryEditor &other)=delete
QScopedPointer< QAction > mActionPaste
Definition libraryeditor.h:217
void duplicatePackageCategoryTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:354
void createActions() noexcept
Definition libraryeditor.cpp:476
QScopedPointer< QAction > mActionPrint
Definition libraryeditor.h:199
QScopedPointer< QAction > mActionGridDecrease
Definition libraryeditor.h:207
void editPackageTriggered(const FilePath &fp) noexcept
Definition libraryeditor.cpp:336
QScopedPointer< QAction > mActionNextPage
Definition libraryeditor.h:201
QScopedPointer< QAction > mActionRedo
Definition libraryeditor.h:214
LibraryEditor & operator=(const LibraryEditor &rhs)=delete
QScopedPointer< QAction > mActionToolThtPad
Definition libraryeditor.h:247
void tabCloseRequested(int index) noexcept
Definition libraryeditor.cpp:414
QScopedPointer< QAction > mActionAboutQt
Definition libraryeditor.h:182
QScopedPointer< QAction > mActionMirrorVertical
Definition libraryeditor.h:225
QScopedPointer< QAction > mActionToolMeasure
Definition libraryeditor.h:256
QScopedPointer< QAction > mActionRemove
Definition libraryeditor.h:231
QScopedPointer< QAction > mActionFlipHorizontal
Definition libraryeditor.h:226
QScopedPointer< QAction > mActionToolSpecialPadLocalFiducial
Definition libraryeditor.h:252
QScopedPointer< QAction > mActionToolSpecialPadBga
Definition libraryeditor.h:249
QScopedPointer< QAction > mActionToolZone
Definition libraryeditor.h:254
QScopedPointer< QAction > mActionZoomOut
Definition libraryeditor.h:211
QScopedPointer< QAction > mActionToggle3D
Definition libraryeditor.h:212
void editLibraryElementTriggered(const FilePath &fp, bool isNewElement) noexcept
Definition libraryeditor.cpp:377
QScopedPointer< QAction > mActionToolText
Definition libraryeditor.h:242
QScopedPointer< QAction > mActionToolPin
Definition libraryeditor.h:245
QScopedPointer< QAction > mActionNewElement
Definition libraryeditor.h:200
QScopedPointer< QAction > mActionSnapToGrid
Definition libraryeditor.h:229
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:76