]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawtext.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawtext.h
1 #ifndef __ACTIONDRAWTEXT_H__
2 #define __ACTIONDRAWTEXT_H__
3
4 #include "actioninterface.h"
5 #include "text.h"
6
7 /**
8  * This action class can handle user events to draw texts.
9  *
10  * @author James Hammons
11  * @author Andrew Mustun
12  */
13 class ActionDrawText: public ActionInterface
14 {
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         ShowDialog,           /**< Showing the text dialog. */
21                         SetPos,               /**< Setting the position. */
22                         SetText               /**< Settting the text in the command line. */
23                 };
24
25         public:
26                 ActionDrawText(EntityContainer & container, GraphicView & graphicView);
27                 ~ActionDrawText();
28
29                 virtual RS2::ActionType rtti();
30                 virtual void init(int status = 0);
31                 void reset();
32                 virtual void trigger();
33                 void preparePreview();
34                 virtual void mouseMoveEvent(QMouseEvent * e);
35                 virtual void mouseReleaseEvent(QMouseEvent * e);
36                 virtual void coordinateEvent(Vector * e);
37                 virtual void commandEvent(CommandEvent * e);
38                 virtual QStringList getAvailableCommands();
39                 virtual void hideOptions();
40                 virtual void showOptions();
41                 virtual void updateMouseButtonHints();
42                 virtual void updateMouseCursor();
43                 virtual void updateToolBar();
44                 void setText(const QString & t);
45                 QString getText();
46                 void setAngle(double a);
47                 double getAngle();
48
49         private:
50                 TextData data;
51                 Vector pos;
52                 bool textChanged;
53 };
54
55 #endif  // __ACTIONDRAWTEXT_H__