VR-Forces 4.3.1 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>
22 
23 #include <QObject>
24 
25 class QEvent;
26 class QAction;
27 class QCheckBox;
28 class QTranslator;
29 
30 namespace makVrv
31 {
32  class DtKeyMapManager;
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 
76  protected:
78  virtual bool eventFilter(QObject*, QEvent*);
79 
82  virtual std::string menuPathToFunctionName(const makVrv::DtMenuPath&) const;
83 
85  virtual void slot_triggerShortcut(makVrv::DtMenuPath);
86 
89  virtual void setKeyMap(makVrv::DtKeyMapManager*, std::string currentMap);
90 
94  virtual void manageChangeableMenu(const std::string& menuId);
95 
98  virtual void setupChangeableMenus();
99 
101  virtual void preAssembleConfigurableMenu(DtAssembledMenu*);
102 
104  virtual void postAssembleConfigurableMenu(DtAssembledMenu*);
105 
108  virtual int mapPathToKeymapFunctionCategory(const std::string& path);
109 
112  virtual void keyMappingRemoved(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
114 
117  virtual void keyMappingModified(makVrv::DtKeyMap*, std::string, makVrv::DtKeyState::KeyType,
119 
121  virtual void setupKeyMappingFor(const std::string& path, QAction* action, makVrv::DtKeyMap* map);
122 
125  virtual void resetShortcut(makVrv::DtKeyMap*, std::string);
126 
127  void parseTSFile(const QString& file);
128 
129  protected:
132 
133  typedef std::map<std::string, std::string> FunctionToPathMap;
135 
136  typedef std::map<std::string, std::string> PathToFunctionMap;
138 
139  typedef std::map<std::string, int> FunctionCategoryMap;
141 
143  std::map<QString, QString> myReverseMap;
144  };
145 
148  {
149  public:
151  DtVrfKeyMappingEditorPage(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f);
152 
154  virtual ~DtVrfKeyMappingEditorPage();
155  };
156 
159 
162  {
163  Q_OBJECT
164 
165  public:
167  DtVrfKeyMappingEditorWidget( makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags flags = 0);
168 
170  virtual ~DtVrfKeyMappingEditorWidget();
171 
172  protected slots:
173  virtual void on_applyChangesToAllKeymapsChanged();
174 
179  virtual void requestInput( const std::string functionName,
180  const makVrv::DtKeyMapping& keyMapping, bool isBinary );
181  virtual void requestInput( const std::string functionName, bool isBinary );
182 
183  protected:
186  };
187 
189  {
190  public:
191 
193  DtVrfRequestKeyMapKeyDialog( QWidget* parent = 0, Qt::WindowFlags flags = Qt::Tool | Qt::SubWindow );
194 
196  virtual ~DtVrfRequestKeyMapKeyDialog();
197 
199  void show( std::string functionName, bool isBinary );
200 
202  void show( std::string functionName, const makVrv::DtKeyMapping& keyMapping,
203  bool isBinary );
204  };
205 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)