VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfMenuKeyMapManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #if !defined(Q_MOC_RUN)
16 
17 #include <vrvCore/DtMenuPath.h>
23 #endif
24 
25 #include <QObject>
26 
27 class QEvent;
28 class QAction;
29 class QCheckBox;
30 class QTranslator;
31 
32 namespace makVrv
33 {
34  class DtKeyMap;
35  class DtDe;
36 }
37 
38 namespace makVrf
39 {
40  class DtAssembledMenu;
41 
47  {
48  Q_OBJECT
49 
50  public:
52  virtual ~DtVrfMenuKeyMapManager();
53 
55  static DtVrfMenuKeyMapManager& instance(makVrv::DtDe& de);
56  static void registerInstance(makVrv::DtDe&, DtVrfMenuKeyMapManager*);
57 
60  virtual void setup();
61 
63  virtual void addKeyboardMenuMapping(const makVrv::DtMenuPath& path);
64 
66  virtual void removeKeyboardMenuMapping(const makVrv::DtMenuPath& path);
67 
69  virtual void setApplyChangesToAllKeymaps(bool);
70  virtual bool applyChangesToAllKeymaps() const;
71 
73  virtual bool isMenuFunction(const std::string& func) const;
74 
76  virtual QString reverseTranslate(const QString&) const;
77 
79  virtual void copyKeyFunction(const makVrv::DtMenuPath& from, const makVrv::DtMenuPath& to);
80 
82  virtual bool setSaveManagersOnChange(bool);
83  virtual bool saveManagersOnChange() const;
84 
85  virtual bool hasActionToProcessNonFocusKey(const QKeySequence&);
86 
87  protected slots:
88  virtual void actionDestroyed();
89 
90  protected:
92  virtual bool eventFilter(QObject*, QEvent*);
93 
96  virtual std::string menuPathToFunctionName(const makVrv::DtMenuPath&) const;
97 
99  virtual void slot_triggerShortcut(makVrv::DtMenuPath);
100 
103  virtual void setKeyMap(makVrv::DtKeyMapManager*, std::string currentMap);
104 
108  virtual void manageChangeableMenu(const std::string& menuId);
109 
112  virtual void setupChangeableMenus();
113 
115  virtual void preAssembleConfigurableMenu(DtAssembledMenu*);
116 
118  virtual void postAssembleConfigurableMenu(DtAssembledMenu*);
119 
122  virtual int mapPathToKeymapFunctionCategory(const std::string& path);
123 
126  virtual void keyMappingRemoved(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
128 
131  virtual void keyMappingModified(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
133 
135  virtual void setupKeyMappingFor(const std::string& path, QAction* action, makVrv::DtKeyMap* map);
136 
139  virtual void resetShortcut(makVrv::DtKeyMap*, std::string);
140 
141  void parseTSFile(const QString& file);
142 
143  virtual void zoomToExtents();
144 
145  protected:
148 
149  std::map<QKeySequence, QAction*> myShortcuts;
150 
151  typedef std::map<std::string, std::string> FunctionToPathMap;
153 
154  typedef std::map<std::string, std::string> PathToFunctionMap;
156 
157  typedef std::map<std::string, int> FunctionCategoryMap;
159 
161  std::map<QString, QString> myReverseMap;
162 
164  std::string myCurrentKeyMap;
166  };
167 
170  {
171  public:
173  DtVrfKeyMappingEditorPage(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f);
174 
176  virtual ~DtVrfKeyMappingEditorPage();
177  };
178 
181 
184  {
185  Q_OBJECT
186 
187  public:
189  DtVrfKeyMappingEditorWidget( makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags flags = 0);
190 
192  virtual ~DtVrfKeyMappingEditorWidget();
193 
194  protected:
196  virtual void closeEvent(QCloseEvent*);
197 
199  virtual void hideEvent(QHideEvent*);
200 
201  virtual void addKeyFunction(const std::string& name, const std::string& keyString);
202 
203  protected slots:
204  virtual void on_applyChangesToAllKeymapsChanged();
205 
210  virtual void requestInput( const std::string& functionName,
211  const makVrv::DtKeyMapping& keyMapping, bool isBinary );
212  virtual void requestInput( const std::string& functionName, bool isBinary );
213 
214  protected:
217  };
218 
220  {
221  public:
222 
224  DtVrfRequestKeyMapKeyDialog( QWidget* parent = 0, Qt::WindowFlags flags = Qt::Tool );
225 
227  virtual ~DtVrfRequestKeyMapKeyDialog();
228 
230  void show( std::string functionName, bool isBinary );
231 
233  void show( std::string functionName, const makVrv::DtKeyMapping& keyMapping,
234  bool isBinary );
235  };
236 }
bool myApplyChangesToAllKeymaps
Definition: vrfMenuKeyMapManager.h:160
makVrv::DtDe & myDe
Definition: vrfMenuKeyMapManager.h:146
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::string myCurrentKeyMap
Definition: vrfMenuKeyMapManager.h:164
Contains makVrv::DtKeyMapManagerSignaler class.
std::map< std::string, std::string > PathToFunctionMap
Definition: vrfMenuKeyMapManager.h:154
makVrv::DtRequestKeyMapKeyDialog * myMenuItemKeyMapDialog
Definition: vrfMenuKeyMapManager.h:216
The reverse key map is a list of these for each function name.
Definition: DtKeyMap.h:246
Contains makVrv::DtKeyMappingEditorPage class.
makVrv::DtPageCreatorTemplate< DtVrfKeyMappingEditorPage > DtVrfKeyMappingEditorPageCreator
Definition: vrfMenuKeyMapManager.h:180
Definition: DtPage.h:150
a Key Map contains a map of keys to FunctionMapEntrys, as well as a list of functions to execute when...
Definition: DtKeyMap.h:312
KeyModifier
Describe which modifier(s) are pressed.
Definition: DtKeyState.h:136
Contains makVrv::DtMenuPath class.
The manager for owning key maps.
Definition: DtKeyMapManager.h:32
Override these classes to be able to add check box to apply menu item changes to all key maps...
Definition: vrfMenuKeyMapManager.h:169
Contains makVrv::DtVirtualBaseClass class.
This class will traverse the created actions in the menu system and add a potential key mapping for t...
Definition: vrfMenuKeyMapManager.h:45
std::map< QKeySequence, QAction * > myShortcuts
Definition: vrfMenuKeyMapManager.h:149
makVrv::DtSignalConnectionManager myConnectionManager
Definition: vrfMenuKeyMapManager.h:147
QCheckBox * myApplyChangesToAllKeymaps
Definition: vrfMenuKeyMapManager.h:215
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Contains makVrv::DtKeyMapManager class.
std::map< std::string, std::string > FunctionToPathMap
Definition: vrfMenuKeyMapManager.h:151
FunctionToPathMap myFunctionToPathMap
Definition: vrfMenuKeyMapManager.h:152
Base class for menus that are assembled on an as needed basis.
Definition: selectionEnabledMenu.h:29
a Class which represents a menu path. The specific strings are not menu text, but the names used when...
Definition: DtMenuPath.h:27
#define DT_DLL_VRFGUICOMMONQT
Definition: vrfGuiCommonQt.h:20
A dialog page controlling file caching.
Definition: DtKeyMappingEditorPage.h:24
A widget class for editing key functions.
Definition: DtKeyMappingEditorWidget.h:44
bool mySetupChanged
Definition: vrfMenuKeyMapManager.h:165
Widget to add check box for applying menu changes only to all menu items.
Definition: vrfMenuKeyMapManager.h:183
Base class to provide boost signal/slot management.
std::map< std::string, int > FunctionCategoryMap
Definition: vrfMenuKeyMapManager.h:157
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
Contains the DtKeyMappingEditorWidget class declaration.
PathToFunctionMap myPathToFunctionMap
Definition: vrfMenuKeyMapManager.h:155
bool mySaveManagersOnChange
Definition: vrfMenuKeyMapManager.h:163
Definition: vrfMenuKeyMapManager.h:219
KeyType
Enumerate the key types. These are based on Virtual Key Codes.
Definition: DtKeyState.h:25
This is the dialog the user types key sequences to be mapped. It shares a logic object with DtKeyMapE...
Definition: DtKeyMappingEditorWidget.h:223
KeyEventType
Enumerate the types of key events supported.
Definition: DtKeyEvent.h:20
std::map< QString, QString > myReverseMap
Definition: vrfMenuKeyMapManager.h:161
FunctionCategoryMap myFunctionCategories
Definition: vrfMenuKeyMapManager.h:158

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)