]> Shamusworld >> Repos - architektonas/blobdiff - src/base/actioninterface.h
In the middle of major refactoring...
[architektonas] / src / base / actioninterface.h
similarity index 51%
rename from src/base/rs_actioninterface.h
rename to src/base/actioninterface.h
index d9fd82881520157fd681e5811fbbd4ea68979290..7647b20438c9c1fe1fab76ce2c5eb2fcf9330d9d 100644 (file)
@@ -1,36 +1,36 @@
-#ifndef RS_ACTIONINTERFACE_H
-#define RS_ACTIONINTERFACE_H
+#ifndef __ACTIONINTERFACE_H__
+#define __ACTIONINTERFACE_H__
 
 #include <QtGui>
-#include "rs_snapper.h"
+#include "rs.h"
 
 class RS_CommandEvent;
 class RS_Document;
 class Drawing;
+class RS_Entity;
 class RS_EntityContainer;
 class GraphicView;
 class Vector;
 
 /**
- * This is the interface that must be implemented for all
- * action classes. Action classes handle actions such
- * as drawing lines, moving entities or zooming in.
+ * This is the interface that must be implemented for all action classes.
+ * Action classes handle actions such as drawing lines, moving entities or
+ * zooming in.
  *
  * Inherited from QObject for Qt translation features.
  *
+ * @author James Hammons
  * @author Andrew Mustun
  */
-class RS_ActionInterface: public QObject, public RS_Snapper
+class ActionInterface: public QObject
 {
-//huh? no slots/signals here...    Q_OBJECT
-//WHY derive from QObject???
-//for the TR macro???
+//WHY derive from QObject??? for the TR macro???
 //mebbe... Well, that's what he says above. Though it would be just as easy to
 //prefix a QObject::tr in front of translated strings...
        public:
-               RS_ActionInterface(const char * name, RS_EntityContainer & container,
-                       GraphicView & graphicView);
-               virtual ~RS_ActionInterface();
+               ActionInterface(const char * name, RS_EntityContainer &,
+                       GraphicView &);
+               virtual ~ActionInterface();
 
                virtual RS2::ActionType rtti();
                QString getName();
@@ -52,7 +52,7 @@ class RS_ActionInterface: public QObject, public RS_Snapper
                virtual bool isFinished();
                virtual void setFinished();
                virtual void finish();
-               virtual void setPredecessor(RS_ActionInterface * pre);
+               virtual void setPredecessor(ActionInterface *);
                virtual void suspend();
                virtual void resume();
                virtual void hideOptions();
@@ -61,16 +61,24 @@ class RS_ActionInterface: public QObject, public RS_Snapper
                        RS2::ActionType action = RS2::ActionNone);
                QString command(const QString & cmd);
                QString msgAvailableCommands();
+               //built-in for now, we'll see how it goes...
+               Vector snapPoint(QMouseEvent *);
+               RS_Entity * catchEntity(QMouseEvent *, RS2::ResolveLevel level = RS2::ResolveNone);
+               RS_Entity * catchEntity(Vector, RS2::ResolveLevel level = RS2::ResolveNone);
+#warning "!!! The following functions are DEPRECATED and only in place to help with porting.. !!!"
+               void drawSnapper(void);
+               void deleteSnapper(void);
+               void drawPreview(void);
+               void clearPreview(void);
+               void deletePreview(void);
 
        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;
 
@@ -79,14 +87,12 @@ 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;
 
@@ -98,7 +104,10 @@ class RS_ActionInterface: public QObject, public RS_Snapper
                /**
                 * Predecessor of this action or NULL.
                 */
-               RS_ActionInterface * predecessor;
+               ActionInterface * predecessor;
+
+               GraphicView * graphicView;
+               RS_EntityContainer * container;
 };
 
-#endif
+#endif // __ACTIONINTERFACE_H__