]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionlibraryinsert.h
c64f8db3dabd833ec89fb06e48fa1b8e61730866
[architektonas] / src / actions / rs_actionlibraryinsert.h
1 #ifndef RS_ACTIONLIBRARYINSERT_H
2 #define RS_ACTIONLIBRARYINSERT_H
3
4 #include "rs_creation.h"
5 #include "drawing.h"
6 #include "rs_previewactioninterface.h"
7
8 /**
9  * This action class can handle user events for inserting library items
10  * (or any other DXF files) into the current drawing (as block/insert).
11  *
12  * @author Andrew Mustun
13  */
14 class RS_ActionLibraryInsert: public RS_PreviewActionInterface
15 {
16         public:
17                 /**
18                  * Action States.
19                  */
20                 enum Status {
21                         SetTargetPoint,    /**< Setting the reference point. */
22                         SetAngle,          /**< Setting angle in the command line. */
23                         SetFactor          /**< Setting factor in the command line. */
24                         //SetColumns,        /**< Setting columns in the command line. */
25                         //SetRows,           /**< Setting rows in the command line. */
26                         //SetColumnSpacing,  /**< Setting column spacing in the command line. */
27                         //SetRowSpacing      /**< Setting row spacing in the command line. */
28                 };
29
30         public:
31                 RS_ActionLibraryInsert(RS_EntityContainer & container, RS_GraphicView & graphicView);
32                 virtual ~RS_ActionLibraryInsert();
33
34                 virtual RS2::ActionType rtti();
35                 virtual void init(int status = 0);
36                 void reset();
37                 virtual void trigger();
38                 virtual void mouseMoveEvent(QMouseEvent * e);
39                 virtual void mouseReleaseEvent(QMouseEvent * e);
40                 virtual void coordinateEvent(Vector * e);
41                 virtual void commandEvent(RS_CommandEvent * e);
42                 virtual QStringList getAvailableCommands();
43                 virtual void showOptions();
44                 virtual void hideOptions();
45                 virtual void updateMouseButtonHints();
46                 virtual void updateMouseCursor();
47                 virtual void updateToolBar();
48                 void setFile(const QString & file);
49                 double getAngle();
50                 void setAngle(double a);
51                 double getFactor();
52                 void setFactor(double f);
53
54         protected:
55                 Drawing prev;
56                 RS_LibraryInsertData data;
57
58                 /** Last status before entering option. */
59                 Status lastStatus;
60 };
61
62 #endif