]> Shamusworld >> Repos - architektonas/blob - src/base/eventhandler.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / eventhandler.h
1 #ifndef __EVENTHANDLER_H__
2 #define __EVENTHANDLER_H__
3
4 #include <QtGui>
5
6 #define RS_MAXACTIONS 16
7
8 class ActionInterface;
9 class CommandEvent;
10 class GraphicView;
11
12 /**
13  * The event handler owns and manages all actions that are currently
14  * active. All events going from the view to the actions come over
15  * this class.
16  */
17 class EventHandler
18 {
19         public:
20                 EventHandler();
21                 ~EventHandler();
22
23                 void Back();
24                 void Enter();
25                 void MousePressEvent(QMouseEvent * e);
26                 void MouseReleaseEvent(QMouseEvent * e);
27                 void MouseMoveEvent(QMouseEvent * e);
28                 void MouseLeaveEvent();
29                 void MouseEnterEvent();
30                 void KeyPressEvent(QKeyEvent * e);
31                 void KeyReleaseEvent(QKeyEvent * e);
32                 void HandleCommandEvent(GraphicView *, CommandEvent * e);
33                 void EnableCoordinateInput();
34                 void DisableCoordinateInput();
35                 void SetDefaultAction(ActionInterface * action);
36                 ActionInterface * GetDefaultAction();
37                 void SetCurrentAction(ActionInterface * action);
38                 ActionInterface * GetCurrentAction();
39                 void KillSelectActions();
40                 void KillAllActions();
41                 bool HasAction();
42                 void CleanUp();
43                 void DebugActions();
44
45         protected:
46                 ActionInterface * defaultAction;
47                 ActionInterface * currentActions[RS_MAXACTIONS];
48                 int actionIndex;
49                 bool coordinateInputEnabled;
50 };
51
52 #endif  // __EVENTHANDLER_H__