]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinerectangle.h
In the middle of major refactoring...
[architektonas] / src / actions / actiondrawlinerectangle.h
1 #ifndef __ACTIONDRAWLINERECTANGLE_H__
2 #define __ACTIONDRAWLINERECTANGLE_H__
3
4 #include "rs_line.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 /**
9  * This action class can handle user events to draw rectangles with two corners
10  * given.
11  *
12  * @author James Hammons
13  * @author Andrew Mustun
14  */
15 class ActionDrawLineRectangle: public ActionInterface
16 {
17         public:
18                 /**
19                  * Action States.
20                  */
21                 enum Status {
22                         SetCorner1,      /**< Setting the 1st corner.  */
23                         SetCorner2       /**< Setting the 2nd corner. */
24                 };
25
26         public:
27                 ActionDrawLineRectangle(RS_EntityContainer & container, GraphicView & graphicView);
28                 ~ActionDrawLineRectangle();
29
30                 void reset();
31                 virtual void init(int status = 0);
32                 virtual void trigger();
33                 virtual void mouseMoveEvent(QMouseEvent * e);
34                 virtual void mouseReleaseEvent(QMouseEvent * e);
35                 void preparePreview();
36                 virtual void coordinateEvent(Vector * e);
37                 virtual void commandEvent(RS_CommandEvent * e);
38                 virtual QStringList getAvailableCommands();
39                 virtual void updateMouseButtonHints();
40                 virtual void updateMouseCursor();
41                 virtual void updateToolBar();
42
43         protected:
44                 /**
45                  * Line data for the 4 lines.
46                  */
47                 RS_LineData data[4];
48                 /**
49                  * 1st corner.
50                  */
51                 Vector corner1;
52                 /**
53                  * 2nd corner.
54                  */
55                 Vector corner2;
56 };
57
58 #endif  // __ACTIONDRAWLINERECTANGLE_H__