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 public:
00032 static vtkKWEventMap *New();
00033 vtkTypeRevisionMacro(vtkKWEventMap, vtkObject);
00034 void PrintSelf(ostream& os, vtkIndent indent);
00035
00036
00037
00038
00039
00040
00041 enum
00042 {
00043 LeftButton = 0,
00044 MiddleButton = 1,
00045 RightButton = 2
00046 };
00047
00048 enum
00049 {
00050 NoModifier = 0,
00051 ShiftModifier = 1,
00052 ControlModifier = 2
00053 };
00054
00055
00056
00057
00058
00059 struct MouseEvent
00060 {
00061 int Button;
00062 int Modifier;
00063 char *Action;
00064 };
00065
00066
00067
00068 struct KeyEvent
00069 {
00070 char Key;
00071 int Modifier;
00072 char *Action;
00073 };
00074
00075
00076
00077 struct KeySymEvent
00078 {
00079 char *KeySym;
00080 int Modifier;
00081 char *Action;
00082 };
00083
00084
00085
00086
00087
00089
00091 void AddMouseEvent(struct MouseEvent *me);
00092
00093 void AddMouseEvent(int button, int modifier, const char *action);
00095
00097
00100 void SetMouseEvent(struct MouseEvent *me);
00101
00102 void SetMouseEvent(int button, int modifier, const char *action);
00104
00106
00107 struct MouseEvent* GetMouseEvent(int index);
00108
00110
00112
00114 void RemoveMouseEvent(struct MouseEvent *me);
00115
00116 void RemoveMouseEvent(int button, int modifier, const char *action = NULL);
00117 void RemoveAllMouseEvents();
00119
00122 const char* FindMouseAction(int button, int modifier);
00123
00125
00126 vtkGetMacro(NumberOfMouseEvents, int);
00128
00129
00130
00132
00134 void AddKeyEvent(struct KeyEvent *me);
00135
00136 void AddKeyEvent(char key, int modifier, const char *action);
00138
00141 void SetKeyEvent(char key, int modifier, const char *action);
00142
00144
00145 struct KeyEvent* GetKeyEvent(int index);
00146
00148
00150
00152 void RemoveKeyEvent(char key, int modifier, const char *action = NULL);
00153 void RemoveAllKeyEvents();
00155
00158 const char* FindKeyAction(char key, int modifier);
00159
00161
00162 vtkGetMacro(NumberOfKeyEvents, int);
00164
00165
00166
00168
00170 void AddKeySymEvent(struct KeySymEvent *me);
00171
00172 void AddKeySymEvent(const char *keySym, int modifier, const char *action);
00174
00177 void SetKeySymEvent(const char *keySym, int modifier, const char *action);
00178
00180
00181 struct KeySymEvent* GetKeySymEvent(int index);
00182
00184
00186
00188 void RemoveKeySymEvent(const char *keySym, int modifier, const char *action = NULL);
00189 void RemoveAllKeySymEvents();
00191
00194 const char* FindKeySymAction(const char *keySym, int modifier);
00195
00197
00198 vtkGetMacro(NumberOfKeySymEvents, int);
00200
00202 void ShallowCopy(vtkKWEventMap *tprop);
00203
00204 protected:
00205 vtkKWEventMap();
00206 ~vtkKWEventMap();
00207
00208 MouseEvent *MouseEvents;
00209 KeyEvent *KeyEvents;
00210 KeySymEvent *KeySymEvents;
00211
00212 int NumberOfMouseEvents;
00213 int NumberOfKeyEvents;
00214 int NumberOfKeySymEvents;
00215
00216 private:
00217 vtkKWEventMap(const vtkKWEventMap&);
00218 void operator=(const vtkKWEventMap&);
00219 };
00220
00221 #endif
00222