VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
15 #include <vrvUtil/signalslib.h>
16 #include <vrvCore/DtDe.h>
17 #include <vrvCore/DtMenuPath.h>
23 
24 #include <QObject>
25 
26 class QEvent;
27 class QAction;
28 class QCheckBox;
29 class QTranslator;
30 
31 namespace makVrv
32 {
33  class DtKeyMap;
34 }
35 
36 namespace makVrf
37 {
38  class DtAssembledMenu;
39 
45  {
46  Q_OBJECT
47 
48  public:
50  virtual ~DtVrfMenuKeyMapManager();
51 
53  static DtVrfMenuKeyMapManager& instance(makVrv::DtDe& de);
54  static void registerInstance(makVrv::DtDe&, DtVrfMenuKeyMapManager*);
55 
58  virtual void setup();
59 
61  virtual void addKeyboardMenuMapping(const makVrv::DtMenuPath& path);
62 
64  virtual void removeKeyboardMenuMapping(const makVrv::DtMenuPath& path);
65 
67  virtual void setApplyChangesToAllKeymaps(bool);
68  virtual bool applyChangesToAllKeymaps() const;
69 
71  virtual bool isMenuFunction(const std::string& func) const;
72 
74  virtual QString reverseTranslate(const QString&) const;
75 
77  virtual void copyKeyFunction(const makVrv::DtMenuPath& from, const makVrv::DtMenuPath& to);
78 
79  protected:
81  virtual bool eventFilter(QObject*, QEvent*);
82 
85  virtual std::string menuPathToFunctionName(const makVrv::DtMenuPath&) const;
86 
88  virtual void slot_triggerShortcut(makVrv::DtMenuPath);
89 
92  virtual void setKeyMap(makVrv::DtKeyMapManager*, std::string currentMap);
93 
97  virtual void manageChangeableMenu(const std::string& menuId);
98 
101  virtual void setupChangeableMenus();
102 
104  virtual void preAssembleConfigurableMenu(DtAssembledMenu*);
105 
107  virtual void postAssembleConfigurableMenu(DtAssembledMenu*);
108 
111  virtual int mapPathToKeymapFunctionCategory(const std::string& path);
112 
115  virtual void keyMappingRemoved(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
117 
120  virtual void keyMappingModified(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
122 
124  virtual void setupKeyMappingFor(const std::string& path, QAction* action, makVrv::DtKeyMap* map);
125 
128  virtual void resetShortcut(makVrv::DtKeyMap*, std::string);
129 
130  void parseTSFile(const QString& file);
131 
132  protected:
135 
136  typedef std::map<std::string, std::string> FunctionToPathMap;
138 
139  typedef std::map<std::string, std::string> PathToFunctionMap;
141 
142  typedef std::map<std::string, int> FunctionCategoryMap;
144 
146  std::map<QString, QString> myReverseMap;
147  };
148 
151  {
152  public:
154  DtVrfKeyMappingEditorPage(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f);
155 
157  virtual ~DtVrfKeyMappingEditorPage();
158  };
159 
162 
165  {
166  Q_OBJECT
167 
168  public:
170  DtVrfKeyMappingEditorWidget( makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags flags = 0);
171 
173  virtual ~DtVrfKeyMappingEditorWidget();
174 
175  protected:
177  virtual void closeEvent(QCloseEvent*);
178 
180  virtual void hideEvent(QHideEvent*);
181 
182  protected slots:
183  virtual void on_applyChangesToAllKeymapsChanged();
184 
189  virtual void requestInput( const std::string& functionName,
190  const makVrv::DtKeyMapping& keyMapping, bool isBinary );
191  virtual void requestInput( const std::string& functionName, bool isBinary );
192 
193  protected:
196  };
197 
199  {
200  public:
201 
203  DtVrfRequestKeyMapKeyDialog( QWidget* parent = 0, Qt::WindowFlags flags = Qt::Tool );
204 
206  virtual ~DtVrfRequestKeyMapKeyDialog();
207 
209  void show( std::string functionName, bool isBinary );
210 
212  void show( std::string functionName, const makVrv::DtKeyMapping& keyMapping,
213  bool isBinary );
214  };
215 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)