1 #ifndef RS_EVENTHANDLER_H
2 #define RS_EVENTHANDLER_H
4 #include "rs_actioninterface.h"
6 #define RS_MAXACTIONS 16
8 class RS_ActionInterface;
12 * The event handler owns and manages all actions that are currently
13 * active. All events going from the view to the actions come over
19 RS_EventHandler(GraphicView * graphicView);
25 void mousePressEvent(QMouseEvent * e);
26 void mouseReleaseEvent(QMouseEvent * e);
27 void mouseMoveEvent(QMouseEvent * e);
28 void mouseLeaveEvent();
29 void mouseEnterEvent();
31 void keyPressEvent(QKeyEvent * e);
32 void keyReleaseEvent(QKeyEvent * e);
34 void commandEvent(RS_CommandEvent * e);
35 void enableCoordinateInput();
36 void disableCoordinateInput();
38 void setDefaultAction(RS_ActionInterface * action);
39 RS_ActionInterface * getDefaultAction();
41 void setCurrentAction(RS_ActionInterface * action);
42 RS_ActionInterface * getCurrentAction();
44 void killSelectActions();
45 void killAllActions();
50 void setSnapMode(RS2::SnapMode sm);
51 void setSnapRestriction(RS2::SnapRestriction sr);
54 GraphicView * graphicView;
55 RS_ActionInterface * defaultAction;
56 RS_ActionInterface * currentActions[RS_MAXACTIONS];
58 bool coordinateInputEnabled;