NDEVR
API Documentation
ContextMenuManager

Manages setting up the context menu that is shown when the user right-clicks or accesses the ContextMenu for an object, selection, or scene. More...

Inheritance diagram for ContextMenuManager:
[legend]
Collaboration diagram for ContextMenuManager:
[legend]

Public Member Functions

 ContextMenuManager (QTModelManager *manager)
 Constructs a ContextMenuManager.
virtual ContextMenuActions actionType (QAction *action)
 Determines the built-in action type for the given QAction.
virtual void addContextMenuCallback (const UUID &id, ContextMenuCallback *callback)
 Registers a custom context menu callback for a specific object.
virtual void addContextMenuItems (QMenu &menu, const Buffer< UUID > &ids=Buffer< UUID >(), const SelectionInfo &selection_info=SelectionInfo())
 Populates the menu with context-appropriate items for the given selection.
virtual void contextMenu (QAction *action, const Buffer< UUID > &ids, const SelectionInfo &selection_info=SelectionInfo(), PopupInfo origin=PopupInfo())
 Handles execution of a triggered context menu action.
virtual bool hasContextMenuCallback (const UUID &id) const
 Checks whether a custom context menu callback exists for the given UUID.
virtual void removeContextMenuCallback (const UUID &id)
 Removes a custom context menu callback by UUID.

Protected Attributes

Dictionary< UUID, ContextMenuCallback * > m_custom_context_callbacks
 Custom callbacks keyed by UUID.
QTModelManagerm_manager
 The model manager providing data context.

Detailed Description

Manages setting up the context menu that is shown when the user right-clicks or accesses the ContextMenu for an object, selection, or scene.


Definition at line 68 of file ContextMenuManager.h.

Constructor & Destructor Documentation

◆ ContextMenuManager()

ContextMenuManager::ContextMenuManager ( QTModelManager * manager)

Constructs a ContextMenuManager.

Parameters
[in]managerThe model manager providing data context.

Member Function Documentation

◆ actionType()

virtual ContextMenuActions ContextMenuManager::actionType ( QAction * action)
virtual

Determines the built-in action type for the given QAction.

Parameters
[in]actionThe action to identify.
Returns
The corresponding ContextMenuActions enum value.

◆ addContextMenuCallback()

virtual void ContextMenuManager::addContextMenuCallback ( const UUID & id,
ContextMenuCallback * callback )
virtual

Registers a custom context menu callback for a specific object.

Parameters
[in]idThe UUID to associate with the callback.
[in]callbackThe callback to invoke for context menu events.

◆ addContextMenuItems()

virtual void ContextMenuManager::addContextMenuItems ( QMenu & menu,
const Buffer< UUID > & ids = BufferUUID >(),
const SelectionInfo & selection_info = SelectionInfo() )
virtual

Populates the menu with context-appropriate items for the given selection.

Parameters
[in]menuThe menu to populate.
[in]idsThe UUIDs of the selected objects.
[in]selection_infoThe selection context information.

◆ contextMenu()

virtual void ContextMenuManager::contextMenu ( QAction * action,
const Buffer< UUID > & ids,
const SelectionInfo & selection_info = SelectionInfo(),
PopupInfo origin = PopupInfo() )
virtual

Handles execution of a triggered context menu action.

Parameters
[in]actionThe action that was triggered.
[in]idsThe UUIDs of the selected objects.
[in]selection_infoThe selection context information.
[in]originThe popup origin for positioning result dialogs.

◆ hasContextMenuCallback()

virtual bool ContextMenuManager::hasContextMenuCallback ( const UUID & id) const
virtual

Checks whether a custom context menu callback exists for the given UUID.

Parameters
[in]idThe UUID to check.
Returns
True if a callback is registered for the UUID.

◆ removeContextMenuCallback()

virtual void ContextMenuManager::removeContextMenuCallback ( const UUID & id)
virtual

Removes a custom context menu callback by UUID.

Parameters
[in]idThe UUID of the callback to remove.

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