1 #ifndef __DIALOGFACTORYINTERFACE_H__
2 #define __DIALOGFACTORYINTERFACE_H__
40 * Interface for objects that can create and show dialogs.
42 class DialogFactoryInterface
45 DialogFactoryInterface() {}
46 virtual ~DialogFactoryInterface() {}
49 * This virtual method must be overwritten and must show the previously
50 * shown menu in the cad toolbar.
52 virtual void requestPreviousMenu() = 0;
55 * This virtual method must be overwritten and must provide
58 virtual void requestWarningDialog(const QString & warning) = 0;
61 * This virtual method must be overwritten and must create a new
62 * window for the given document or for a new document if no document
65 virtual GraphicView * requestNewDocument(const QString & fileName = QString::null,
66 Document * doc = NULL) = 0;
69 * This virtual method must be overwritten and must create or show
70 * a simulation control widget.
72 virtual void requestSimulationControls() = 0;
75 * This virtual method must be overwritten and must provide
76 * a dialog for choosing the properties of a new layer to be
77 * created. The method must create the new layer but not add
78 * it to the layer list. The latter is up to the caller.
80 * @return The implementation is expected to return a pointer
81 * to the newly created layer or NULL if the user
84 virtual Layer * requestNewLayerDialog(LayerList * layerList = NULL) = 0;
87 * This virtual method must be overwritten and must provide
88 * a dialog that asks for permission for removing the selected
89 * layer from the layer list. The method must not actually
90 * remove the layer. This is up to the caller.
92 * @return The implementation is expected to return a pointer
93 * to the layer which can ne removed or NULL if the user
96 virtual Layer * requestLayerRemovalDialog(LayerList * layerList = NULL) = 0;
99 * This virtual method must be overwritten and must provide
100 * a dialog to edit the layers attributes. The method must
101 * not actually edit the layer. This is up to the caller.
103 * @return The implementation is expected to return a pointer
104 * to the modified layer or NULL if the user
105 * cancels the dialog.
107 virtual Layer * requestEditLayerDialog(LayerList * layerList = NULL) = 0;
110 * This virtual method must be overwritten and must provide
111 * a dialog for choosing the properties of a new block to be
112 * created. The method must create the new block but not add
113 * it to the block list. The latter is up to the caller.
115 * @param block Pointer to the newly created block with default
118 * @return The implementation is expected to return a pointer
119 * to the newly created block or NULL if the user
120 * cancels the dialog.
122 virtual BlockData requestNewBlockDialog(BlockList * blockList) = 0;
125 * This virtual method must be overwritten and must provide
126 * a dialog that asks for permission for removing the selected
127 * block from the block list. The method must not actually
128 * remove the block. This is up to the caller.
130 * @return The implementation is expected to return a pointer
131 * to the block which can be removed or NULL if the user
132 * cancels the dialog.
134 virtual Block * requestBlockRemovalDialog(BlockList * blockList) = 0;
137 * This virtual method must be overwritten and must provide
138 * a dialog that allows to change blocks attributes of the
139 * currently active block.
141 * @return The implementation is expected to return a pointer
142 * to the block which was changed or NULL if the user
143 * cancels the dialog.
145 virtual BlockData requestBlockAttributesDialog(BlockList * blockList) = 0;
148 * This virtual method must be overwritten and should provide
149 * a way to edit a block.
151 virtual void requestEditBlockWindow(BlockList * blockList) = 0;
153 virtual void closeEditBlockWindow(Block * block) = 0;
156 * This virtual method must be overwritten and must provide
157 * a dialog to get a filename for saving a file. The method must
158 * not actually save the file. This is up to the caller.
160 * @return The implementation is expected to return a string
161 * which contains the file name or an empty string if
162 * the user cancels the dialog.
164 //virtual QString requestFileSaveAsDialog() = 0;
167 * This virtual method must be overwritten and must provide
168 * a dialog to get a filename for opening a file. The method must
169 * not actually open the file. This is up to the caller.
171 * @return The implementation is expected to return a string
172 * which contains the file name or an empty string if
173 * the user cancels the dialog.
175 //virtual QString requestFileOpenDialog() = 0;
178 * This virtual method must be overwritten and must provide
179 * a dialog to get a filename for opening an image file. The method must
180 * not actually open the file. This is up to the caller.
182 * @return The implementation is expected to return a string
183 * which contains the file name or an empty string if
184 * the user cancels the dialog.
186 virtual QString requestImageOpenDialog() = 0;
189 * This virtual method must be overwritten and must present
190 * a widget for options for the given action.
192 * @param action Pointer to the action which needs the options.
193 * @param on true: switch widget on, false: off
194 * @param update true: widget gets data from the action, false:
195 * widget gets data from config file.
197 virtual void requestOptions(ActionInterface * action, bool on, bool update = false) = 0;
200 * This virtual method must be overwritten and must present
201 * a widget for snap point with distance options.
203 * @param dist Distance which can be directly changed
204 * by the presented widget.
205 * @param on true: switch widget on, false: off
207 virtual void requestSnapDistOptions(double & dist, bool on) = 0;
210 * This virtual method must be overwritten and must present
211 * a widget for entity attributes.
213 * @param data Attribute data which can be directly changed
214 * by the presented widget.
216 virtual bool requestAttributesDialog(AttributesData & data, LayerList & layerList) = 0;
219 * This virtual method must be overwritten and must present
220 * a widget for move options (number of copies).
222 * @param data Move data which can be directly changed
223 * by the presented widget.
225 virtual bool requestMoveDialog(MoveData & data) = 0;
228 * This virtual method must be overwritten and must present
229 * a widget for rotate options (number of copies, angle).
231 * @param data Rotation data which can be directly changed
232 * by the presented widget.
234 virtual bool requestRotateDialog(RotateData & data) = 0;
237 * This virtual method must be overwritten and must present
238 * a widget for rotate options (number of copies, angle).
240 * @param data Scaling data which can be directly changed
241 * by the presented widget.
243 virtual bool requestScaleDialog(ScaleData & data) = 0;
246 * This virtual method must be overwritten and must present
247 * a widget for mirror options (number of copies).
249 * @param data Mirror data which can be directly changed
250 * by the presented widget.
252 virtual bool requestMirrorDialog(MirrorData & data) = 0;
255 * This virtual method must be overwritten and must present
256 * a widget for move/rotate options (number of copies, angle).
258 * @param data Move/rotate data which can be directly changed
259 * by the presented widget.
261 virtual bool requestMoveRotateDialog(MoveRotateData & data) = 0;
264 * This virtual method must be overwritten and must present
265 * a widget for rotate around two centers options (number of
268 * @param data Rotate data which can be directly changed
269 * by the presented widget.
271 virtual bool requestRotate2Dialog(Rotate2Data & data) = 0;
274 * This virtual method must be overwritten and must show
277 * @param id Tool bar ID.
279 virtual void requestToolBar(RS2::ToolBarId id) = 0;
282 * This virtual method must be overwritten and must show
283 * the tag toolbar with a button for launching the given
286 * @param nextAction ID of next action to create after selecting was done.
288 virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction) = 0;
291 * This virtual method must be overwritten and must present
292 * a dialog to edit the given entity.
294 * @param entity Pointer to the entity.
296 virtual bool requestModifyEntityDialog(Entity * entity) = 0;
299 * This virtual method must be overwritten and must present
300 * a dialog to edit text entity attributes.
302 * @param entity Pointer to the text entity.
304 virtual bool requestTextDialog(Text * text) = 0;
307 * This virtual method must be overwritten and must present
308 * a dialog to select pattern attributes.
310 * @param entity Pointer to the hatch entity.
312 virtual bool requestHatchDialog(Hatch * hatch) = 0;
315 * This virtual method must be overwritten and must present
316 * a dialog for general application options.
318 virtual void requestOptionsGeneralDialog() = 0;
321 * This virtual method must be overwritten and must present
322 * a dialog for drawing options.
324 * @param graphic Graphic document.
326 virtual void requestOptionsDrawingDialog(Drawing & graphic) = 0;
329 virtual bool requestCamOptionsDialog(Drawing & graphic) = 0;
333 * This virtual method must be overwritten if the graphic view has
334 * a component that is interested in the current mouse position.
335 * The implementation will be called every time the mouse position
338 * @param abs Absolute coordiante of the mouse cursor or the
340 * @param rel Relative coordiante.
342 virtual void updateCoordinateWidget(const Vector & abs, const Vector & rel, bool updateFormat = false) = 0;
345 * This virtual method must be overwritten if the graphic view has
346 * a component that is interested in the current mouse button hints.
347 * The implementation will be called typically by actions to inform
348 * the user about the current functionalty of the mouse buttons.
350 * @param left Help text for the left mouse button.
351 * @param right Help text for the right mouse button.
353 virtual void updateMouseWidget(const QString & left, const QString & right) = 0;
356 * This virtual method must be overwritten if the graphic view has
357 * a component that is interested in the current number of selected
359 * The implementation will be called every time the selection
362 * @param num Number of selected entities
364 virtual void updateSelectionWidget(int num) = 0;
367 * This virtual method must be overwritten if the graphic view has
368 * a component that is interested in command messages (such as a
369 * command line history).
370 * The implementation will be called typically by actions to inform
371 * the user about current events and errors.
373 * @param message The message for the user.
375 virtual void commandMessage(const QString & message) = 0;
377 virtual bool isAdapter() = 0;
380 #endif // __DIALOGFACTORYINTERFACE_H__