+++ /dev/null
-#ifndef __DIALOGFACTORYINTERFACE_H__
-#define __DIALOGFACTORYINTERFACE_H__
-
-#include <QtCore>
-#include "enums.h"
-
-class ActionInterface;
-class ArcData;
-class AttributesData;
-class BevelData;
-class Block;
-class BlockData;
-class BlockList;
-class CircleData;
-class DimLinearData;
-class DimensionData;
-class Document;
-class Drawing;
-class Entity;
-class EventHandler;
-class GraphicView;
-class Grid;
-class Hatch;
-class Insert;
-class Layer;
-class LayerList;
-class MirrorData;
-class MoveData;
-class MoveRotateData;
-class Rotate2Data;
-class RotateData;
-class RoundData;
-class ScaleData;
-class Solid;
-class Text;
-class Vector;
-
-
-/**
- * Interface for objects that can create and show dialogs.
- */
-class DialogFactoryInterface
-{
-public:
- DialogFactoryInterface() {}
- virtual ~DialogFactoryInterface() {}
-
- /**
- * This virtual method must be overwritten and must show the previously
- * shown menu in the cad toolbar.
- */
- virtual void requestPreviousMenu() = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a message dialog.
- */
- virtual void requestWarningDialog(const QString & warning) = 0;
-
- /**
- * This virtual method must be overwritten and must create a new
- * window for the given document or for a new document if no document
- * is given.
- */
- virtual GraphicView * requestNewDocument(const QString & fileName = QString::null,
- Document * doc = NULL) = 0;
-
- /**
- * This virtual method must be overwritten and must create or show
- * a simulation control widget.
- */
- virtual void requestSimulationControls() = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog for choosing the properties of a new layer to be
- * created. The method must create the new layer but not add
- * it to the layer list. The latter is up to the caller.
- *
- * @return The implementation is expected to return a pointer
- * to the newly created layer or NULL if the user
- * cancels the dialog.
- */
- virtual Layer * requestNewLayerDialog(LayerList * layerList = NULL) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog that asks for permission for removing the selected
- * layer from the layer list. The method must not actually
- * remove the layer. This is up to the caller.
- *
- * @return The implementation is expected to return a pointer
- * to the layer which can ne removed or NULL if the user
- * cancels the dialog.
- */
- virtual Layer * requestLayerRemovalDialog(LayerList * layerList = NULL) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog to edit the layers attributes. The method must
- * not actually edit the layer. This is up to the caller.
- *
- * @return The implementation is expected to return a pointer
- * to the modified layer or NULL if the user
- * cancels the dialog.
- */
- virtual Layer * requestEditLayerDialog(LayerList * layerList = NULL) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog for choosing the properties of a new block to be
- * created. The method must create the new block but not add
- * it to the block list. The latter is up to the caller.
- *
- * @param block Pointer to the newly created block with default
- * attributes.
- *
- * @return The implementation is expected to return a pointer
- * to the newly created block or NULL if the user
- * cancels the dialog.
- */
- virtual BlockData requestNewBlockDialog(BlockList * blockList) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog that asks for permission for removing the selected
- * block from the block list. The method must not actually
- * remove the block. This is up to the caller.
- *
- * @return The implementation is expected to return a pointer
- * to the block which can be removed or NULL if the user
- * cancels the dialog.
- */
- virtual Block * requestBlockRemovalDialog(BlockList * blockList) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog that allows to change blocks attributes of the
- * currently active block.
- *
- * @return The implementation is expected to return a pointer
- * to the block which was changed or NULL if the user
- * cancels the dialog.
- */
- virtual BlockData requestBlockAttributesDialog(BlockList * blockList) = 0;
-
- /**
- * This virtual method must be overwritten and should provide
- * a way to edit a block.
- */
- virtual void requestEditBlockWindow(BlockList * blockList) = 0;
-
- virtual void closeEditBlockWindow(Block * block) = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog to get a filename for saving a file. The method must
- * not actually save the file. This is up to the caller.
- *
- * @return The implementation is expected to return a string
- * which contains the file name or an empty string if
- * the user cancels the dialog.
- */
- //virtual QString requestFileSaveAsDialog() = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog to get a filename for opening a file. The method must
- * not actually open the file. This is up to the caller.
- *
- * @return The implementation is expected to return a string
- * which contains the file name or an empty string if
- * the user cancels the dialog.
- */
- //virtual QString requestFileOpenDialog() = 0;
-
- /**
- * This virtual method must be overwritten and must provide
- * a dialog to get a filename for opening an image file. The method must
- * not actually open the file. This is up to the caller.
- *
- * @return The implementation is expected to return a string
- * which contains the file name or an empty string if
- * the user cancels the dialog.
- */
- virtual QString requestImageOpenDialog() = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for options for the given action.
- *
- * @param action Pointer to the action which needs the options.
- * @param on true: switch widget on, false: off
- * @param update true: widget gets data from the action, false:
- * widget gets data from config file.
- */
- virtual void requestOptions(ActionInterface * action, bool on, bool update = false) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for snap point with distance options.
- *
- * @param dist Distance which can be directly changed
- * by the presented widget.
- * @param on true: switch widget on, false: off
- */
- virtual void requestSnapDistOptions(double & dist, bool on) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for entity attributes.
- *
- * @param data Attribute data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestAttributesDialog(AttributesData & data, LayerList & layerList) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for move options (number of copies).
- *
- * @param data Move data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestMoveDialog(MoveData & data) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for rotate options (number of copies, angle).
- *
- * @param data Rotation data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestRotateDialog(RotateData & data) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for rotate options (number of copies, angle).
- *
- * @param data Scaling data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestScaleDialog(ScaleData & data) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for mirror options (number of copies).
- *
- * @param data Mirror data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestMirrorDialog(MirrorData & data) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for move/rotate options (number of copies, angle).
- *
- * @param data Move/rotate data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestMoveRotateDialog(MoveRotateData & data) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a widget for rotate around two centers options (number of
- * copies, angles).
- *
- * @param data Rotate data which can be directly changed
- * by the presented widget.
- */
- virtual bool requestRotate2Dialog(Rotate2Data & data) = 0;
-
- /**
- * This virtual method must be overwritten and must show
- * the given toolbar.
- *
- * @param id Tool bar ID.
- */
- virtual void requestToolBar(RS2::ToolBarId id) = 0;
-
- /**
- * This virtual method must be overwritten and must show
- * the tag toolbar with a button for launching the given
- * action.
- *
- * @param nextAction ID of next action to create after selecting was done.
- */
- virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a dialog to edit the given entity.
- *
- * @param entity Pointer to the entity.
- */
- virtual bool requestModifyEntityDialog(Entity * entity) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a dialog to edit text entity attributes.
- *
- * @param entity Pointer to the text entity.
- */
- virtual bool requestTextDialog(Text * text) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a dialog to select pattern attributes.
- *
- * @param entity Pointer to the hatch entity.
- */
- virtual bool requestHatchDialog(Hatch * hatch) = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a dialog for general application options.
- */
- virtual void requestOptionsGeneralDialog() = 0;
-
- /**
- * This virtual method must be overwritten and must present
- * a dialog for drawing options.
- *
- * @param graphic Graphic document.
- */
- virtual void requestOptionsDrawingDialog(Drawing & graphic) = 0;
-
-#ifdef RS_CAM
- virtual bool requestCamOptionsDialog(Drawing & graphic) = 0;
-#endif
-
- /**
- * This virtual method must be overwritten if the graphic view has
- * a component that is interested in the current mouse position.
- * The implementation will be called every time the mouse position
- * changes.
- *
- * @param abs Absolute coordiante of the mouse cursor or the
- * point it snaps to.
- * @param rel Relative coordiante.
- */
- virtual void updateCoordinateWidget(const Vector & abs, const Vector & rel, bool updateFormat = false) = 0;
-
- /**
- * This virtual method must be overwritten if the graphic view has
- * a component that is interested in the current mouse button hints.
- * The implementation will be called typically by actions to inform
- * the user about the current functionalty of the mouse buttons.
- *
- * @param left Help text for the left mouse button.
- * @param right Help text for the right mouse button.
- */
- virtual void updateMouseWidget(const QString & left, const QString & right) = 0;
-
- /**
- * This virtual method must be overwritten if the graphic view has
- * a component that is interested in the current number of selected
- * entities.
- * The implementation will be called every time the selection
- * changes.
- *
- * @param num Number of selected entities
- */
- virtual void updateSelectionWidget(int num) = 0;
-
- /**
- * This virtual method must be overwritten if the graphic view has
- * a component that is interested in command messages (such as a
- * command line history).
- * The implementation will be called typically by actions to inform
- * the user about current events and errors.
- *
- * @param message The message for the user.
- */
- virtual void commandMessage(const QString & message) = 0;
-
- virtual bool isAdapter() = 0;
-};
-
-#endif // __DIALOGFACTORYINTERFACE_H__