]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondefault.h
Last checkin before major refactor...
[architektonas] / src / actions / rs_actiondefault.h
1 #ifndef RS_ACTIONSELECTWINDOW_H
2 #define RS_ACTIONSELECTWINDOW_H
3
4 #include "rs_previewactioninterface.h"
5 #include "vector.h"
6
7 /**
8  * This action class can handle user events to select all entities.
9  *
10  * @author Andrew Mustun
11  */
12 class RS_ActionDefault: public RS_PreviewActionInterface
13 {
14         //Q_OBJECT
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         Neutral, /**< we don't know what we do yet.  */
21                         Dragging, /**< dragging (either an entity or the
22                                              first part of a selection window) */
23                         SetCorner2, /**< Setting the 2nd corner of a selection window. */
24                         Moving, /**< Moving entities (drag'n'drop) */
25                         MovingRef /**< Moving a reference point of one or more selected
26                                              entities */
27                 };
28
29         public:
30                 RS_ActionDefault(RS_EntityContainer & container, GraphicView & graphicView);
31                 virtual ~RS_ActionDefault();
32
33                 static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/);
34
35                 virtual RS2::ActionType rtti()
36                 {
37                         return RS2::ActionDefault;
38                 }
39
40                 virtual void init(int status = 0);
41
42                 virtual void trigger();
43
44                 virtual void keyPressEvent(QKeyEvent * e);
45                 virtual void keyReleaseEvent(QKeyEvent * e);
46
47                 virtual void mouseMoveEvent(QMouseEvent * e);
48                 virtual void mousePressEvent(QMouseEvent * e);
49                 virtual void mouseReleaseEvent(QMouseEvent * e);
50
51                 virtual void commandEvent(RS_CommandEvent * e);
52                 virtual QStringList getAvailableCommands();
53
54                 virtual void updateMouseButtonHints();
55                 virtual void updateMouseCursor();
56                 virtual void updateToolBar();
57
58         protected:
59                 Vector v1;
60                 Vector v2;
61                 RS2::SnapRestriction restrBak;
62 };
63
64 #endif