]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondefault.h
GPL compliance check...
[architektonas] / src / actions / actiondefault.h
1 #ifndef __ACTIONDEFAULT_H__
2 #define __ACTIONDEFAULT_H__
3
4 #include "actioninterface.h"
5 #include "vector.h"
6
7 /**
8  * This action class can handle user events to select all entities.
9  *
10  * @author James Hammons
11  * @author Andrew Mustun
12  */
13 class ActionDefault: public ActionInterface
14 {
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                 ActionDefault(RS_EntityContainer & container, GraphicView & graphicView);
31                 virtual ~ActionDefault();
32
33                 virtual RS2::ActionType rtti();
34                 virtual void init(int status = 0);
35                 virtual void trigger();
36                 virtual void keyPressEvent(QKeyEvent * e);
37                 virtual void keyReleaseEvent(QKeyEvent * e);
38                 virtual void mouseMoveEvent(QMouseEvent * e);
39                 virtual void mousePressEvent(QMouseEvent * e);
40                 virtual void mouseReleaseEvent(QMouseEvent * e);
41                 virtual void commandEvent(RS_CommandEvent * e);
42                 virtual QStringList getAvailableCommands();
43                 virtual void updateMouseButtonHints();
44                 virtual void updateMouseCursor();
45                 virtual void updateToolBar();
46
47         protected:
48                 Vector v1;
49                 Vector v2;
50                 RS2::SnapRestriction restrBak;
51 };
52
53 #endif  // __ACTIONDEFAULT_H__