]> Shamusworld >> Repos - architektonas/blob - src/actions/actionblocksinsert.h
Last checkin before major refactor...
[architektonas] / src / actions / actionblocksinsert.h
1 #ifndef __ACTIONBLOCKSINSERT_H__
2 #define __ACTIONBLOCKSINSERT_H__
3
4 #include "actioninterface.h"
5 #include "rs_insert.h"
6
7 /**
8  * This action class can handle user events for inserting blocks into the
9  * current drawing.
10  *
11  * @author James Hammons
12  * @author Andrew Mustun
13  */
14 class ActionBlocksInsert: public ActionInterface
15 {
16         public:
17                 /**
18                  * Action States.
19                  */
20                 enum Status {
21                         SetTargetPoint,    /**< Setting the reference point. */
22                         SetAngle,          /**< Setting angle in the command line. */
23                         SetFactor,         /**< Setting factor in the command line. */
24                         SetColumns,        /**< Setting columns in the command line. */
25                         SetRows,           /**< Setting rows in the command line. */
26                         SetColumnSpacing,  /**< Setting column spacing in the command line. */
27                         SetRowSpacing      /**< Setting row spacing in the command line. */
28                 };
29
30         public:
31                 ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView);
32                 ~ActionBlocksInsert();
33
34                 virtual RS2::ActionType rtti();
35                 virtual void init(int status = 0);
36                 void reset();
37                 virtual void trigger();
38                 virtual void mouseMoveEvent(QMouseEvent * e);
39                 virtual void mouseReleaseEvent(QMouseEvent * e);
40                 virtual void coordinateEvent(Vector * e);
41                 virtual void commandEvent(RS_CommandEvent * e);
42                 virtual QStringList getAvailableCommands();
43                 virtual void showOptions();
44                 virtual void hideOptions();
45                 virtual void updateMouseButtonHints();
46                 virtual void updateMouseCursor();
47                 virtual void updateToolBar();
48
49                 double getAngle();
50                 void setAngle(double a);
51                 double getFactor();
52                 void setFactor(double f);
53                 int getColumns();
54                 void setColumns(int c);
55                 int getRows();
56                 void setRows(int r);
57                 double getColumnSpacing();
58                 void setColumnSpacing(double cs);
59                 double getRowSpacing();
60                 void setRowSpacing(double rs);
61
62         protected:
63                 RS_Block * block;
64                 RS_InsertData data;
65
66                 /** Last status before entering option. */
67                 Status lastStatus;
68 };
69
70 #endif  // __ACTIONBLOCKSINSERT_H__