1 #ifndef XGUI_ContextMenuMgr_H
2 #define XGUI_ContextMenuMgr_H
11 class QContextMenuEvent;
15 * A claas wihich provides manement of context menu
17 class XGUI_EXPORT XGUI_ContextMenuMgr : public QObject
21 XGUI_ContextMenuMgr(XGUI_Workshop* theParent);
22 virtual ~XGUI_ContextMenuMgr();
24 /// Create all actions for context menus. It is called on creation of application
27 /// Returns action according to the given ID
28 QAction* action(const QString& theId) const;
30 /// Returns list of registered actions Ids
31 QStringList actionIds() const;
33 /// update state of internal commands
34 void updateCommandsStatus();
36 /// Connect to object browser from workshop. Has to called at creation of viewer.
37 void connectObjectBrowser() const;
39 /// Connect to viewer from workshop. Has to called at creation of viewer.
40 void connectViewer() const;
42 /// Add menu atems for viewer into the given menu (used in SALOME mode)
43 void addViewerItems(QMenu* theMenu) const;
46 void actionTriggered(const QString& theId, bool isChecked);
49 void onAction(bool isChecked);
51 void onContextMenuRequest(QContextMenuEvent* theEvent);
56 * \param theId - string ID of the item
57 * \param theAction - action to add
59 void addAction(const QString& theId, QAction* theAction);
61 QMenu* objectBrowserMenu() const;
62 QMenu* viewerMenu() const;
64 QMap<QString, QAction*> myActions;
66 XGUI_Workshop* myWorkshop;