#ifndef RS_ACTIONINTERFACE_H
#define RS_ACTIONINTERFACE_H
-#include <QtCore>
-
-#include "rs_entitycontainer.h"
-#include "rs_commandevent.h"
-//#include "rs_event.h"
-#include "drawing.h"
-#include "rs_graphicview.h"
+#include <QtGui>
#include "rs_snapper.h"
-#include "rs_preview.h"
-#include "rs_dialogfactory.h"
-
-#ifndef RS_NO_QCADCMD
-#include "commands.h"
-#endif
-//template<class T> T* instantiate(RS_EntityContainer& container, RS_GraphicView& graphicView) {
-// return new T(container, graphicView);
- //void (*function)() = T::instantiate;
- //return (*function)();
-//}
+class RS_CommandEvent;
+class RS_Document;
+class Drawing;
+class RS_EntityContainer;
+class GraphicView;
+class Vector;
/**
* This is the interface that must be implemented for all
class RS_ActionInterface: public QObject, public RS_Snapper
{
//huh? no slots/signals here... Q_OBJECT
-
+//WHY derive from QObject???
+//for the TR macro???
+//mebbe...
public:
RS_ActionInterface(const char * name, RS_EntityContainer & container,
- RS_GraphicView & graphicView);
+ GraphicView & graphicView);
virtual ~RS_ActionInterface();
virtual RS2::ActionType rtti();
-
QString getName();
-
virtual void init(int status = 0);
virtual void mouseMoveEvent(QMouseEvent *);
virtual void mousePressEvent(QMouseEvent *);
-
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void keyPressEvent(QKeyEvent * e);
virtual void keyReleaseEvent(QKeyEvent * e);
- virtual void coordinateEvent(RS_CoordinateEvent *);
+ virtual void coordinateEvent(Vector *);
virtual void commandEvent(RS_CommandEvent *);
virtual QStringList getAvailableCommands();
virtual void setStatus(int status);
private:
/**
- * Current status of the action. After an action has
- * been created the action status is set to 0. Actions
- * that are terminated have a status of -1. Other status
- * numbers can be used to describe the stage this action
- * is in. E.g. a window zoom consists of selecting the
- * first corner (status 0), and selecting the second
- * corner (status 1).
- */
+ * Current status of the action. After an action has
+ * been created the action status is set to 0. Actions
+ * that are terminated have a status of -1. Other status
+ * numbers can be used to describe the stage this action
+ * is in. E.g. a window zoom consists of selecting the
+ * first corner (status 0), and selecting the second
+ * corner (status 1).
+ */
int status;
protected:
QString name;
/**
- * This flag is set when the action has terminated and
- * can be deleted.
- */
+ * This flag is set when the action has terminated and
+ * can be deleted.
+ */
bool finished;
/**
- * Pointer to the graphic is this container is a graphic.
- * NULL otherwise
- */
+ * Pointer to the graphic is this container is a graphic.
+ * NULL otherwise
+ */
Drawing * graphic;
/**
- * Pointer to the document (graphic or block) or NULL.
- */
+ * Pointer to the document (graphic or block) or NULL.
+ */
RS_Document * document;
/**
- * Pointer to the default mouse cursor for this action or NULL.
- */
- //RS2::CursorType cursor;
-
- /**
- * Predecessor of this action or NULL.
- */
+ * Predecessor of this action or NULL.
+ */
RS_ActionInterface * predecessor;
-
- /**
- * String prepended to the help text for currently available commands.
- */
- //static QString msgAvailableCommands;
-
- /**
- * Command used for showing help for every action.
- */
- //static QString cmdHelp;
-
- /**
- * Command for answering yes to a question.
- */
- //static QString cmdYes;
- //static QString cmdYes2;
-
- /**
- * Command for answering no to a question.
- */
- //static QString cmdNo;
- //static QString cmdNo2;
};
#endif