]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionblocksinsert.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actionblocksinsert.h
1 #ifndef RS_ACTIONBLOCKSINSERT_H
2 #define RS_ACTIONBLOCKSINSERT_H
3
4 #include "rs_previewactioninterface.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 Andrew Mustun
12  */
13 class RS_ActionBlocksInsert: public RS_PreviewActionInterface
14 {
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         SetTargetPoint,    /**< Setting the reference point. */
21                         SetAngle,          /**< Setting angle in the command line. */
22                         SetFactor,         /**< Setting factor in the command line. */
23                         SetColumns,        /**< Setting columns in the command line. */
24                         SetRows,           /**< Setting rows in the command line. */
25                         SetColumnSpacing,  /**< Setting column spacing in the command line. */
26                         SetRowSpacing      /**< Setting row spacing in the command line. */
27                 };
28
29         public:
30                 RS_ActionBlocksInsert(RS_EntityContainer & container, RS_GraphicView & graphicView);
31                 ~RS_ActionBlocksInsert();
32
33                 virtual RS2::ActionType rtti();
34                 virtual void init(int status = 0);
35                 void reset();
36                 virtual void trigger();
37                 virtual void mouseMoveEvent(QMouseEvent * e);
38                 virtual void mouseReleaseEvent(QMouseEvent * e);
39                 virtual void coordinateEvent(Vector * e);
40                 virtual void commandEvent(RS_CommandEvent * e);
41                 virtual QStringList getAvailableCommands();
42                 virtual void showOptions();
43                 virtual void hideOptions();
44                 virtual void updateMouseButtonHints();
45                 virtual void updateMouseCursor();
46                 virtual void updateToolBar();
47
48                 double getAngle();
49                 void setAngle(double a);
50                 double getFactor();
51                 void setFactor(double f);
52                 int getColumns();
53                 void setColumns(int c);
54                 int getRows();
55                 void setRows(int r);
56                 double getColumnSpacing();
57                 void setColumnSpacing(double cs);
58                 double getRowSpacing();
59                 void setRowSpacing(double rs);
60
61         protected:
62                 RS_Block * block;
63                 RS_InsertData data;
64
65                 /** Last status before entering option. */
66                 Status lastStatus;
67 };
68
69 #endif