libs/flake
KoShapeLoadingContext Class Reference
Context passed to shapes during loading. More...
#include <KoShapeLoadingContext.h>
Classes | |
| struct | AdditionalAttributeData |
| Struct to store data about additional attributes that should be loaded during the shape loading. More... | |
Public Member Functions | |
| KoShapeLoadingContext (KoOdfLoadingContext &context, KoResourceManager *documentResources) | |
| ~KoShapeLoadingContext () | |
| void | addLayer (KoShapeLayer *layer, const QString &layerName) |
| void | addShapeId (KoShape *shape, const QString &id) |
| void | addShapeSubItemId (KoShape *shape, const QVariant &subItem, const QString &id) |
| void | addSharedData (const QString &id, KoSharedLoadingData *data) |
| void | clearLayers () |
| KoResourceManager * | documentResourceManager () const |
| KoImageCollection * | imageCollection () |
| KoShapeLayer * | layer (const QString &layerName) |
| KoOdfLoadingContext & | odfLoadingContext () |
| void | setZIndex (int index) |
| KoShape * | shapeById (const QString &id) |
| void | shapeLoaded (KoShape *shape) |
| QPair< KoShape *, QVariant > | shapeSubItemById (const QString &id) |
| KoSharedLoadingData * | sharedData (const QString &id) const |
| void | updateShape (const QString &id, KoLoadingShapeUpdater *shapeUpdater) |
| int | zIndex () |
Static Public Member Functions | |
| static void | addAdditionalAttributeData (const AdditionalAttributeData &attributeData) |
| static QSet < AdditionalAttributeData > | additionalAttributeData () |
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.
Definition at line 45 of file KoShapeLoadingContext.h.
Constructor & Destructor Documentation
| KoShapeLoadingContext::KoShapeLoadingContext | ( | KoOdfLoadingContext & | context, | |
| KoResourceManager * | documentResources | |||
| ) |
constructor
- Parameters:
-
context the context created for generic ODF loading. documentResources the data of the shape controller.
Definition at line 65 of file KoShapeLoadingContext.cpp.
| KoShapeLoadingContext::~KoShapeLoadingContext | ( | ) |
destructor
Definition at line 70 of file KoShapeLoadingContext.cpp.
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
Definition at line 174 of file KoShapeLoadingContext.cpp.
| 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.
Definition at line 179 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::addLayer | ( | KoShapeLayer * | layer, | |
| const QString & | layerName | |||
| ) |
Adds a new layer to be referenced by the given name later.
Definition at line 85 of file KoShapeLoadingContext.cpp.
register the id for a specific shape
Definition at line 95 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::addShapeSubItemId | ( | KoShape * | shape, | |
| const QVariant & | subItem, | |||
| const QString & | id | |||
| ) |
register the id for a specific shape sub item
Definition at line 110 of file KoShapeLoadingContext.cpp.
| 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
Definition at line 152 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::clearLayers | ( | ) |
remove all layers
This can be used for loading different layer sets per page.
Definition at line 90 of file KoShapeLoadingContext.cpp.
| KoResourceManager * KoShapeLoadingContext::documentResourceManager | ( | ) | const |
Definition at line 184 of file KoShapeLoadingContext.cpp.
| KoImageCollection * KoShapeLoadingContext::imageCollection | ( | ) |
Returns the image collection for loading images.
Definition at line 137 of file KoShapeLoadingContext.cpp.
| KoShapeLayer * KoShapeLoadingContext::layer | ( | const QString & | layerName | ) |
Returns layer referenced by given name.
Definition at line 80 of file KoShapeLoadingContext.cpp.
| KoOdfLoadingContext & KoShapeLoadingContext::odfLoadingContext | ( | ) |
return the embedded loading context
Definition at line 75 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::setZIndex | ( | int | index | ) |
Set z-index.
Definition at line 147 of file KoShapeLoadingContext.cpp.
return the shape formerly registered using addShapeId()
Definition at line 105 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::shapeLoaded | ( | KoShape * | shape | ) |
this checks if there is an updater for this shape if yes it calls it this needs to be done via the shape id and
Definition at line 127 of file KoShapeLoadingContext.cpp.
return the shape and subitem formerly registered using addShapeSubItemId()
Definition at line 115 of file KoShapeLoadingContext.cpp.
| 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.
Definition at line 164 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::updateShape | ( | const QString & | id, | |
| KoLoadingShapeUpdater * | shapeUpdater | |||
| ) |
call function on the shapeUpdater when the shape with the id shapeid is inserted After that destroy the updater.
Definition at line 122 of file KoShapeLoadingContext.cpp.
| int KoShapeLoadingContext::zIndex | ( | ) |
Get current z-index.
Definition at line 142 of file KoShapeLoadingContext.cpp.
The documentation for this class was generated from the following files:
