|
Krita Source Code Documentation
|
#include <KoShapeController.h>
Inheritance diagram for KoShapeController:Classes | |
| class | Private |
Public Member Functions | |
| KUndo2Command * | addShape (KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent=0) |
| Add a shape to the document. If the shape has no parent, the active layer will become its parent. | |
| KUndo2Command * | addShapeDirect (KoShape *shape, KoShapeContainer *parentShape, KUndo2Command *parent=0) |
| Add a shape to the document, skipping any dialogs or other user interaction. | |
| KUndo2Command * | addShapesDirect (const QList< KoShape * > shape, KoShapeContainer *parentShape, KUndo2Command *parent=0) |
| Add shapes to the document, skipping any dialogs or other user interaction. | |
| KoShapeControllerBase * | documentBase () const |
| Returns the KoShapeControllerBase used to add/remove shapes. | |
| QRectF | documentRect () const |
| QRectF | documentRectInPixels () const |
| KoShapeController (KoCanvasBase *canvas, KoShapeControllerBase *shapeController) | |
| qreal | pixelsPerInch () const |
| KUndo2Command * | removeShape (KoShape *shape, KUndo2Command *parent=0) |
| Remove a shape from the document. | |
| KUndo2Command * | removeShapes (const QList< KoShape * > &shapes, KUndo2Command *parent=0) |
| void | reset () |
| reset sets the canvas and shapebased document to 0. | |
| KoDocumentResourceManager * | resourceManager () const |
| void | setShapeControllerBase (KoShapeControllerBase *shapeController) |
| Set the KoShapeControllerBase used to add/remove shapes. | |
| ~KoShapeController () override | |
| destructor | |
Private Attributes | |
| Private *const | d |
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 34 of file KoShapeController.h.
| KoShapeController::KoShapeController | ( | KoCanvasBase * | canvas, |
| KoShapeControllerBase * | shapeController ) |
Create a new Controller; typically not called by applications, only by the KonCanvasBase constructor.
| canvas | the canvas this controller works for. The canvas can be 0 |
| shapeController | the application provided shapeController that we can call. |
Definition at line 107 of file KoShapeController.cpp.
References KoShapeController::Private::canvas, d, and KoShapeController::Private::shapeController.
|
override |
| KUndo2Command * KoShapeController::addShape | ( | KoShape * | shape, |
| KoShapeContainer * | parentShape, | ||
| KUndo2Command * | parent = 0 ) |
Add a shape to the document. If the shape has no parent, the active layer will become its parent.
| shape | to add to the document |
| parentShape | the parent shape |
| parent | the parent command if the resulting command is a compound undo command. |
Definition at line 125 of file KoShapeController.cpp.
References KoShapeController::Private::addShape(), and d.
| KUndo2Command * KoShapeController::addShapeDirect | ( | KoShape * | shape, |
| KoShapeContainer * | parentShape, | ||
| KUndo2Command * | parent = 0 ) |
Add a shape to the document, skipping any dialogs or other user interaction.
| shape | to add to the document |
| parentShape | the parent shape |
| parent | the parent command if the resulting command is a compound undo command. |
Definition at line 130 of file KoShapeController.cpp.
References KoShapeController::Private::addShapesDirect(), and d.
| KUndo2Command * KoShapeController::addShapesDirect | ( | const QList< KoShape * > | shape, |
| KoShapeContainer * | parentShape, | ||
| KUndo2Command * | parent = 0 ) |
Add shapes to the document, skipping any dialogs or other user interaction.
| shape | the shape to add to the document |
| parentShape | the parent shape |
| parent | the parent command if the resulting command is a compound undo command. |
Definition at line 135 of file KoShapeController.cpp.
References KoShapeController::Private::addShapesDirect(), and d.
| KoShapeControllerBase * KoShapeController::documentBase | ( | ) | const |
Returns the KoShapeControllerBase used to add/remove shapes.
Definition at line 180 of file KoShapeController.cpp.
References d, and KoShapeController::Private::shapeController.
| QRectF KoShapeController::documentRect | ( | ) | const |
Document rect measured in 'pt'
Definition at line 166 of file KoShapeController.cpp.
References d, KoShapeControllerBase::documentRect(), documentRectInPixels(), and KoShapeController::Private::shapeController.
| QRectF KoShapeController::documentRectInPixels | ( | ) | const |
The size of the document measured in rasterized pixels. This information is needed for loading SVG documents that use 'px' as the default unit.
Definition at line 156 of file KoShapeController.cpp.
References d, KoShapeControllerBase::documentRectInPixels(), and KoShapeController::Private::shapeController.
| qreal KoShapeController::pixelsPerInch | ( | ) | const |
Resolution of the rasterized representation of the document. Used to load SVG documents correctly.
Definition at line 161 of file KoShapeController.cpp.
References d, KoShapeControllerBase::pixelsPerInch(), and KoShapeController::Private::shapeController.
| KUndo2Command * KoShapeController::removeShape | ( | KoShape * | shape, |
| KUndo2Command * | parent = 0 ) |
Remove a shape from the document.
| shape | to remove from the document |
| parent | the parent command if the resulting command is a compound undo command. |
Definition at line 140 of file KoShapeController.cpp.
References removeShapes().
| KUndo2Command * KoShapeController::removeShapes | ( | const QList< KoShape * > & | shapes, |
| KUndo2Command * | parent = 0 ) |
Remove a shape from the document.
| shapes | the set of shapes to remove from the document |
| parent | the parent command if the resulting command is a compound undo command. |
Definition at line 145 of file KoShapeController.cpp.
References d, and KoShapeController::Private::shapeController.
| void KoShapeController::reset | ( | ) |
reset sets the canvas and shapebased document to 0.
Definition at line 119 of file KoShapeController.cpp.
References KoShapeController::Private::canvas, d, and KoShapeController::Private::shapeController.
| KoDocumentResourceManager * KoShapeController::resourceManager | ( | ) | const |
Return a pointer to the resource manager associated with the shape-set (typically a document). The resource manager contains document wide resources * such as variable managers, the image collection and others.
Definition at line 171 of file KoShapeController.cpp.
References d, KoShapeControllerBase::resourceManager(), and KoShapeController::Private::shapeController.
| void KoShapeController::setShapeControllerBase | ( | KoShapeControllerBase * | shapeController | ) |
Set the KoShapeControllerBase used to add/remove shapes.
NOTE: only Sheets uses this method. Do not use it in your application. Sheets has to also call: KoToolManager::instance()->updateShapeControllerBase(shapeController, canvas->canvasController());
| shapeController | the new shapeController. |
Definition at line 151 of file KoShapeController.cpp.
References d, and KoShapeController::Private::shapeController.
|
private |
Definition at line 155 of file KoShapeController.h.