]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_actioninterface.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / base / rs_actioninterface.h
index ed76836ee94700b1f8ab85ef959443f4cf22e073..8b16095d98e57255722a06c4c6a6a7d0ab15d4ec 100644 (file)
@@ -1,26 +1,15 @@
 #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 RS_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???
        public:
                RS_ActionInterface(const char * name, RS_EntityContainer & container,
                        RS_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(RS_CoordinateEvent *);
+               virtual void coordinateEvent(Vector *);
                virtual void commandEvent(RS_CommandEvent *);
                virtual QStringList getAvailableCommands();
                virtual void setStatus(int status);
@@ -75,14 +63,14 @@ class RS_ActionInterface: public QObject, public RS_Snapper
 
        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:
@@ -90,53 +78,26 @@ class RS_ActionInterface: public QObject, public RS_Snapper
                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