VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)