LibrePCB Developers Documentation
EditorWidgetBase Class Referenceabstract

The EditorWidgetBase class. More...

#include <editorwidgetbase.h>

+ Inheritance diagram for EditorWidgetBase:
+ Collaboration diagram for EditorWidgetBase:

Classes

struct  Context
 

Public Types

enum  Tool
 

Public Slots

virtual bool save () noexcept
 
virtual bool cut () noexcept
 
virtual bool copy () noexcept
 
virtual bool paste () noexcept
 
virtual bool rotateCw () noexcept
 
virtual bool rotateCcw () noexcept
 
virtual bool mirror () noexcept
 
virtual bool flip () noexcept
 
virtual bool remove () noexcept
 
virtual bool zoomIn () noexcept
 
virtual bool zoomOut () noexcept
 
virtual bool zoomAll () noexcept
 
virtual bool abortCommand () noexcept
 
virtual bool editGridProperties () noexcept
 

Signals

void dirtyChanged (bool dirty)
 
void elementEdited (const FilePath &fp)
 
void interfaceBrokenChanged (bool broken)
 
void errorsAvailableChanged (bool hasErrors)
 
void cursorPositionChanged (const Point &pos)
 

Public Member Functions

 EditorWidgetBase ()=delete
 
 EditorWidgetBase (const EditorWidgetBase &other)=delete
 
 EditorWidgetBase (const Context &context, const FilePath &fp, QWidget *parent=nullptr)
 
virtual ~EditorWidgetBase () noexcept
 
const FilePathgetFilePath () const noexcept
 
bool isDirty () const noexcept
 
virtual bool hasGraphicalEditor () const noexcept
 
virtual bool supportsFlip () const noexcept
 
virtual void setUndoStackActionGroup (UndoStackActionGroup *group) noexcept
 
virtual void setToolsActionGroup (ExclusiveActionGroup *group) noexcept
 
virtual void setCommandToolBar (QToolBar *toolbar) noexcept
 
virtual void setStatusBar (StatusBar *statusbar) noexcept
 
EditorWidgetBaseoperator= (const EditorWidgetBase &rhs)=delete
 

Protected Member Functions

void setupInterfaceBrokenWarningWidget (QWidget &widget) noexcept
 
void setupErrorNotificationWidget (QWidget &widget) noexcept
 
virtual bool isInterfaceBroken () const noexcept=0
 
virtual bool toolChangeRequested (Tool newTool) noexcept
 
virtual bool runChecks (LibraryElementCheckMessageList &msgs) const =0
 
void undoStackStateModified () noexcept
 
const QStringList & getLibLocaleOrder () const noexcept
 
QString getWorkspaceSettingsUserName () noexcept
 
- Protected Member Functions inherited from IF_LibraryElementCheckHandler
 IF_LibraryElementCheckHandler () noexcept
 
 IF_LibraryElementCheckHandler (const IF_LibraryElementCheckHandler &) noexcept
 
virtual ~IF_LibraryElementCheckHandler () noexcept
 

Protected Attributes

Context mContext
 
FilePath mFilePath
 
std::shared_ptr< TransactionalFileSystemmFileSystem
 
QScopedPointer< UndoStackmUndoStack
 
UndoStackActionGroupmUndoStackActionGroup
 
ExclusiveActionGroupmToolsActionGroup
 
StatusBarmStatusBar
 
QScopedPointer< ToolBarProxymCommandToolBarProxy
 
bool mIsInterfaceBroken
 

Private Slots

void updateCheckMessages () noexcept
 

Private Member Functions

void toolActionGroupChangeTriggered (const QVariant &newTool) noexcept
 
void undoStackCleanChanged (bool clean) noexcept
 
void scheduleLibraryElementChecks () noexcept
 
virtual bool processCheckMessage (std::shared_ptr< const LibraryElementCheckMessage > msg, bool applyFix)=0
 
bool libraryElementCheckFixAvailable (std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept override
 
void libraryElementCheckFixRequested (std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept override
 
void libraryElementCheckDescriptionRequested (std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept override
 

Static Private Member Functions

static bool askForRestoringBackup (const FilePath &dir)
 Ask the user whether to restore a backup of a library element. More...
 

Detailed Description

The EditorWidgetBase class.

Member Enumeration Documentation

◆ Tool

enum Tool
Enumerator
NONE 
SELECT 
DRAW_LINE 
DRAW_RECT 
DRAW_POLYGON 
DRAW_CIRCLE 
DRAW_TEXT 
ADD_NAMES 
ADD_VALUES 
ADD_PINS 
ADD_THT_PADS 
ADD_SMT_PADS 
ADD_HOLES 

Constructor & Destructor Documentation

◆ EditorWidgetBase() [1/3]

EditorWidgetBase ( )
delete

◆ EditorWidgetBase() [2/3]

EditorWidgetBase ( const EditorWidgetBase other)
delete

◆ EditorWidgetBase() [3/3]

EditorWidgetBase ( const Context context,
const FilePath fp,
QWidget *  parent = nullptr 
)
explicit
+ Here is the call graph for this function:

◆ ~EditorWidgetBase()

~EditorWidgetBase ( )
virtualnoexcept

Member Function Documentation

◆ getFilePath()

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

◆ isDirty()

bool isDirty ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ hasGraphicalEditor()

virtual bool hasGraphicalEditor ( ) const
inlinevirtualnoexcept

Reimplemented in PackageEditorWidget, and SymbolEditorWidget.

+ Here is the caller graph for this function:

◆ supportsFlip()

virtual bool supportsFlip ( ) const
inlinevirtualnoexcept

Reimplemented in PackageEditorWidget.

+ Here is the caller graph for this function:

◆ setUndoStackActionGroup()

void setUndoStackActionGroup ( UndoStackActionGroup group)
virtualnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setToolsActionGroup()

void setToolsActionGroup ( ExclusiveActionGroup group)
virtualnoexcept

Reimplemented in PackageEditorWidget, and SymbolEditorWidget.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCommandToolBar()

void setCommandToolBar ( QToolBar *  toolbar)
virtualnoexcept
+ Here is the caller graph for this function:

◆ setStatusBar()

void setStatusBar ( StatusBar statusbar)
virtualnoexcept

Reimplemented in PackageEditorWidget, and SymbolEditorWidget.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

EditorWidgetBase& operator= ( const EditorWidgetBase rhs)
delete

◆ save

bool save ( )
virtualslotnoexcept
+ Here is the caller graph for this function:

◆ cut

virtual bool cut ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ copy

virtual bool copy ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ paste

virtual bool paste ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ rotateCw

virtual bool rotateCw ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ rotateCcw

virtual bool rotateCcw ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ mirror

virtual bool mirror ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ flip

virtual bool flip ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ remove

virtual bool remove ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ zoomIn

virtual bool zoomIn ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ zoomOut

virtual bool zoomOut ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ zoomAll

virtual bool zoomAll ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ abortCommand

virtual bool abortCommand ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ editGridProperties

virtual bool editGridProperties ( )
inlinevirtualslotnoexcept
+ Here is the caller graph for this function:

◆ setupInterfaceBrokenWarningWidget()

void setupInterfaceBrokenWarningWidget ( QWidget &  widget)
protectednoexcept
+ Here is the caller graph for this function:

◆ setupErrorNotificationWidget()

void setupErrorNotificationWidget ( QWidget &  widget)
protectednoexcept
+ Here is the caller graph for this function:

◆ isInterfaceBroken()

virtual bool isInterfaceBroken ( ) const
protectedpure virtualnoexcept

Implemented in PackageEditorWidget, LibraryOverviewWidget, SymbolEditorWidget, DeviceEditorWidget, ComponentEditorWidget, ComponentCategoryEditorWidget, and PackageCategoryEditorWidget.

+ Here is the caller graph for this function:

◆ toolChangeRequested()

virtual bool toolChangeRequested ( Tool  newTool)
inlineprotectedvirtualnoexcept

Reimplemented in PackageEditorWidget, and SymbolEditorWidget.

+ Here is the caller graph for this function:

◆ runChecks()

virtual bool runChecks ( LibraryElementCheckMessageList msgs) const
protectedpure virtual

Implemented in PackageEditorWidget, LibraryOverviewWidget, SymbolEditorWidget, DeviceEditorWidget, ComponentEditorWidget, ComponentCategoryEditorWidget, and PackageCategoryEditorWidget.

+ Here is the caller graph for this function:

◆ undoStackStateModified()

void undoStackStateModified ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLibLocaleOrder()

const QStringList & getLibLocaleOrder ( ) const
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWorkspaceSettingsUserName()

QString getWorkspaceSettingsUserName ( )
protectednoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCheckMessages

void updateCheckMessages ( )
privateslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ askForRestoringBackup()

bool askForRestoringBackup ( const FilePath dir)
staticprivate

Ask the user whether to restore a backup of a library element.

Parameters
dirThe library element directory to be restored.
Return values
trueRestore backup.
falseDo not restore backup.
Exceptions
Exceptionto abort opening the library element.

◆ toolActionGroupChangeTriggered()

void toolActionGroupChangeTriggered ( const QVariant &  newTool)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ undoStackCleanChanged()

void undoStackCleanChanged ( bool  clean)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scheduleLibraryElementChecks()

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

◆ processCheckMessage()

virtual bool processCheckMessage ( std::shared_ptr< const LibraryElementCheckMessage msg,
bool  applyFix 
)
privatepure virtual

Implemented in PackageEditorWidget, LibraryOverviewWidget, SymbolEditorWidget, DeviceEditorWidget, ComponentEditorWidget, ComponentCategoryEditorWidget, and PackageCategoryEditorWidget.

+ Here is the caller graph for this function:

◆ libraryElementCheckFixAvailable()

bool libraryElementCheckFixAvailable ( std::shared_ptr< const LibraryElementCheckMessage msg)
overrideprivatevirtualnoexcept

Implements IF_LibraryElementCheckHandler.

+ Here is the call graph for this function:

◆ libraryElementCheckFixRequested()

void libraryElementCheckFixRequested ( std::shared_ptr< const LibraryElementCheckMessage msg)
overrideprivatevirtualnoexcept

Implements IF_LibraryElementCheckHandler.

+ Here is the call graph for this function:

◆ libraryElementCheckDescriptionRequested()

void libraryElementCheckDescriptionRequested ( std::shared_ptr< const LibraryElementCheckMessage msg)
overrideprivatevirtualnoexcept

◆ dirtyChanged

void dirtyChanged ( bool  dirty)
signal
+ Here is the caller graph for this function:

◆ elementEdited

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

◆ interfaceBrokenChanged

void interfaceBrokenChanged ( bool  broken)
signal
+ Here is the caller graph for this function:

◆ errorsAvailableChanged

void errorsAvailableChanged ( bool  hasErrors)
signal
+ Here is the caller graph for this function:

◆ cursorPositionChanged

void cursorPositionChanged ( const Point pos)
signal
+ Here is the caller graph for this function:

Member Data Documentation

◆ mContext

Context mContext
protected

◆ mFilePath

FilePath mFilePath
protected

◆ mFileSystem

std::shared_ptr<TransactionalFileSystem> mFileSystem
protected

◆ mUndoStack

QScopedPointer<UndoStack> mUndoStack
protected

◆ mUndoStackActionGroup

UndoStackActionGroup* mUndoStackActionGroup
protected

◆ mToolsActionGroup

ExclusiveActionGroup* mToolsActionGroup
protected

◆ mStatusBar

StatusBar* mStatusBar
protected

◆ mCommandToolBarProxy

QScopedPointer<ToolBarProxy> mCommandToolBarProxy
protected

◆ mIsInterfaceBroken

bool mIsInterfaceBroken
protected

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