SHAPER  9.15.0
XGUI_ActionsMgr Class Reference

class XGUI_ActionsMgrA class for management of actions (features) activation/deactivation More...

Inheritance diagram for XGUI_ActionsMgr:
Inheritance graph

Public Types

enum  OperationStateActionId {
  Abort = 0 , Accept = 1 , AcceptPlus = 2 , Help = 3 ,
  AbortAll = 4 , AcceptAll = 5 , Preview = 6
}
 Actions on operations. More...
 

Public Member Functions

 XGUI_ActionsMgr (XGUI_Workshop *theWorkshop)
 Constructor. More...
 
void addCommand (QAction *theCmd)
 Add a command in the manager. More...
 
void addNestedCommands (const QString &theId, const QStringList &theCommands)
 Sets relation between the command (with given Id) and it's nested actions. More...
 
QStringList nestedCommands (const QString &theId) const
 Returns list of nested commands by parent command Id. More...
 
bool isNested (const QString &theId) const
 Returns True if the given Id is an Id of nested command. More...
 
QKeySequence registerShortcut (const QKeySequence &theKeySequence)
 Registers shortcut (key sequence) for the command triggering. More...
 
QKeySequence registerShortcut (const QString &theKeySequence)
 This is an overloaded function. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Redefinition of Events_Listener method. More...
 
QAction * operationStateAction (OperationStateActionId theId)
 Return property panel's action like ok, cancel, help. More...
 
QAction * action (const QString &theId)
 Return an action by the given id, if it was registered in the manager. More...
 
ActionInfo actionInfoById (const QString &theId)
 Return info (icon, text, etc) about the action by the given id, if it was registered in the manager. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

void groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage)
 Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More...
 
EVENTS_EXPORT void flushGrouped (const Events_ID &theID)
 Sends myGroups on flush finish. More...
 

Friends

class XGUI_Workshop
 

Detailed Description

class XGUI_ActionsMgr

A class for management of actions (features) activation/deactivation

Member Enumeration Documentation

◆ OperationStateActionId

Actions on operations.

Constructor & Destructor Documentation

◆ XGUI_ActionsMgr()

XGUI_ActionsMgr::XGUI_ActionsMgr ( XGUI_Workshop theWorkshop)

Constructor.

Parameters
theWorkshopan instance of workshop

Member Function Documentation

◆ addCommand()

void XGUI_ActionsMgr::addCommand ( QAction *  theCmd)

Add a command in the manager.

Please note that nested commands in the Salome mode (No AppElements_Command, pure QActions) won't be extracted and should be added manually using the addNestedCommands method.

◆ addNestedCommands()

void XGUI_ActionsMgr::addNestedCommands ( const QString &  theId,
const QStringList &  theCommands 
)

Sets relation between the command (with given Id) and it's nested actions.

◆ nestedCommands()

QStringList XGUI_ActionsMgr::nestedCommands ( const QString &  theId) const

Returns list of nested commands by parent command Id.

Parameters
theIda parent command Id

◆ isNested()

bool XGUI_ActionsMgr::isNested ( const QString &  theId) const

Returns True if the given Id is an Id of nested command.

Parameters
theIdan Id to check

◆ registerShortcut() [1/2]

QKeySequence XGUI_ActionsMgr::registerShortcut ( const QKeySequence &  theKeySequence)

Registers shortcut (key sequence) for the command triggering.

Parameters
theKeySequencea key sequence to register

◆ registerShortcut() [2/2]

QKeySequence XGUI_ActionsMgr::registerShortcut ( const QString &  theKeySequence)

This is an overloaded function.

Registers shortcut (key sequence) for the command triggering

Parameters
theKeySequence- string that contain a key sequence to register

◆ processEvent()

void XGUI_ActionsMgr::processEvent ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Redefinition of Events_Listener method.

Implements Events_Listener.

◆ operationStateAction()

QAction * XGUI_ActionsMgr::operationStateAction ( OperationStateActionId  theId)

Return property panel's action like ok, cancel, help.

If there is no such action, it will be created.

◆ action()

QAction * XGUI_ActionsMgr::action ( const QString &  theId)

Return an action by the given id, if it was registered in the manager.

◆ actionInfoById()

ActionInfo XGUI_ActionsMgr::actionInfoById ( const QString &  theId)

Return info (icon, text, etc) about the action by the given id, if it was registered in the manager.

◆ groupMessages()

virtual EVENTS_EXPORT bool Events_Listener::groupMessages ( )
inlinevirtualinherited

Listener that needs mostly grouped messages received returns true in this method.

In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.

Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.

◆ groupWhileFlush()

void Events_Listener::groupWhileFlush ( const std::shared_ptr< Events_Message > &  theMessage)
protectedinherited

Allows to group messages while they are flushed (for flush for groupMessages=true listeners)

◆ flushGrouped()

void Events_Listener::flushGrouped ( const Events_ID theID)
protectedinherited

Sends myGroups on flush finish.