1 #ifndef QG_DIALOGFACTORY_H
2 #define QG_DIALOGFACTORY_H
5 #include "dialogfactoryinterface.h"
12 class CoordinateWidget;
15 class QG_MainWindowInterface;
17 class SelectionWidget;
19 #define QG_DIALOGFACTORY (DialogFactory::instance()->getFactoryObject()->isAdapter() == false ? ((QG_DialogFactory *)DialogFactory::instance()->getFactoryObject()) : NULL)
23 * This is the Qt implementation of a widget which can create and
26 class QG_DialogFactory: public DialogFactoryInterface
29 QG_DialogFactory(QWidget * parent, QToolBar * ow);
30 virtual ~QG_DialogFactory();
33 virtual void setOptionWidget(QToolBar * ow);
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);
46 virtual GraphicView * requestNewDocument(const QString & fileName = QString::null,
47 Document * doc = NULL);
48 virtual void requestSimulationControls();
50 virtual Layer * requestNewLayerDialog(LayerList * layerList = NULL);
51 virtual Layer * requestLayerRemovalDialog(LayerList * layerList = NULL);
52 virtual Layer * requestEditLayerDialog(LayerList * layerList = NULL);
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();
62 virtual QString requestImageOpenDialog();
63 virtual void requestOptions(ActionInterface * action, bool on, bool update = false);
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);
92 virtual void requestSnapDistOptions(double& dist, bool on);
95 virtual void requestToolBar(RS2::ToolBarId id);
96 virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction);
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);
106 virtual bool requestModifyEntityDialog(Entity * entity);
107 virtual bool requestTextDialog(Text * text);
108 virtual bool requestHatchDialog(Hatch * hatch);
111 virtual bool requestCamOptionsDialog(Drawing & graphic);
114 virtual void requestOptionsGeneralDialog();
115 virtual void requestOptionsDrawingDialog(Drawing & graphic);
117 virtual void requestPreviousMenu();
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();
126 static QString extToFormat(const QString & ext);
129 //! Pointer to the widget which can host dialogs
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;