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, QSharedPointer< Library > lib)
 
 ~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 rotateCwTriggered () noexcept
 
void rotateCcwTriggered () noexcept
 
void removeTriggered () noexcept
 
void abortCommandTriggered () noexcept
 
void zoomInTriggered () noexcept
 
void zoomOutTriggered () noexcept
 
void zoomAllTriggered () noexcept
 
void editGridPropertiesTriggered () 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 closeTabIfOpen (const FilePath &fp) noexcept
 
template<typename ElementType , 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 updateTabTitles () noexcept
 
void closeEvent (QCloseEvent *event) noexceptoverride
 
void addLayer (const QString &name, bool forceVisible=false) noexcept
 

Private Attributes

workspace::WorkspacemWorkspace
 
QSharedPointer< LibrarymLibrary
 
QScopedPointer< Ui::LibraryEditor > mUi
 
QScopedPointer
< UndoStackActionGroup
mUndoStackActionGroup
 
QScopedPointer
< ExclusiveActionGroup
mToolsActionGroup
 
QList< GraphicsLayer * > mLayers
 
EditorWidgetBasemCurrentEditorWidget
 
DirectoryLock mLock
 

Detailed Description

The LibraryEditor class.

Author
ubruhin
Date
2015-06-28

Constructor & Destructor Documentation

LibraryEditor ( )
delete
LibraryEditor ( const LibraryEditor other)
delete
LibraryEditor ( workspace::Workspace ws,
QSharedPointer< Library lib 
)

+ 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 call graph for this function:

+ 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 rotateCwTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

void rotateCcwTriggered ( )
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 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 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 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
QSharedPointer<Library> mLibrary
private
QScopedPointer<Ui::LibraryEditor> mUi
private
QScopedPointer<UndoStackActionGroup> mUndoStackActionGroup
private
QScopedPointer<ExclusiveActionGroup> mToolsActionGroup
private
QList<GraphicsLayer*> mLayers
private
EditorWidgetBase* mCurrentEditorWidget
private
DirectoryLock mLock
private

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