LibrePCB Developers Documentation
SymbolEditorFsm Class Referencefinal

The SymbolEditorFsm class is the finit state machine (FSM) of the symbol editor. More...

#include <symboleditorfsm.h>

Inherits QObject.

+ Collaboration diagram for SymbolEditorFsm:

Classes

struct  Context
 

Signals

void toolChanged (EditorWidgetBase::Tool newTool)
 
void availableFeaturesChanged ()
 
void statusBarMessageChanged (const QString &message, int timeoutMs=-1)
 

Public Member Functions

 SymbolEditorFsm ()=delete
 
 SymbolEditorFsm (const SymbolEditorFsm &other)=delete
 
 SymbolEditorFsm (const Context &context) noexcept
 
virtual ~SymbolEditorFsm () noexcept
 
EditorWidgetBase::Tool getCurrentTool () const noexcept
 
const QSet< EditorWidgetBase::Feature > & getAvailableFeatures () const noexcept
 
void updateAvailableFeatures () noexcept
 
bool processKeyPressed (const QKeyEvent &e) noexcept
 
bool processKeyReleased (const QKeyEvent &e) noexcept
 
bool processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept
 
bool processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept
 
bool processSelectAll () noexcept
 
bool processCut () noexcept
 
bool processCopy () noexcept
 
bool processPaste () noexcept
 
bool processMove (const Point &delta) noexcept
 
bool processRotate (const Angle &rotation) noexcept
 
bool processMirror (Qt::Orientation orientation) noexcept
 
bool processSnapToGrid () noexcept
 
bool processRemove () noexcept
 
bool processEditProperties () noexcept
 
bool processAbortCommand () noexcept
 
bool processStartSelecting () noexcept
 
bool processStartAddingSymbolPins () noexcept
 
bool processStartAddingNames () noexcept
 
bool processStartAddingValues () noexcept
 
bool processStartDrawLines () noexcept
 
bool processStartDrawArcs () noexcept
 
bool processStartDrawRects () noexcept
 
bool processStartDrawPolygons () noexcept
 
bool processStartDrawCircles () noexcept
 
bool processStartDrawTexts () noexcept
 
bool processStartDxfImport () noexcept
 
bool processStartMeasure () noexcept
 
SymbolEditorStateoperator= (const SymbolEditorState &rhs)=delete
 

Private Types

enum class  State
 

Private Member Functions

SymbolEditorStategetCurrentState () const noexcept
 
bool setNextState (State state) noexcept
 
bool leaveCurrentState () noexcept
 
bool enterNextState (State state) noexcept
 
bool switchToPreviousState () noexcept
 
void handlePasteRequest () noexcept
 

Private Attributes

QMap< State, SymbolEditorState * > mStates
 
State mCurrentState
 
State mPreviousState
 
QSet< EditorWidgetBase::FeaturemAvailableFeatures
 

Detailed Description

The SymbolEditorFsm class is the finit state machine (FSM) of the symbol editor.

Member Enumeration Documentation

◆ State

enum class State
strongprivate
Enumerator
IDLE 
SELECT 
ADD_PINS 
ADD_NAMES 
ADD_VALUES 
DRAW_LINE 
DRAW_ARC 
DRAW_RECT 
DRAW_POLYGON 
DRAW_CIRCLE 
DRAW_TEXT 
MEASURE 

Constructor & Destructor Documentation

◆ SymbolEditorFsm() [1/3]

SymbolEditorFsm ( )
delete

◆ SymbolEditorFsm() [2/3]

SymbolEditorFsm ( const SymbolEditorFsm other)
delete

◆ SymbolEditorFsm() [3/3]

SymbolEditorFsm ( const Context context)
explicitnoexcept

◆ ~SymbolEditorFsm()

~SymbolEditorFsm ( )
virtualnoexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getCurrentTool()

EditorWidgetBase::Tool getCurrentTool ( ) const
noexcept
+ Here is the caller graph for this function:

◆ getAvailableFeatures()

const QSet< EditorWidgetBase::Feature > & getAvailableFeatures ( ) const
inlinenoexcept

◆ updateAvailableFeatures()

void updateAvailableFeatures ( )
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processKeyPressed()

bool processKeyPressed ( const QKeyEvent &  e)
noexcept

◆ processKeyReleased()

bool processKeyReleased ( const QKeyEvent &  e)
noexcept

◆ processGraphicsSceneMouseMoved()

bool processGraphicsSceneMouseMoved ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneLeftMouseButtonPressed()

bool processGraphicsSceneLeftMouseButtonPressed ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneLeftMouseButtonReleased()

bool processGraphicsSceneLeftMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneLeftMouseButtonDoubleClicked()

bool processGraphicsSceneLeftMouseButtonDoubleClicked ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processGraphicsSceneRightMouseButtonReleased()

bool processGraphicsSceneRightMouseButtonReleased ( QGraphicsSceneMouseEvent &  e)
noexcept

◆ processSelectAll()

bool processSelectAll ( )
noexcept
+ Here is the call graph for this function:

◆ processCut()

bool processCut ( )
noexcept
+ Here is the call graph for this function:

◆ processCopy()

bool processCopy ( )
noexcept
+ Here is the call graph for this function:

◆ processPaste()

bool processPaste ( )
noexcept
+ Here is the call graph for this function:

◆ processMove()

bool processMove ( const Point delta)
noexcept

◆ processRotate()

bool processRotate ( const Angle rotation)
noexcept

◆ processMirror()

bool processMirror ( Qt::Orientation  orientation)
noexcept

◆ processSnapToGrid()

bool processSnapToGrid ( )
noexcept
+ Here is the call graph for this function:

◆ processRemove()

bool processRemove ( )
noexcept
+ Here is the call graph for this function:

◆ processEditProperties()

bool processEditProperties ( )
noexcept
+ Here is the call graph for this function:

◆ processAbortCommand()

bool processAbortCommand ( )
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processStartSelecting()

bool processStartSelecting ( )
noexcept
+ Here is the call graph for this function:

◆ processStartAddingSymbolPins()

bool processStartAddingSymbolPins ( )
noexcept
+ Here is the call graph for this function:

◆ processStartAddingNames()

bool processStartAddingNames ( )
noexcept
+ Here is the call graph for this function:

◆ processStartAddingValues()

bool processStartAddingValues ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawLines()

bool processStartDrawLines ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawArcs()

bool processStartDrawArcs ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawRects()

bool processStartDrawRects ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawPolygons()

bool processStartDrawPolygons ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawCircles()

bool processStartDrawCircles ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDrawTexts()

bool processStartDrawTexts ( )
noexcept
+ Here is the call graph for this function:

◆ processStartDxfImport()

bool processStartDxfImport ( )
noexcept
+ Here is the call graph for this function:

◆ processStartMeasure()

bool processStartMeasure ( )
noexcept
+ Here is the call graph for this function:

◆ operator=()

SymbolEditorState & operator= ( const SymbolEditorState rhs)
delete

◆ toolChanged

void toolChanged ( EditorWidgetBase::Tool  newTool)
signal
+ Here is the caller graph for this function:

◆ availableFeaturesChanged

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

◆ statusBarMessageChanged

void statusBarMessageChanged ( const QString &  message,
int  timeoutMs = -1 
)
signal
+ Here is the caller graph for this function:

◆ getCurrentState()

SymbolEditorState * getCurrentState ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setNextState()

bool setNextState ( State  state)
privatenoexcept
+ Here is the caller graph for this function:

◆ leaveCurrentState()

bool leaveCurrentState ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterNextState()

bool enterNextState ( State  state)
privatenoexcept
+ Here is the call graph for this function:

◆ switchToPreviousState()

bool switchToPreviousState ( )
privatenoexcept
+ Here is the call graph for this function:

◆ handlePasteRequest()

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

Member Data Documentation

◆ mStates

QMap<State, SymbolEditorState*> mStates
private

◆ mCurrentState

State mCurrentState
private

◆ mPreviousState

State mPreviousState
private

◆ mAvailableFeatures

QSet<EditorWidgetBase::Feature> mAvailableFeatures
private

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