]> Shamusworld >> Repos - architektonas/blob - src/widgets/qg_actionhandler.h
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / widgets / qg_actionhandler.h
1 #ifndef QG_ACTIONHANDLER_H
2 #define QG_ACTIONHANDLER_H
3
4 #include <QtGui>
5 #include "rs.h"
6
7 class QG_MainWindowInterface;
8 class CadToolBarSnap;
9 class RS_ActionInterface;
10
11 /**
12  * This class can trigger actions (from menus, buttons, ...).
13  */
14 class QG_ActionHandler: public QObject
15 {
16         Q_OBJECT
17
18         public:
19                 QG_ActionHandler(QG_MainWindowInterface * mw);
20                 virtual ~QG_ActionHandler();
21
22                 RS_ActionInterface * getCurrentAction();
23                 RS_ActionInterface * setCurrentAction(RS2::ActionType id);
24                 void killSelectActions();
25
26                 bool keycode(const QString & code);
27                 bool command(const QString & cmd);
28                 QStringList getAvailableCommands();
29
30         public slots:
31                 /*void slotFileNew();*/
32                 void slotFileOpen();
33                 /*
34                         void slotFileOpen(const QString& fileName);
35                         void slotFileSave();
36                 */
37                 void slotFileSaveAs();
38                 /*
39                         void slotFileClose();
40                         void slotFilePrint();
41                 */
42
43                 void slotZoomIn();
44                 void slotZoomOut();
45                 void slotZoomAuto();
46                 void slotZoomWindow();
47                 void slotZoomPan();
48                 void slotZoomPrevious();
49                 void slotZoomRedraw();
50
51                 void slotToolRegenerateDimensions();
52
53                 void slotEditUndo();
54                 void slotEditRedo();
55                 void slotEditCut();
56                 void slotEditCopy();
57                 void slotEditPaste();
58
59                 void slotSelectSingle();
60                 void slotSelectContour();
61                 void slotSelectWindow();
62                 void slotDeselectWindow();
63                 void slotSelectAll();
64                 void slotDeselectAll();
65                 void slotSelectInvert();
66                 void slotSelectIntersected();
67                 void slotDeselectIntersected();
68                 void slotSelectLayer();
69
70                 void slotDrawPoint();
71                 void slotDrawLine();
72                 void slotDrawLineAngle();
73                 void slotDrawLineHorizontal();
74                 void slotDrawLineVertical();
75                 void slotDrawLineFree();
76                 void slotDrawLineHorVert();
77                 void slotDrawLineParallel();
78                 void slotDrawLineParallelThrough();
79                 void slotDrawLineRectangle();
80                 void slotDrawLineBisector();
81                 void slotDrawLineTangent1();
82                 void slotDrawLineTangent2();
83                 void slotDrawLineOrthogonal();
84                 void slotDrawLineRelAngle();
85                 void slotDrawLinePolygon();
86                 void slotDrawLinePolygon2();
87                 void slotDrawCircle();
88                 void slotDrawCircleCR();
89                 void slotDrawCircle2P();
90                 void slotDrawCircle3P();
91                 void slotDrawCircleParallel();
92                 void slotDrawArc();
93                 void slotDrawArc3P();
94                 void slotDrawArcParallel();
95                 void slotDrawArcTangential();
96                 void slotDrawEllipseAxis();
97                 void slotDrawEllipseArcAxis();
98                 void slotDrawSpline();
99                 void slotDrawText();
100                 void slotDrawHatch();
101                 void slotDrawImage();
102                 void slotDrawPolyline();
103                 void slotPolylineAdd();
104                 void slotPolylineAppend();
105                 void slotPolylineDel();
106                 void slotPolylineDelBetween();
107                 void slotPolylineTrim();
108
109                 void slotDimAligned();
110                 void slotDimLinear();
111                 void slotDimLinearHor();
112                 void slotDimLinearVer();
113                 void slotDimRadial();
114                 void slotDimDiametric();
115                 void slotDimAngular();
116                 void slotDimLeader();
117
118                 void slotModifyAttributes();
119                 void slotModifyDelete();
120                 void slotModifyDeleteQuick();
121                 void slotModifyDeleteFree();
122                 void slotModifyMove();
123                 void slotModifyScale();
124                 void slotModifyRotate();
125                 void slotModifyMirror();
126                 void slotModifyMoveRotate();
127                 void slotModifyRotate2();
128                 void slotModifyEntity();
129                 void slotModifyTrim();
130                 void slotModifyTrim2();
131                 void slotModifyTrimAmount();
132                 void slotModifyCut();
133                 void slotModifyStretch();
134                 void slotModifyBevel();
135                 void slotModifyRound();
136                 void slotModifyExplodeText();
137
138                 void slotSnapFree();
139                 void slotSnapGrid();
140                 void slotSnapEndpoint();
141                 void slotSnapOnEntity();
142                 void slotSnapCenter();
143                 void slotSnapMiddle();
144                 void slotSnapDist();
145                 void slotSnapIntersection();
146                 void slotSnapIntersectionManual();
147
148                 void slotRestrictNothing();
149                 void slotRestrictOrthogonal();
150                 void slotRestrictHorizontal();
151                 void slotRestrictVertical();
152
153                 void disableSnaps();
154                 void disableRestrictions();
155                 void updateSnapMode();
156
157                 void slotSetRelativeZero();
158                 void slotLockRelativeZero(bool on);
159
160                 void slotInfoInside();
161                 void slotInfoDist();
162                 void slotInfoDist2();
163                 void slotInfoAngle();
164                 void slotInfoTotalLength();
165                 void slotInfoArea();
166
167                 void slotLayersDefreezeAll();
168                 void slotLayersFreezeAll();
169                 void slotLayersAdd();
170                 void slotLayersRemove();
171                 void slotLayersEdit();
172                 void slotLayersToggleView();
173                 void slotLayersToggleLock();
174
175                 void slotBlocksDefreezeAll();
176                 void slotBlocksFreezeAll();
177                 void slotBlocksAdd();
178                 void slotBlocksRemove();
179                 void slotBlocksAttributes();
180                 void slotBlocksEdit();
181                 void slotBlocksInsert();
182                 void slotBlocksToggleView();
183                 void slotBlocksCreate();
184                 void slotBlocksExplode();
185
186                 void slotOptionsDrawing();
187
188                 void slotCamExportAuto();
189                 void slotCamReorder();
190
191                 void slotFocusNormal();
192
193                 void setActionSnapFree(QAction * a);
194                 void setActionSnapGrid(QAction * a);
195                 void setActionSnapEndpoint(QAction * a);
196                 void setActionSnapOnEntity(QAction * a);
197                 void setActionSnapCenter(QAction * a);
198                 void setActionSnapMiddle(QAction * a);
199                 void setActionSnapDist(QAction * a);
200                 void setActionSnapIntersection(QAction * a);
201                 void setActionSnapIntersectionManual(QAction * a);
202                 void setActionRestrictNothing(QAction * a);
203                 void setActionRestrictOrthogonal(QAction * a);
204                 void setActionRestrictHorizontal(QAction * a);
205                 void setActionRestrictVertical(QAction * a);
206                 void setActionLockRelativeZero(QAction * a);
207
208 //              void setCadToolBarSnap(QG_CadToolBarSnap * tb);
209                 void setCadToolBarSnap(CadToolBarSnap * tb);
210
211         private:
212                 QG_MainWindowInterface * mainWindow;
213                 CadToolBarSnap * cadToolBarSnap;
214
215                 QAction * snapFree;
216                 QAction * snapGrid;
217                 QAction * snapEndpoint;
218                 QAction * snapOnEntity;
219                 QAction * snapCenter;
220                 QAction * snapMiddle;
221                 QAction * snapDist;
222                 QAction * snapIntersection;
223                 QAction * snapIntersectionManual;
224
225                 QAction * restrictNothing;
226                 QAction * restrictOrthogonal;
227                 QAction * restrictHorizontal;
228                 QAction * restrictVertical;
229
230                 QAction * lockRelativeZero;
231 };
232
233 #endif