Krita Source Code Documentation
Loading...
Searching...
No Matches
KoDeferredShapeFactoryBase Class Referenceabstract

#include <KoDeferredShapeFactoryBase.h>

+ Inheritance diagram for KoDeferredShapeFactoryBase:

Public Member Functions

virtual KoShapecreateDefaultShape (KoDocumentResourceManager *documentResources=0) const =0
 
virtual KoShapecreateShape (const KoProperties *params, KoDocumentResourceManager *documentResources=0) const
 
virtual QString deferredPluginName ()=0
 
 KoDeferredShapeFactoryBase (QObject *parent)
 
 ~KoDeferredShapeFactoryBase () override
 

Detailed Description

A factory for KoShape objects. This factory differs from the public KoShapeFactorBase class that this class really creates the shape; it's the plugin entry point for the actually shape plugins.

Definition at line 25 of file KoDeferredShapeFactoryBase.h.

Constructor & Destructor Documentation

◆ KoDeferredShapeFactoryBase()

KoDeferredShapeFactoryBase::KoDeferredShapeFactoryBase ( QObject * parent)
explicit

Definition at line 8 of file KoDeferredShapeFactoryBase.cpp.

9 : QObject(parent)
10{
11
12}

◆ ~KoDeferredShapeFactoryBase()

KoDeferredShapeFactoryBase::~KoDeferredShapeFactoryBase ( )
override

Definition at line 14 of file KoDeferredShapeFactoryBase.cpp.

15{
16
17}

Member Function Documentation

◆ createDefaultShape()

virtual KoShape * KoDeferredShapeFactoryBase::createDefaultShape ( KoDocumentResourceManager * documentResources = 0) const
pure virtual

This method should be implemented by factories to create a shape that the user gets when doing a base insert. For example from a script. The created shape should have its values set to good defaults that the user can then adjust further if needed. Including the KoShape:setShapeId(), with the Id from this factory The default shape position is not relevant, it will be moved by the caller.

Parameters
documentResourcesthe resources manager that has all the document wide resources which can be used to create the object.
Returns
a new shape
See also
createShape() newDocumentResourceManager()

◆ createShape()

KoShape * KoDeferredShapeFactoryBase::createShape ( const KoProperties * params,
KoDocumentResourceManager * documentResources = 0 ) const
virtual

This method should be implemented by factories to create a shape based on a set of properties that are specifically made for this shape-type. This method should also set this factories shapeId on the shape using KoShape::setShapeId() The default implementation just ignores 'params' and calls createDefaultShape()

Returns
a new shape
Parameters
paramsthe properties object is the same as added in the addTemplate() call
documentResourcesthe resources manager that has all the document wide resources which can be used to create the object.
See also
createDefaultShape() newDocumentResourceManager()
KoShapeTemplate::properties

Definition at line 19 of file KoDeferredShapeFactoryBase.cpp.

20{
21 return createDefaultShape(documentResources);
22}
virtual KoShape * createDefaultShape(KoDocumentResourceManager *documentResources=0) const =0

References createDefaultShape().

◆ deferredPluginName()

virtual QString KoDeferredShapeFactoryBase::deferredPluginName ( )
pure virtual

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