LibrePCB Developers Documentation
LibraryEditor Class Referencefinal

The LibraryEditor class. More...

#include <libraryeditor.h>

+ Inheritance diagram for LibraryEditor:
+ Collaboration diagram for LibraryEditor:

Public Member Functions

 LibraryEditor ()=delete
 
 LibraryEditor (const LibraryEditor &other)=delete
 
 LibraryEditor (workspace::Workspace &ws, const FilePath &libFp, bool readOnly)
 
 ~LibraryEditor () noexcept
 
GraphicsLayergetLayer (const QString &name) const noexcept override
 
QList< GraphicsLayer * > getAllLayers () const noexcept override
 
bool closeAndDestroy (bool askForSave) noexcept
 Close the library editor (this will destroy this object!) More...
 
LibraryEditoroperator= (const LibraryEditor &rhs)=delete
 
- Public Member Functions inherited from IF_GraphicsLayerProvider
virtual ~IF_GraphicsLayerProvider ()
 
GraphicsLayergetGrabAreaLayer (const QString outlineLayerName) const noexcept
 
QList< GraphicsLayer * > getSchematicGeometryElementLayers () const noexcept
 
QList< GraphicsLayer * > getBoardGeometryElementLayers () const noexcept
 
QList< GraphicsLayer * > getLayers (const QStringList &layerNames) const noexcept
 

Private Member Functions

void newElementTriggered () noexcept
 
void saveTriggered () noexcept
 
void showElementInFileExplorerTriggered () noexcept
 
void cutTriggered () noexcept
 
void copyTriggered () noexcept
 
void pasteTriggered () noexcept
 
void rotateCwTriggered () noexcept
 
void rotateCcwTriggered () noexcept
 
void mirrorTriggered () noexcept
 
void flipTriggered () noexcept
 
void removeTriggered () noexcept
 
void abortCommandTriggered () noexcept
 
void zoomInTriggered () noexcept
 
void zoomOutTriggered () noexcept
 
void zoomAllTriggered () noexcept
 
void editGridPropertiesTriggered () noexcept
 
void newComponentCategoryTriggered () noexcept
 
void newPackageCategoryTriggered () noexcept
 
void newSymbolTriggered () noexcept
 
void newPackageTriggered () noexcept
 
void newComponentTriggered () noexcept
 
void newDeviceTriggered () noexcept
 
void editComponentCategoryTriggered (const FilePath &fp) noexcept
 
void editPackageCategoryTriggered (const FilePath &fp) noexcept
 
void editSymbolTriggered (const FilePath &fp) noexcept
 
void editPackageTriggered (const FilePath &fp) noexcept
 
void editComponentTriggered (const FilePath &fp) noexcept
 
void editDeviceTriggered (const FilePath &fp) noexcept
 
void duplicateComponentCategoryTriggered (const FilePath &fp) noexcept
 
void duplicatePackageCategoryTriggered (const FilePath &fp) noexcept
 
void duplicateSymbolTriggered (const FilePath &fp) noexcept
 
void duplicatePackageTriggered (const FilePath &fp) noexcept
 
void duplicateComponentTriggered (const FilePath &fp) noexcept
 
void duplicateDeviceTriggered (const FilePath &fp) noexcept
 
void closeTabIfOpen (const FilePath &fp) noexcept
 
template<typename EditWidgetType >
void editLibraryElementTriggered (const FilePath &fp, bool isNewElement) noexcept
 
void currentTabChanged (int index) noexcept
 
void tabCloseRequested (int index) noexcept
 
bool closeTab (int index) noexcept
 
void setActiveEditorWidget (EditorWidgetBase *widget)
 
void newLibraryElement (NewElementWizardContext::ElementType type)
 
void duplicateLibraryElement (NewElementWizardContext::ElementType type, const FilePath &fp)
 
void editNewLibraryElement (NewElementWizardContext::ElementType type, const FilePath &fp)
 
void updateTabTitles () noexcept
 
void closeEvent (QCloseEvent *event) noexcept override
 
void addLayer (const QString &name, bool forceVisible=false) noexcept
 

Private Attributes

workspace::WorkspacemWorkspace
 
bool mIsOpenedReadOnly
 
QScopedPointer< Ui::LibraryEditor > mUi
 
QScopedPointer< UndoStackActionGroupmUndoStackActionGroup
 
QScopedPointer< ExclusiveActionGroupmToolsActionGroup
 
QList< GraphicsLayer * > mLayers
 
EditorWidgetBasemCurrentEditorWidget
 
LibrarymLibrary
 

Detailed Description

The LibraryEditor class.

Constructor & Destructor Documentation

◆ LibraryEditor() [1/3]

LibraryEditor ( )
delete

◆ LibraryEditor() [2/3]

LibraryEditor ( const LibraryEditor other)
delete

◆ LibraryEditor() [3/3]

LibraryEditor ( workspace::Workspace ws,
const FilePath libFp,
bool  readOnly 
)
+ Here is the call graph for this function:

◆ ~LibraryEditor()

~LibraryEditor ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getLayer()

GraphicsLayer* getLayer ( const QString &  name) const
inlineoverridevirtualnoexcept

Implements IF_GraphicsLayerProvider.

+ Here is the call graph for this function:

◆ getAllLayers()

QList<GraphicsLayer*> getAllLayers ( ) const
inlineoverridevirtualnoexcept

◆ closeAndDestroy()

bool closeAndDestroy ( bool  askForSave)
noexcept

Close the library editor (this will destroy this object!)

If there are unsaved changes to the library, this method will ask the user whether the changes should be saved or not. If the user clicks on "cancel" or the library could not be saved successfully, this method will return false. If there was no such error, this method will call QObject::deleteLater() which means that this object will be deleted in the Qt's event loop.

Warning
This method can be called both from within this class and from outside this class (for example from the librepcb::application::ControlPanel). But if you call this method from outside this class, you may have to delete the object yourself afterwards! In special cases, the deleteLater() mechanism could lead in fatal errors otherwise!
Parameters
askForSaveIf true and there are unsaved changes, this method shows a message box to ask whether the library should be saved or not. If false, the library will NOT be saved.
Returns
true on success (editor closed), false on failure (editor stays open)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

LibraryEditor& operator= ( const LibraryEditor rhs)
delete

◆ newElementTriggered()

void newElementTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTriggered()

void saveTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showElementInFileExplorerTriggered()

void showElementInFileExplorerTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutTriggered()

void cutTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyTriggered()

void copyTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteTriggered()

void pasteTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rotateCwTriggered()

void rotateCwTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rotateCcwTriggered()

void rotateCcwTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mirrorTriggered()

void mirrorTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flipTriggered()

void flipTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTriggered()

void removeTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ abortCommandTriggered()

void abortCommandTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zoomInTriggered()

void zoomInTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zoomOutTriggered()

void zoomOutTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zoomAllTriggered()

void zoomAllTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editGridPropertiesTriggered()

void editGridPropertiesTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newComponentCategoryTriggered()

void newComponentCategoryTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newPackageCategoryTriggered()

void newPackageCategoryTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newSymbolTriggered()

void newSymbolTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newPackageTriggered()

void newPackageTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newComponentTriggered()

void newComponentTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newDeviceTriggered()

void newDeviceTriggered ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editComponentCategoryTriggered()

void editComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editPackageCategoryTriggered()

void editPackageCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editSymbolTriggered()

void editSymbolTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editPackageTriggered()

void editPackageTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editComponentTriggered()

void editComponentTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editDeviceTriggered()

void editDeviceTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicateComponentCategoryTriggered()

void duplicateComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicatePackageCategoryTriggered()

void duplicatePackageCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateSymbolTriggered()

void duplicateSymbolTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicatePackageTriggered()

void duplicatePackageTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateComponentTriggered()

void duplicateComponentTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateDeviceTriggered()

void duplicateDeviceTriggered ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeTabIfOpen()

void closeTabIfOpen ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editLibraryElementTriggered()

void editLibraryElementTriggered ( const FilePath fp,
bool  isNewElement 
)
privatenoexcept
+ Here is the call graph for this function:

◆ currentTabChanged()

void currentTabChanged ( int  index)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tabCloseRequested()

void tabCloseRequested ( int  index)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeTab()

bool closeTab ( int  index)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActiveEditorWidget()

void setActiveEditorWidget ( EditorWidgetBase widget)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newLibraryElement()

void newLibraryElement ( NewElementWizardContext::ElementType  type)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateLibraryElement()

void duplicateLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editNewLibraryElement()

void editNewLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private
+ Here is the caller graph for this function:

◆ updateTabTitles()

void updateTabTitles ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeEvent()

void closeEvent ( QCloseEvent *  event)
overrideprivatenoexcept
+ Here is the call graph for this function:

◆ addLayer()

void addLayer ( const QString &  name,
bool  forceVisible = false 
)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mWorkspace

workspace::Workspace& mWorkspace
private

◆ mIsOpenedReadOnly

bool mIsOpenedReadOnly
private

◆ mUi

QScopedPointer<Ui::LibraryEditor> mUi
private

◆ mUndoStackActionGroup

QScopedPointer<UndoStackActionGroup> mUndoStackActionGroup
private

◆ mToolsActionGroup

QScopedPointer<ExclusiveActionGroup> mToolsActionGroup
private

◆ mLayers

QList<GraphicsLayer*> mLayers
private

◆ mCurrentEditorWidget

EditorWidgetBase* mCurrentEditorWidget
private

◆ mLibrary

Library* mLibrary
private

The documentation for this class was generated from the following files: