]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionselectwindow.h
7a38550f1873f87545db97aaf3160e56fca7371a
[architektonas] / src / actions / rs_actionselectwindow.h
1 #ifndef RS_ACTIONSELECTWINDOW_H
2 #define RS_ACTIONSELECTWINDOW_H
3
4 #include "rs_previewactioninterface.h"
5 #include "vector.h"
6
7
8 /**
9  * This action class can handle user events to select all entities.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionSelectWindow : public RS_PreviewActionInterface {
14         //Q_OBJECT
15 public:
16     /**
17      * Action States.
18      */
19     enum Status {
20         SetCorner1,     /**< Setting the 1st corner of the window.  */
21         SetCorner2      /**< Setting the 2nd corner of the window. */
22     };
23
24 public:
25     RS_ActionSelectWindow(RS_EntityContainer& container,
26                          RS_GraphicView& graphicView,
27                          bool select);
28     ~RS_ActionSelectWindow() {}
29
30         static QAction* createGUIAction(RS2::ActionType type, QObject* /*parent*/);
31
32         virtual RS2::ActionType rtti() {
33                 return RS2::ActionSelectWindow;
34         }
35
36     virtual void init(int status=0);
37
38     virtual void trigger();
39
40     virtual void mouseMoveEvent(QMouseEvent* e);
41     virtual void mousePressEvent(QMouseEvent* e);
42     virtual void mouseReleaseEvent(QMouseEvent* e);
43
44     virtual void updateMouseButtonHints();
45     virtual void updateMouseCursor();
46     virtual void updateToolBar();
47
48 protected:
49     Vector v1;
50     Vector v2;
51
52     bool select;
53 };
54
55 #endif