API Documentation
Loading...
Searching...
No Matches
ContextMenuManager.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/SoftwareService.h>
3#include <NDEVR/PopupInfo.h>
4#include <NDEVR/SelectionInfo.h>
5#include <QMenu>
6namespace NDEVR
7{
8 /**--------------------------------------------------------------------------------------------------
9 \brief Default built-in context menu actions.
10 **/
35 class QTModelManager;
36 /**--------------------------------------------------------------------------------------------------
37 \brief Allows for customization of what is shown when the user right-clicks or accesses the ContextMenu
38 for an object, selection, or scene.
39 **/
41 {
42 public:
43 virtual void addContextMenuItems(QTModelManager* manager, QMenu& menu, const Buffer<UUID>& ids, const SelectionInfo& cursor_location) = 0;
44 virtual void contextMenu(QTModelManager* manager, QAction* action, const Buffer<UUID>& ids, const SelectionInfo& cursor_location, PopupInfo origin) = 0;
45 };
46 /**--------------------------------------------------------------------------------------------------
47 \brief Manages setting up the context menu that is shown when the user right-clicks or accesses
48 the ContextMenu for an object, selection, or scene.
49 **/
51 {
52 public:
54 virtual void addContextMenuItems(QMenu& menu, const Buffer<UUID>& ids = Buffer<UUID>(), const SelectionInfo& selection_info = SelectionInfo());
55 virtual void contextMenu(QAction* action, const Buffer<UUID>& ids, const SelectionInfo& selection_info = SelectionInfo(), PopupInfo origin = PopupInfo());
56 virtual void addContextMenuCallback(const UUID& id, ContextMenuCallback* callback);
57 virtual void removeContextMenuCallback(const UUID& id);
58 virtual bool hasContextMenuCallback(const UUID& id) const;
59 virtual ContextMenuActions actionType(QAction* action);
60 protected:
63 };
64}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Allows for customization of what is shown when the user right-clicks or accesses the ContextMenu for ...
Definition ContextMenuManager.h:41
virtual void contextMenu(QTModelManager *manager, QAction *action, const Buffer< UUID > &ids, const SelectionInfo &cursor_location, PopupInfo origin)=0
virtual void addContextMenuItems(QTModelManager *manager, QMenu &menu, const Buffer< UUID > &ids, const SelectionInfo &cursor_location)=0
Manages setting up the context menu that is shown when the user right-clicks or accesses the ContextM...
Definition ContextMenuManager.h:51
virtual void addContextMenuCallback(const UUID &id, ContextMenuCallback *callback)
virtual void addContextMenuItems(QMenu &menu, const Buffer< UUID > &ids=Buffer< UUID >(), const SelectionInfo &selection_info=SelectionInfo())
Dictionary< UUID, ContextMenuCallback * > m_custom_context_callbacks
Definition ContextMenuManager.h:61
virtual bool hasContextMenuCallback(const UUID &id) const
virtual void removeContextMenuCallback(const UUID &id)
virtual void contextMenu(QAction *action, const Buffer< UUID > &ids, const SelectionInfo &selection_info=SelectionInfo(), PopupInfo origin=PopupInfo())
virtual ContextMenuActions actionType(QAction *action)
ContextMenuManager(QTModelManager *manager)
QTModelManager * m_manager
Definition ContextMenuManager.h:62
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
Definition Selector.h:50
Software Services provide an interface for adding to or changing the software behavior via functional...
Definition SoftwareService.h:9
Software Service Managers take a Software service to modify the behavior of the software.
Definition SoftwareService.h:15
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
ContextMenuActions
Default built-in context menu actions.
Definition ContextMenuManager.h:12
Class which is used to pass arguments and requests for creating a popup dialog or widget....
Definition PopupInfo.h:15