]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinerectangle.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlinerectangle.h
1 #ifndef __ACTIONDRAWLINERECTANGLE_H__
2 #define __ACTIONDRAWLINERECTANGLE_H__
3
4 #include "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(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(CommandEvent * e);
38                 virtual QStringList getAvailableCommands();
39                 virtual void updateMouseButtonHints();
40                 virtual void updateMouseCursor();
41                 virtual void updateToolBar();
42
43         protected:
44                 /** Line data for the 4 lines. */
45                 LineData data[4];
46                 /** 1st corner. */
47                 Vector corner1;
48                 /** 2nd corner. */
49                 Vector corner2;
50 };
51
52 #endif  // __ACTIONDRAWLINERECTANGLE_H__