1 #ifndef RS_EVENTHANDLER_H
2 #define RS_EVENTHANDLER_H
4 #include "rs_actioninterface.h"
6 #define RS_MAXACTIONS 16
8 class RS_ActionInterface;
11 * The event handler owns and manages all actions that are currently
12 * active. All events going from the view to the actions come over
18 RS_EventHandler(RS_GraphicView * graphicView);
24 void mousePressEvent(QMouseEvent * e);
25 void mouseReleaseEvent(QMouseEvent * e);
26 void mouseMoveEvent(QMouseEvent * e);
27 void mouseLeaveEvent();
28 void mouseEnterEvent();
30 void keyPressEvent(QKeyEvent * e);
31 void keyReleaseEvent(QKeyEvent * e);
33 void commandEvent(RS_CommandEvent * e);
34 void enableCoordinateInput();
35 void disableCoordinateInput();
37 void setDefaultAction(RS_ActionInterface * action);
38 RS_ActionInterface * getDefaultAction();
40 void setCurrentAction(RS_ActionInterface * action);
41 RS_ActionInterface * getCurrentAction();
43 void killSelectActions();
44 void killAllActions();
49 void setSnapMode(RS2::SnapMode sm);
50 void setSnapRestriction(RS2::SnapRestriction sr);
53 RS_GraphicView * graphicView;
54 RS_ActionInterface * defaultAction;
55 RS_ActionInterface * currentActions[RS_MAXACTIONS];
57 bool coordinateInputEnabled;