HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_hotkeys.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_hotKeys_h__
10 #define __HOM_hotKeys_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Module.h"
15 #include "HOM_EnumValue.h"
16 #include "HOM_EnumModules.h"
17 #include "HOM_Errors.h"
18 #include <vector>
19 #include <map>
20 
21 SWIGOUT(%rename(hotkeys) HOM_hotkeys;)
23 {
24 public:
25  virtual ~HOM_hotkeys()
26  {}
27 
28  virtual std::string __repr__() = 0;
29 
30  // Hotkey information
31  virtual std::vector<std::string>
32  assignments(
33  const char *hotkey_symbol) = 0;
34  virtual std::string hotkeyDescription(
35  const char *hotkey_symbol) = 0;
36  virtual std::string hotkeyLabel(
37  const char *hotkey_symbol) = 0;
38  virtual bool isKeyMatch(const char *key,
39  const char *hotkey_symbol) = 0;
40  virtual std::vector<std::string>
41  findConflicts(const char *hotkey_symbol,
42  const char *key) = 0;
43 
44  virtual int changeIndex() = 0;
45 
46 
47  // Functions for manager UI
48  virtual std::vector< std::map<std::string, std::string> >
49  commandsInContext(const char * context) = 0;
50 
51  virtual std::vector< std::map<std::string, std::string> >
52  contextsInContext(const char *context) = 0;
53 
54 
55  // Modify hotkeys and key assignments
56  virtual bool addCommand(
57  const char *hotkey_symbol,
58  const char *label,
59  const char *description,
60  const std::vector<std::string> &assignments = std::vector<std::string>()) = 0;
61 
62  virtual bool addContext(const char *hotkey_symbol,
63  const char *label,
64  const char *description) = 0;
65 
66  virtual void removeHotkeySymbol(
67  const char* hotkey_symbol) = 0;
68 
69  virtual std::string hotkeySymbol(
70  const char *english_context,
71  const char *english_command = nullptr) = 0;
72  virtual bool clearAssignments(
73  const char *hotkey_symbol) = 0;
74  virtual bool addAssignment(const char *hotkey_symbol,
75  const char *key) = 0;
76  virtual bool removeAssignment(const char *hotkey_symbol,
77  const char *key) = 0;
78 
79  virtual std::map<std::string, std::vector<std::string> >
80  _getHotkeysStatus(
81  const char *hotkey_symbol,
82  int modifier_mask = 0) = 0;
83 
84  virtual std::vector<int> availableKeycodes(
85  const char *hotkey_symbol,
86  int modifier_mask = 0) = 0;
87 
88 
89  // Key utilities
90  virtual std::string keycodeToString(int keycode,
91  short modifiers = 0) = 0;
92  virtual int stringToKeycode(const char *key,
93  short modifiers = 0) = 0;
94 
95 
96  // backup/restore/save
97  virtual void _createBackupTables() = 0;
98  virtual void _restoreBackupTables() = 0;
99  virtual void revertToDefaults(
100  const char *hotkey_symbol,
101  bool one_level_only) = 0;
102  virtual bool saveOverrides() = 0;
103 
104 
105  // Keymaps
106  virtual bool saveAsKeymap(
107  const char *name,
108  const char *path = nullptr) = 0;
109  virtual bool loadKeymap(
110  const char *name,
111  const char *path = nullptr) = 0;
112  virtual bool importKeymap(const char *name,
113  const char *path) = 0;
114  virtual std::vector<std::pair<std::string, std::string> >
115  keymaps() = 0;
116  virtual std::string currentKeymap() = 0;
117 };
118 
119 #endif
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual ~HOM_hotkeys()
Definition: HOM_hotkeys.h:25
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
#define HOM_API
Definition: HOM_API.h:13
GLuint const GLchar * name
Definition: glcorearb.h:785