]> Shamusworld >> Repos - architektonas/blob - src/widgets/actionhandler.h
Bugfixes related to removing Snapper class.
[architektonas] / src / widgets / actionhandler.h
1 #ifndef __ACTIONHANDLER_H__
2 #define __ACTIONHANDLER_H__
3
4 #include <QtGui>
5 #include "enums.h"
6
7 class QG_MainWindowInterface;
8 class CadToolBarSnap;
9 class ActionInterface;
10
11 /**
12  * This class can trigger actions (from menus, buttons, ...).
13  */
14 class ActionHandler: public QObject
15 {
16         Q_OBJECT
17
18         public:
19                 ActionHandler(QG_MainWindowInterface * mw);
20                 virtual ~ActionHandler();
21
22                 ActionInterface * getCurrentAction();
23                 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(CadToolBarSnap * tb);
209
210         private:
211                 QG_MainWindowInterface * mainWindow;
212                 CadToolBarSnap * cadToolBarSnap;
213
214                 QAction * snapFree;
215                 QAction * snapGrid;
216                 QAction * snapEndpoint;
217                 QAction * snapOnEntity;
218                 QAction * snapCenter;
219                 QAction * snapMiddle;
220                 QAction * snapDist;
221                 QAction * snapIntersection;
222                 QAction * snapIntersectionManual;
223
224                 QAction * restrictNothing;
225                 QAction * restrictOrthogonal;
226                 QAction * restrictHorizontal;
227                 QAction * restrictVertical;
228
229                 QAction * lockRelativeZero;
230 };
231
232 #endif  // __ACTIONHANDLER_H__