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 bool isKeycodeMatch(int key_code,
41  const char *hotkey_symbol) = 0;
42  virtual std::vector<std::string>
43  findConflicts(const char *hotkey_symbol,
44  const char *key) = 0;
45 
46  virtual int changeIndex() = 0;
47 
48 
49  // Functions for manager UI
50  virtual std::vector< std::map<std::string, std::string> >
51  commandsInContext(const char * context) = 0;
52 
53  virtual std::vector< std::map<std::string, std::string> >
54  contextsInContext(const char *context) = 0;
55 
56 
57  // Modify hotkeys and key assignments
58  virtual bool addCommand(
59  const char *hotkey_symbol,
60  const char *label,
61  const char *description,
62  const std::vector<std::string> &assignments = std::vector<std::string>()) = 0;
63 
64  virtual bool addContext(const char *hotkey_symbol,
65  const char *label,
66  const char *description) = 0;
67 
68  virtual void removeHotkeySymbol(
69  const char* hotkey_symbol) = 0;
70 
71  virtual std::string hotkeySymbol(
72  const char *english_context,
73  const char *english_command = nullptr) = 0;
74  virtual bool clearAssignments(
75  const char *hotkey_symbol) = 0;
76  virtual bool addAssignment(const char *hotkey_symbol,
77  const char *key) = 0;
78  virtual bool removeAssignment(const char *hotkey_symbol,
79  const char *key) = 0;
80 
81  virtual std::map<std::string, std::vector<std::string> >
82  _getHotkeysStatus(
83  const char *hotkey_symbol,
84  int modifier_mask = 0) = 0;
85 
86  virtual std::vector<int> availableKeycodes(
87  const char *hotkey_symbol,
88  int modifier_mask = 0) = 0;
89 
90 
91  // Key utilities
92  virtual std::string keycodeToString(int keycode,
93  short modifiers = 0) = 0;
94  virtual int stringToKeycode(const char *key,
95  short modifiers = 0) = 0;
96 
97 
98  // backup/restore/save
99  virtual void _createBackupTables() = 0;
100  virtual void _restoreBackupTables() = 0;
101  virtual void revertToDefaults(
102  const char *hotkey_symbol,
103  bool one_level_only) = 0;
104  virtual bool saveOverrides() = 0;
105 
106 
107  // Keymaps
108  virtual bool saveAsKeymap(
109  const char *name,
110  const char *path = nullptr) = 0;
111  virtual bool loadKeymap(
112  const char *name,
113  const char *path = nullptr) = 0;
114  virtual bool importKeymap(const char *name,
115  const char *path) = 0;
116  virtual std::vector<std::pair<std::string, std::string> >
117  keymaps() = 0;
118  virtual std::string currentKeymap() = 0;
119 };
120 
121 #endif
virtual ~HOM_hotkeys()
Definition: HOM_hotkeys.h:25
OIIO_API bool rename(string_view from, string_view to, std::string &err)
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:353
GLuint const GLchar * name
Definition: glcorearb.h:785
#define HOM_API
Definition: HOM_API.h:13
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544