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, const QMap< QString, KoDataCenter * > &dataCenterMap) | |
| ~KoShapeLoadingContext () | |
| void | addLayer (KoShapeLayer *layer, const QString &layerName) |
| void | addShapeId (KoShape *shape, const QString &id) |
| void | addSharedData (const QString &id, KoSharedLoadingData *data) |
| void | clearLayers () |
| KoDataCenter * | dataCenter (const QString &dataCenterName) |
| QMap< QString, KoDataCenter * > | dataCenterMap () const |
| KoImageCollection * | imageCollection () |
| KoShapeLayer * | layer (const QString &layerName) |
| KoOdfLoadingContext & | odfLoadingContext () |
| void | setZIndex (int index) |
| KoShape * | shapeById (const QString &id) |
| void | shapeLoaded (KoShape *shape) |
| 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 44 of file KoShapeLoadingContext.h.
Constructor & Destructor Documentation
| KoShapeLoadingContext::KoShapeLoadingContext | ( | KoOdfLoadingContext & | context, | |
| const QMap< QString, KoDataCenter * > & | dataCenterMap | |||
| ) |
constructor
- Parameters:
-
context the context created for generic ODF loading. dataCenterMap the data center map of the shape controller. This is used in calling KoShape::init during loading.
Definition at line 61 of file KoShapeLoadingContext.cpp.
| KoShapeLoadingContext::~KoShapeLoadingContext | ( | ) |
destructor
Definition at line 66 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 159 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 164 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 81 of file KoShapeLoadingContext.cpp.
register the id for a specific shape
Definition at line 91 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 137 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::clearLayers | ( | ) |
remove all layers
This can be used for loading different layer sets per page.
Definition at line 86 of file KoShapeLoadingContext.cpp.
| KoDataCenter * KoShapeLoadingContext::dataCenter | ( | const QString & | dataCenterName | ) |
Get a data center.
If the data center is not found 0 is returned
Definition at line 169 of file KoShapeLoadingContext.cpp.
| QMap< QString, KoDataCenter * > KoShapeLoadingContext::dataCenterMap | ( | ) | const |
Get a data center map.
Definition at line 174 of file KoShapeLoadingContext.cpp.
| KoImageCollection * KoShapeLoadingContext::imageCollection | ( | ) |
Returns the image collection for loading images.
Definition at line 122 of file KoShapeLoadingContext.cpp.
| KoShapeLayer * KoShapeLoadingContext::layer | ( | const QString & | layerName | ) |
Returns layer referenced by given name.
Definition at line 76 of file KoShapeLoadingContext.cpp.
| KoOdfLoadingContext & KoShapeLoadingContext::odfLoadingContext | ( | ) |
return the embedded loading context
Definition at line 71 of file KoShapeLoadingContext.cpp.
| void KoShapeLoadingContext::setZIndex | ( | int | index | ) |
Set z-index.
Definition at line 132 of file KoShapeLoadingContext.cpp.
return the shape formerly registered using addShapeId()
Definition at line 101 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 112 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 149 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 107 of file KoShapeLoadingContext.cpp.
| int KoShapeLoadingContext::zIndex | ( | ) |
Get current z-index.
Definition at line 127 of file KoShapeLoadingContext.cpp.
The documentation for this class was generated from the following files:
