libs/flake

KoShapeController Class Reference

Class used by tools to maintain the list of shapes. More...

#include <KoShapeController.h>

List of all members.

Public Member Functions

 KoShapeController (KoCanvasBase *canvas, KoShapeControllerBase *shapeController)
 ~KoShapeController ()
QUndoCommandaddShape (KoShape *shape, QUndoCommand *parent=0)
QUndoCommandaddShapeDirect (KoShape *shape, QUndoCommand *parent=0)
KoDataCenterdataCenter (const QString &dataCenterName)
QMap< QString, KoDataCenter * > dataCenterMap ()
QUndoCommandremoveShape (KoShape *shape, QUndoCommand *parent=0)
QUndoCommandremoveShapes (const QList< KoShape * > &shapes, QUndoCommand *parent=0)
void setShapeControllerBase (KoShapeControllerBase *shapeControllerBase)

Detailed Description

Class used by tools to maintain the list of shapes.

All applications have some sort of list of all shapes that belong to the document. The applications implement the KoShapeControllerBase interface (all pure virtuals) to add and remove shapes from the document. To ensure that an application can expect a certain protocol to be adhered to when adding/removing shapes, all tools use the API from this class for maintaining the list of shapes in the document. So no tool gets to access the application directly.

Definition at line 45 of file KoShapeController.h.


Constructor & Destructor Documentation

KoShapeController::KoShapeController ( KoCanvasBase canvas,
KoShapeControllerBase shapeController 
)

Create a new Controller; typically not called by applications, only by the KoToolManager.

Parameters:
canvas the canvas this controller works for.
shapeController the application provided shapeControllerBase that we can call.

Definition at line 115 of file KoShapeController.cpp.

KoShapeController::~KoShapeController (  ) 

destructor

Definition at line 122 of file KoShapeController.cpp.


Member Function Documentation

QUndoCommand * KoShapeController::addShape ( KoShape shape,
QUndoCommand parent = 0 
)

Add a shape to the document.

Parameters:
shape to add to the document
parent the parent command if the resulting command is a compound undo command.
Returns:
command which will insert the shape into the document or 0 if the insertion was cancelled. The command is not yet executed.

Definition at line 127 of file KoShapeController.cpp.

QUndoCommand * KoShapeController::addShapeDirect ( KoShape shape,
QUndoCommand parent = 0 
)

Add a shape to the document, skipping any dialogs or other user interaction.

Parameters:
shape to add to the document
parent the parent command if the resulting command is a compound undo command.
Returns:
command which will insert the shape into the document. The command is not yet executed.

Definition at line 132 of file KoShapeController.cpp.

KoDataCenter * KoShapeController::dataCenter ( const QString dataCenterName  ) 

Returns pointer to data center with given name.

Returns:
pointer to requested data center if it exist, else null

Definition at line 152 of file KoShapeController.cpp.

QMap< QString, KoDataCenter * > KoShapeController::dataCenterMap (  ) 

Get the dataCenterMap used in the shape controller base.

Returns:
The data center map

Definition at line 157 of file KoShapeController.cpp.

QUndoCommand * KoShapeController::removeShape ( KoShape shape,
QUndoCommand parent = 0 
)

Remove a shape from the document.

Parameters:
shape to remove from the document
parent the parent command if the resulting command is a compound undo command.
Returns:
command which will remove the shape from the document. The command is not yet executed.

Definition at line 137 of file KoShapeController.cpp.

QUndoCommand * KoShapeController::removeShapes ( const QList< KoShape * > &  shapes,
QUndoCommand parent = 0 
)

Remove a shape from the document.

Parameters:
shapes the set of shapes to remove from the document
parent the parent command if the resulting command is a compound undo command.
Returns:
command which will remove the shape from the document. The command is not yet executed.

Definition at line 142 of file KoShapeController.cpp.

void KoShapeController::setShapeControllerBase ( KoShapeControllerBase shapeControllerBase  ) 

Set the KoShapeControllerBase used to add/remove shapes.

Parameters:
shapeControllerBase the new shapeControllerBase

Definition at line 147 of file KoShapeController.cpp.


The documentation for this class was generated from the following files: