]> Shamusworld >> Repos - architektonas/blob - src/widgets/qg_dialogfactory.h
Bugfixes related to removing Snapper class.
[architektonas] / src / widgets / qg_dialogfactory.h
1 #ifndef QG_DIALOGFACTORY_H
2 #define QG_DIALOGFACTORY_H
3
4 #include <QtGui>
5 #include "dialogfactoryinterface.h"
6 #include "vector.h"
7 #include "debug.h"
8
9 class ActionInterface;
10 class CadToolBar;
11 class CommandWidget;
12 class CoordinateWidget;
13 class Document;
14 class GraphicView;
15 class QG_MainWindowInterface;
16 class MouseWidget;
17 class SelectionWidget;
18
19 #define QG_DIALOGFACTORY (DialogFactory::instance()->getFactoryObject()->isAdapter() == false ? ((QG_DialogFactory *)DialogFactory::instance()->getFactoryObject()) : NULL)
20
21 // !A_WIDGET
22 /**
23  * This is the Qt implementation of a widget which can create and
24  * show dialogs.
25  */
26 class QG_DialogFactory: public DialogFactoryInterface
27 {
28         public:
29                 QG_DialogFactory(QWidget * parent, QToolBar * ow);
30                 virtual ~QG_DialogFactory();
31
32         protected:
33                 virtual void setOptionWidget(QToolBar * ow);
34
35         public:
36                 virtual void setCoordinateWidget(CoordinateWidget * cw);
37                 virtual void setMouseWidget(MouseWidget * mw);
38                 virtual void setSelectionWidget(SelectionWidget * sw);
39                 virtual void setCadToolBar(CadToolBar * ctb);
40                 CadToolBar * getCadToolBar();
41                 virtual void setCommandWidget(CommandWidget * cw);
42                 CommandWidget * getCommandWidget();
43                 virtual void setMainWindow(QG_MainWindowInterface * mw);
44                 virtual void requestWarningDialog(const QString& warning);
45
46                 virtual GraphicView * requestNewDocument(const QString & fileName = QString::null,
47                         Document * doc = NULL);
48                 virtual void requestSimulationControls();
49
50                 virtual Layer * requestNewLayerDialog(LayerList * layerList = NULL);
51                 virtual Layer * requestLayerRemovalDialog(LayerList * layerList = NULL);
52                 virtual Layer * requestEditLayerDialog(LayerList * layerList = NULL);
53
54                 virtual BlockData requestNewBlockDialog(BlockList * blockList);
55                 virtual Block * requestBlockRemovalDialog(BlockList * blockList);
56                 virtual BlockData requestBlockAttributesDialog(BlockList * blockList);
57                 virtual void requestEditBlockWindow(BlockList * /*blockList*/);
58                 virtual void closeEditBlockWindow(Block * /*blockList*/);
59                 //virtual QString requestFileSaveAsDialog();
60                 //virtual QString requestFileOpenDialog();
61
62                 virtual QString requestImageOpenDialog();
63                 virtual void requestOptions(ActionInterface * action, bool on, bool update = false);
64
65         protected:
66                 virtual void requestPrintPreviewOptions(ActionInterface * action, bool on, bool update);
67                 virtual void requestLineOptions(ActionInterface * action, bool on);
68                 virtual void requestPolylineOptions(ActionInterface * action, bool on, bool update);
69                 virtual void requestLineAngleOptions(ActionInterface * action, bool on, bool update);
70                 virtual void requestLineRelAngleOptions(ActionInterface * action, bool on, bool update);
71                 virtual void requestLineParallelOptions(ActionInterface * action, bool on, bool update);
72                 virtual void requestLineParallelThroughOptions(ActionInterface * action, bool on, bool update);
73                 virtual void requestLineBisectorOptions(ActionInterface * action, bool on, bool update);
74                 virtual void requestLinePolygonOptions(ActionInterface * action, bool on, bool update);
75                 virtual void requestLinePolygon2Options(ActionInterface * action, bool on, bool update);
76                 virtual void requestArcOptions(ActionInterface * action, bool on, bool update);
77                 virtual void requestArcTangentialOptions(ActionInterface * action, bool on, bool update);
78                 virtual void requestCircleOptions(ActionInterface * action, bool on, bool update);
79                 virtual void requestSplineOptions(ActionInterface * action, bool on, bool update);
80                 virtual void requestTextOptions(ActionInterface * action, bool on, bool update);
81                 virtual void requestDimensionOptions(ActionInterface * action, bool on, bool update);
82                 virtual void requestDimLinearOptions(ActionInterface * action, bool on, bool update);
83                 virtual void requestInsertOptions(ActionInterface * action, bool on, bool update);
84                 virtual void requestImageOptions(ActionInterface * action, bool on, bool update);
85                 virtual void requestTrimAmountOptions(ActionInterface * action, bool on, bool update);
86                 virtual void requestMoveRotateOptions(ActionInterface * action, bool on, bool update);
87                 virtual void requestBevelOptions(ActionInterface * action, bool on, bool update);
88                 virtual void requestRoundOptions(ActionInterface * action, bool on, bool update);
89                 virtual void requestLibraryInsertOptions(ActionInterface * action, bool on, bool update);
90
91         public:
92                 virtual void requestSnapDistOptions(double& dist, bool on);
93
94         public:
95                 virtual void requestToolBar(RS2::ToolBarId id);
96                 virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction);
97
98                 virtual bool requestAttributesDialog(AttributesData & data, LayerList & layerList);
99                 virtual bool requestMoveDialog(MoveData & data);
100                 virtual bool requestRotateDialog(RotateData & data);
101                 virtual bool requestScaleDialog(ScaleData & data);
102                 virtual bool requestMirrorDialog(MirrorData & data);
103                 virtual bool requestMoveRotateDialog(MoveRotateData & data);
104                 virtual bool requestRotate2Dialog(Rotate2Data & data);
105
106                 virtual bool requestModifyEntityDialog(Entity * entity);
107                 virtual bool requestTextDialog(Text * text);
108                 virtual bool requestHatchDialog(Hatch * hatch);
109
110 #ifdef RS_CAM
111                 virtual bool requestCamOptionsDialog(Drawing & graphic);
112 #endif
113
114                 virtual void requestOptionsGeneralDialog();
115                 virtual void requestOptionsDrawingDialog(Drawing & graphic);
116
117                 virtual void requestPreviousMenu();
118
119                 virtual void updateCoordinateWidget(const Vector & abs,
120                         const Vector & rel, bool updateFormat = false);
121                 virtual void updateMouseWidget(const QString & left, const QString & right);
122                 virtual void updateSelectionWidget(int num);
123                 virtual void commandMessage(const QString & message);
124                 virtual bool isAdapter();
125
126                 static QString extToFormat(const QString & ext);
127
128         protected:
129                 //! Pointer to the widget which can host dialogs
130                 QWidget * parent;
131                 //! Pointer to the widget which can host individual tool options
132                 QToolBar * optionWidget;
133                 //! Pointer to the coordinate widget.
134                 CoordinateWidget * coordinateWidget;
135                 //! Pointer to the mouse widget.
136                 MouseWidget * mouseWidget;
137                 //! Pointer to the selection widget.
138                 SelectionWidget * selectionWidget;
139                 //! Pointer to the CAD tool bar
140                 CadToolBar * cadToolBar;
141                 //! Pointer to the command line widget
142                 CommandWidget * commandWidget;
143                 //! Pointer to the main app window
144                 QG_MainWindowInterface * mainWindow;
145 };
146
147 #endif