VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMenuManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMenuManager.h,v $ $Revision: 1.8 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtMenuManager_H_
14 #define DtMenuManager_H_
15 
16 #include <vrvCoreQt/vrvCoreQt.h>
18 #include <vrvCore/DtMenuPath.h>
19 
20 #include <QtCore/QObject>
21 
22 class QMenu;
23 class QAction;
24 
25 namespace makVrv
26 {
27  class DtDe;
28  class DtMenuPath;
29 
30 
35  {
36  Q_OBJECT;
37  public:
38 
40  static DtMenuManager& instance(DtDe& de);
41 
43  virtual ~DtMenuManager();
44 
46  void registerMenu(const DtMenuPath& path, QMenu* menu);
47 
49  void registerMenuItem(const DtMenuPath& path, QAction* action);
50 
52  QMenu* findMenu(const DtMenuPath& path) const;
53 
55  QAction* findMenuItem(const DtMenuPath& path) const;
56 
59  const std::map<DtMenuPath,QMenu*>& menus() const;
60  const std::map<DtMenuPath,QAction*> menuItems() const;
61 
62  boost::signal<void (const DtMenuPath&)> signal_menuDeleted;
63  boost::signal<void (const DtMenuPath&)> signal_menuItemDeleted;
64 
65  protected slots:
66 
68  void onMenuDestroyed(QObject* obj);
69 
71  void onActionDestroyed(QObject* obj);
72 
73  protected:
74 
76  DtMenuManager();
77 
78  std::map<DtMenuPath,QMenu*> myMenus;
79  std::map<DtMenuPath,QAction*> myMenuItems;
80  };
81 }
82 
83 #endif
84 
Virtual base class.
Definition: DtVirtualBaseClass.h:22
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
boost::signal< void(const DtMenuPath &)> signal_menuDeleted
Definition: DtMenuManager.h:62
std::map< DtMenuPath, QAction * > myMenuItems
Definition: DtMenuManager.h:79
Contains makVrv::DtMenuPath class.
Contains makVrv::DtVirtualBaseClass class.
A Menu manager which is how to lookup and find menu/menu items using menu paths.
Definition: DtMenuManager.h:34
boost::signal< void(const DtMenuPath &)> signal_menuItemDeleted
Definition: DtMenuManager.h:63
a Class which represents a menu path.
Definition: DtMenuPath.h:30
std::map< DtMenuPath, QMenu * > myMenus
Definition: DtMenuManager.h:78
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)