#define __EVENTHANDLER_H__
#include <QtGui>
-#include "rs.h"
#define RS_MAXACTIONS 16
class ActionInterface;
-class RS_CommandEvent;
+class CommandEvent;
class GraphicView;
/**
* active. All events going from the view to the actions come over
* this class.
*/
-class RS_EventHandler
+class EventHandler
{
public:
- RS_EventHandler(GraphicView * graphicView);
- ~RS_EventHandler();
+ EventHandler();
+ ~EventHandler();
- void back();
- void enter();
- void mousePressEvent(QMouseEvent * e);
- void mouseReleaseEvent(QMouseEvent * e);
- void mouseMoveEvent(QMouseEvent * e);
- void mouseLeaveEvent();
- void mouseEnterEvent();
- void keyPressEvent(QKeyEvent * e);
- void keyReleaseEvent(QKeyEvent * e);
- void commandEvent(RS_CommandEvent * e);
- void enableCoordinateInput();
- void disableCoordinateInput();
- void setDefaultAction(ActionInterface * action);
- ActionInterface * getDefaultAction();
- void setCurrentAction(ActionInterface * action);
- ActionInterface * getCurrentAction();
- void killSelectActions();
- void killAllActions();
- bool hasAction();
- void cleanUp();
- void debugActions();
- void setSnapMode(RS2::SnapMode sm);
- void setSnapRestriction(RS2::SnapRestriction sr);
+ void Back();
+ void Enter();
+ void MousePressEvent(QMouseEvent * e);
+ void MouseReleaseEvent(QMouseEvent * e);
+ void MouseMoveEvent(QMouseEvent * e);
+ void MouseLeaveEvent();
+ void MouseEnterEvent();
+ void KeyPressEvent(QKeyEvent * e);
+ void KeyReleaseEvent(QKeyEvent * e);
+ void HandleCommandEvent(GraphicView *, CommandEvent * e);
+ void EnableCoordinateInput();
+ void DisableCoordinateInput();
+ void SetDefaultAction(ActionInterface * action);
+ ActionInterface * GetDefaultAction();
+ void SetCurrentAction(ActionInterface * action);
+ ActionInterface * GetCurrentAction();
+ void KillSelectActions();
+ void KillAllActions();
+ bool HasAction();
+ void CleanUp();
+ void DebugActions();
protected:
- GraphicView * graphicView;
ActionInterface * defaultAction;
ActionInterface * currentActions[RS_MAXACTIONS];
int actionIndex;