-#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();
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();
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;
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;
/**
* Predecessor of this action or NULL.
*/
- RS_ActionInterface * predecessor;
+ ActionInterface * predecessor;
+
+ GraphicView * graphicView;
+ RS_EntityContainer * container;
};
-#endif
+#endif // __ACTIONINTERFACE_H__