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