00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __vtkKWEventMap_h
00022 #define __vtkKWEventMap_h
00023
00024 #include "vtkObject.h"
00025 #include "vtkKWWidgets.h"
00026
00027 class KWWidgets_EXPORT vtkKWEventMap : public vtkObject
00028 {
00029 public:
00030 static vtkKWEventMap *New();
00031 vtkTypeRevisionMacro(vtkKWEventMap, vtkObject);
00032 void PrintSelf(ostream& os, vtkIndent indent);
00033
00034
00035
00036
00037
00038
00039 enum
00040 {
00041 LeftButton = 0,
00042 MiddleButton = 1,
00043 RightButton = 2
00044 };
00045
00046 enum
00047 {
00048 NoModifier = 0,
00049 ShiftModifier = 1,
00050 ControlModifier = 2,
00051 ControlShiftModifier = 3
00052 };
00053
00054
00055
00056
00057
00058 class MouseEvent
00059 {
00060 public:
00061 int Button;
00062 int Modifier;
00063 char *Action;
00064 char *Context;
00065 char *Description;
00066 };
00067
00068
00069
00070 class KeyEvent
00071 {
00072 public:
00073 char Key;
00074 int Modifier;
00075 char *Action;
00076 char *Context;
00077 char *Description;
00078 };
00079
00080
00081
00082 class KeySymEvent
00083 {
00084 public:
00085 char *KeySym;
00086 int Modifier;
00087 char *Action;
00088 char *Context;
00089 char *Description;
00090 };
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 void AddMouseEvent(vtkKWEventMap::MouseEvent *me);
00101
00102 void AddMouseEvent(int button, int modifier, const char *action);
00103 void AddMouseEvent(int button, int modifier, const char *action,
00104 const char *context, const char *description);
00105
00106
00107
00108
00109
00110
00111 void SetMouseEvent(vtkKWEventMap::MouseEvent *me);
00112
00113 void SetMouseEvent(int button, int modifier, const char *action);
00114 void SetMouseEvent(int button, int modifier, const char *action,
00115 const char *context, const char *description);
00116
00117
00118
00119
00120 vtkKWEventMap::MouseEvent* GetMouseEvent(int index);
00121
00122
00123
00124
00125
00126
00127 void RemoveMouseEvent(vtkKWEventMap::MouseEvent *me);
00128
00129 void RemoveMouseEvent(int button, int modifier, const char *action = NULL);
00130 void RemoveAllMouseEvents();
00131
00132
00133
00134
00135 const char* FindMouseAction(int button, int modifier);
00136
00137
00138
00139 vtkGetMacro(NumberOfMouseEvents, int);
00140
00141
00142
00143
00144
00145
00146
00147 void AddKeyEvent(vtkKWEventMap::KeyEvent *me);
00148
00149 void AddKeyEvent(char key, int modifier, const char *action);
00150 void AddKeyEvent(char key, int modifier, const char *action,
00151 const char *context, const char *description);
00152
00153
00154
00155
00156 void SetKeyEvent(char key, int modifier, const char *action);
00157 void SetKeyEvent(char key, int modifier, const char *action,
00158 const char *context, const char *description);
00159
00160
00161
00162
00163 vtkKWEventMap::KeyEvent* GetKeyEvent(int index);
00164
00165
00166
00167
00168
00169 void RemoveKeyEvent(char key, int modifier, const char *action = NULL);
00170 void RemoveAllKeyEvents();
00171
00172
00173
00174
00175 const char* FindKeyAction(char key, int modifier);
00176
00177
00178
00179 vtkGetMacro(NumberOfKeyEvents, int);
00180
00181
00182
00183
00184
00185
00186 void AddKeySymEvent(vtkKWEventMap::KeySymEvent *me);
00187
00188 void AddKeySymEvent(const char *keySym, int modifier, const char *action);
00189 void AddKeySymEvent(const char *keySym, int modifier, const char *action,
00190 const char *context, const char *description);
00191
00192
00193
00194
00195 void SetKeySymEvent(const char *keySym, int modifier, const char *action);
00196 void SetKeySymEvent(const char *keySym, int modifier, const char *action,
00197 const char *context, const char *description);
00198
00199
00200
00201
00202 vtkKWEventMap::KeySymEvent* GetKeySymEvent(int index);
00203
00204
00205
00206
00207
00208 void RemoveKeySymEvent(const char *keySym, int modifier, const char *action = NULL);
00209 void RemoveAllKeySymEvents();
00210
00211
00212
00213
00214 const char* FindKeySymAction(const char *keySym, int modifier);
00215
00216
00217
00218 vtkGetMacro(NumberOfKeySymEvents, int);
00219
00220
00221
00222 void ShallowCopy(vtkKWEventMap *tprop);
00223
00224 protected:
00225 vtkKWEventMap();
00226 ~vtkKWEventMap();
00227
00228 MouseEvent *MouseEvents;
00229 KeyEvent *KeyEvents;
00230 KeySymEvent *KeySymEvents;
00231
00232 int NumberOfMouseEvents;
00233 int NumberOfKeyEvents;
00234 int NumberOfKeySymEvents;
00235
00236 private:
00237 vtkKWEventMap(const vtkKWEventMap&);
00238 void operator=(const vtkKWEventMap&);
00239 };
00240
00241 #endif
00242