LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 noexceptoverride
 
QList< GraphicsLayer * > getAllLayers () const noexceptoverride
 
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 cursorPositionChanged (const Point &pos) 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) noexceptoverride
 
void addLayer (const QString &name, bool forceVisible=false) noexcept
 

Private Attributes

workspace::WorkspacemWorkspace
 
bool mIsOpenedReadOnly
 
QScopedPointer< Ui::LibraryEditor > mUi
 
QScopedPointer
< UndoStackActionGroup
mUndoStackActionGroup
 
QScopedPointer
< ExclusiveActionGroup
mToolsActionGroup
 
QList< GraphicsLayer * > mLayers
 
EditorWidgetBasemCurrentEditorWidget
 
LibrarymLibrary
 

Detailed Description

The LibraryEditor class.

Constructor & Destructor Documentation

LibraryEditor ( )
delete
LibraryEditor ( const LibraryEditor other)
delete
LibraryEditor ( workspace::Workspace ws,
const FilePath libFp,
bool  readOnly 
)

+ Here is the call graph for this function:

~LibraryEditor ( )
noexcept

Member Function Documentation

GraphicsLayer* getLayer ( const QString &  name) const
inlineoverridevirtualnoexcept

Implements IF_GraphicsLayerProvider.

+ Here is the call graph for this function:

QList<GraphicsLayer*> getAllLayers ( ) const
inlineoverridevirtualnoexcept
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 #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)
LibraryEditor& operator= ( const LibraryEditor rhs)
delete
void newElementTriggered ( )
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void saveTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void showElementInFileExplorerTriggered ( )
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cutTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void copyTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void pasteTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void rotateCwTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void rotateCcwTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void mirrorTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void flipTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void removeTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void abortCommandTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void zoomInTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void zoomOutTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void zoomAllTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void editGridPropertiesTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void newComponentCategoryTriggered ( )
privatenoexcept
void newPackageCategoryTriggered ( )
privatenoexcept
void newSymbolTriggered ( )
privatenoexcept
void newPackageTriggered ( )
privatenoexcept
void newComponentTriggered ( )
privatenoexcept
void newDeviceTriggered ( )
privatenoexcept
void editComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
void editPackageCategoryTriggered ( const FilePath fp)
privatenoexcept
void editSymbolTriggered ( const FilePath fp)
privatenoexcept
void editPackageTriggered ( const FilePath fp)
privatenoexcept
void editComponentTriggered ( const FilePath fp)
privatenoexcept
void editDeviceTriggered ( const FilePath fp)
privatenoexcept
void duplicateComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
void duplicatePackageCategoryTriggered ( const FilePath fp)
privatenoexcept
void duplicateSymbolTriggered ( const FilePath fp)
privatenoexcept
void duplicatePackageTriggered ( const FilePath fp)
privatenoexcept
void duplicateComponentTriggered ( const FilePath fp)
privatenoexcept
void duplicateDeviceTriggered ( const FilePath fp)
privatenoexcept
void closeTabIfOpen ( const FilePath fp)
privatenoexcept

+ Here is the call graph for this function:

void editLibraryElementTriggered ( const FilePath fp,
bool  isNewElement 
)
privatenoexcept

+ Here is the call graph for this function:

void currentTabChanged ( int  index)
privatenoexcept

+ Here is the caller graph for this function:

void tabCloseRequested ( int  index)
privatenoexcept

+ Here is the caller graph for this function:

bool closeTab ( int  index)
privatenoexcept

+ Here is the call graph for this function:

void cursorPositionChanged ( const Point pos)
privatenoexcept
void setActiveEditorWidget ( EditorWidgetBase widget)
private

+ Here is the call graph for this function:

void newLibraryElement ( NewElementWizardContext::ElementType  type)
private

+ Here is the call graph for this function:

void duplicateLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private

+ Here is the call graph for this function:

void editNewLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private
void updateTabTitles ( )
privatenoexcept

+ Here is the call graph for this function:

void closeEvent ( QCloseEvent *  event)
overrideprivatenoexcept
void addLayer ( const QString &  name,
bool  forceVisible = false 
)
privatenoexcept

Member Data Documentation

workspace::Workspace& mWorkspace
private
bool mIsOpenedReadOnly
private
QScopedPointer<Ui::LibraryEditor> mUi
private
QScopedPointer<UndoStackActionGroup> mUndoStackActionGroup
private
QScopedPointer<ExclusiveActionGroup> mToolsActionGroup
private
QList<GraphicsLayer*> mLayers
private
EditorWidgetBase* mCurrentEditorWidget
private
Library* mLibrary
private

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