KoShapeLoadingContext Class Reference

Context passed to shapes during loading. More...

#include <KoShapeLoadingContext.h>

List of all members.

Public Member Functions

 KoShapeLoadingContext (KoOdfLoadingContext &context, KoShapeControllerBase *shapeController)
 constructor
 ~KoShapeLoadingContext ()
 destructor
KoOdfLoadingContextodfLoadingContext ()
 return the embedded loading context
KoShapeLayerlayer (const QString &layerName)
 Returns layer referenced by given name.
void addLayer (KoShapeLayer *layer, const QString &layerName)
 Adds a new layer to be referenced by the given name later.
void addShapeId (KoShape *shape, const QString &id)
 register the id for a specific shape
KoShapeshapeById (const QString &id)
 return the shape formerly registered using addShapeId()
KoImageCollectionimageCollection ()
 Returns the image collection for loading images.
int zIndex ()
 Get current z-index.
void setZIndex (int index)
 Set z-index.
void addShapeZIndex (KoShape *shape, int index)
 Add the z-index.
const QMap< KoShape *, int > & shapeZIndices ()
 Get the save z-indices.
void addSharedData (const QString &id, KoSharedLoadingData *data)
 Add shared data.
KoSharedLoadingDatasharedData (const QString &id) const
 Get the shared data.
KoDataCenterdataCenter (const QString &dataCenterName)
 Get a data center from the KoShapeControllerBase.

Static Public Member Functions

static void addAdditionalAttributeData (const AdditionalAttributeData &attributeData)
 Add an additional attribute that should be loaded during shape loading.
static QSet< AdditionalAttributeDataadditionalAttributeData ()
 Get the additional attribute data for loading of a shape.

Friends

class KoShapeRegistry

Classes

struct  AdditionalAttributeData
 Struct to store data about additional attributes that should be loaded during the shape loading. More...


Detailed Description

Context passed to shapes during loading.

This class holds various variables as well as a context full of variables which all together form the context of a loading operation.


Constructor & Destructor Documentation

KoShapeLoadingContext::KoShapeLoadingContext ( KoOdfLoadingContext context,
KoShapeControllerBase shapeController 
)

constructor

Parameters:
context the context created for generic ODF loading.
shapeController the shape controller. This is used to call KoShapeControllerBase::shapeCreated during loading. Please leave 0 only when you are 100% sure you don't need it.


Member Function Documentation

void KoShapeLoadingContext::addAdditionalAttributeData ( const AdditionalAttributeData attributeData  )  [static]

Add an additional attribute that should be loaded during shape loading.

An application can use that to set the data for additional attributes that should be loaded during shape loading. If attribute is set it will not change if set again. The tag is used to differentiate the attributes

Parameters:
attributeData The data describing the additional attribute data

QSet< KoShapeLoadingContext::AdditionalAttributeData > KoShapeLoadingContext::additionalAttributeData (  )  [static]

Get the additional attribute data for loading of a shape.

This is used by KoShape::loadOdfAttributes to load all additional attributes defined in the returned set.

void KoShapeLoadingContext::addShapeZIndex ( KoShape shape,
int  index 
)

Add the z-index.

Used for document which use the z-index instead of the order of the shapes in the document.

void KoShapeLoadingContext::addSharedData ( const QString &  id,
KoSharedLoadingData data 
)

Add shared data.

This can be use to pass data between shapes on loading. E.g. The decoded text styles of the TextShape. With that the styles only have to be read once and can be used in all shapes that also need them.

The ownership of the added data is passed to teh context. The KoShapeLoadingContext will delete the added data when it is destroyed.

Data inserted for a specific id will not be overwritten by calling addSharedData with the same id again.

You get an assertion when the id is already existing.

See also:
KoSharedLoadingData

KoDataCenter * KoShapeLoadingContext::dataCenter ( const QString &  dataCenterName  ) 

Get a data center from the KoShapeControllerBase.

If the data center is not found 0 is returned

KoSharedLoadingData * KoShapeLoadingContext::sharedData ( const QString &  id  )  const

Get the shared data.

See also:
KoSharedLoadingData
Parameters:
id The id used to identify the shared data.
Returns:
The shared data for the id or 0 if there is no shared data for the id.


The documentation for this class was generated from the following files:
Generated on Sun Jul 20 22:37:16 2008 for libs/flake by  doxygen 1.4.7