LibrePCB Developers Documentation
Loading...
Searching...
No Matches
LibraryEditor Class Referencefinal

The LibraryEditor class. More...

#include <libraryeditor.h>

Inherits QObject.

+ Collaboration diagram for LibraryEditor:

Signals

void uiIndexChanged ()
 
void manualModificationsMade ()
 
void aboutToBeDestroyed ()
 

Public Member Functions

 LibraryEditor ()=delete
 
 LibraryEditor (const LibraryEditor &other)=delete
 
 LibraryEditor (GuiApplication &app, std::unique_ptr< Library > lib, int uiIndex, QObject *parent=nullptr) noexcept
 
 ~LibraryEditor () noexcept
 
GuiApplicationgetApp () noexcept
 
WorkspacegetWorkspace () noexcept
 
FilePath getFilePath () const noexcept
 
LibrarygetLibrary () noexcept
 
UndoStackgetUndoStack () noexcept
 
bool isWritable () const noexcept
 
int getUiIndex () const noexcept
 
void setUiIndex (int index) noexcept
 
ui::LibraryData getUiData () const noexcept
 
void setUiData (const ui::LibraryData &data) noexcept
 
bool requestClose () noexcept
 Request to close the library.
 
bool hasUnsavedChanges () const noexcept
 
void setManualModificationsMade () noexcept
 Set the flag that manual modifications (no undo stack) are made.
 
bool save () noexcept
 Save the library to the harddisc.
 
void registerTab (LibraryEditorTab &tab) noexcept
 
void unregisterTab (LibraryEditorTab &tab) noexcept
 
void forceClosingTabs (const QSet< FilePath > &fp) noexcept
 
void openLegacyPackageEditor (const FilePath &fp) noexcept
 
void openLegacyComponentEditor (const FilePath &fp) noexcept
 
void openLegacyDeviceEditor (const FilePath &fp) noexcept
 
void duplicateInLegacyPackageEditor (const FilePath &fp) noexcept
 
void duplicateInLegacyComponentEditor (const FilePath &fp) noexcept
 
void duplicateInLegacyDeviceEditor (const FilePath &fp) noexcept
 
LibraryEditoroperator= (const LibraryEditor &rhs)=delete
 

Public Attributes

Signal< LibraryEditoronUiDataChanged
 

Private Attributes

GuiApplicationmApp
 
WorkspacemWorkspace
 
std::unique_ptr< LibrarymLibrary
 
int mUiIndex
 
std::unique_ptr< UndoStackmUndoStack
 
bool mManualModificationsMade
 Modifications bypassing the undo stack.
 
QVector< QPointer< LibraryEditorTab > > mRegisteredTabs
 
std::unique_ptr< LibraryEditorLegacymLegacyEditor
 

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 ( GuiApplication app,
std::unique_ptr< Library lib,
int  uiIndex,
QObject *  parent = nullptr 
)
noexcept
+ Here is the call graph for this function:

◆ ~LibraryEditor()

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

Member Function Documentation

◆ getApp()

GuiApplication & getApp ( )
inlinenoexcept

◆ getWorkspace()

Workspace & getWorkspace ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getFilePath()

FilePath getFilePath ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getLibrary()

Library & getLibrary ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getUndoStack()

UndoStack & getUndoStack ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ isWritable()

bool isWritable ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getUiIndex()

int getUiIndex ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setUiIndex()

void setUiIndex ( int  index)
noexcept

◆ getUiData()

ui::LibraryData getUiData ( ) const
noexcept
+ Here is the call graph for this function:

◆ setUiData()

void setUiData ( const ui::LibraryData &  data)
noexcept

◆ requestClose()

bool requestClose ( )
noexcept

Request to close the library.

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 were no unsaved changes or they were successfully saved, the method returns true.

Return values
trueLibrary is safe to be closed.
falseLibrary still has unsaved changes.
+ Here is the call graph for this function:

◆ hasUnsavedChanges()

bool hasUnsavedChanges ( ) const
noexcept
+ Here is the caller graph for this function:

◆ setManualModificationsMade()

void setManualModificationsMade ( )
noexcept

Set the flag that manual modifications (no undo stack) are made.

+ Here is the call graph for this function:

◆ save()

bool save ( )
noexcept

Save the library to the harddisc.

Returns
true on success, false on failure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerTab()

void registerTab ( LibraryEditorTab tab)
noexcept

◆ unregisterTab()

void unregisterTab ( LibraryEditorTab tab)
noexcept
+ Here is the caller graph for this function:

◆ forceClosingTabs()

void forceClosingTabs ( const QSet< FilePath > &  fp)
noexcept

◆ openLegacyPackageEditor()

void openLegacyPackageEditor ( const FilePath fp)
noexcept

◆ openLegacyComponentEditor()

void openLegacyComponentEditor ( const FilePath fp)
noexcept

◆ openLegacyDeviceEditor()

void openLegacyDeviceEditor ( const FilePath fp)
noexcept

◆ duplicateInLegacyPackageEditor()

void duplicateInLegacyPackageEditor ( const FilePath fp)
noexcept

◆ duplicateInLegacyComponentEditor()

void duplicateInLegacyComponentEditor ( const FilePath fp)
noexcept

◆ duplicateInLegacyDeviceEditor()

void duplicateInLegacyDeviceEditor ( const FilePath fp)
noexcept

◆ operator=()

LibraryEditor & operator= ( const LibraryEditor rhs)
delete

◆ uiIndexChanged

void uiIndexChanged ( )
signal
+ Here is the caller graph for this function:

◆ manualModificationsMade

void manualModificationsMade ( )
signal
+ Here is the caller graph for this function:

◆ aboutToBeDestroyed

void aboutToBeDestroyed ( )
signal
+ Here is the caller graph for this function:

Member Data Documentation

◆ onUiDataChanged

Signal<LibraryEditor> onUiDataChanged

◆ mApp

GuiApplication& mApp
private

◆ mWorkspace

Workspace& mWorkspace
private

◆ mLibrary

std::unique_ptr<Library> mLibrary
private

◆ mUiIndex

int mUiIndex
private

◆ mUndoStack

std::unique_ptr<UndoStack> mUndoStack
private

◆ mManualModificationsMade

bool mManualModificationsMade
private

Modifications bypassing the undo stack.

◆ mRegisteredTabs

QVector<QPointer<LibraryEditorTab> > mRegisteredTabs
private

◆ mLegacyEditor

std::unique_ptr<LibraryEditorLegacy> mLegacyEditor
private

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