#include <KoShapeLoadingContext.h>
Public Member Functions | |
| KoShapeLoadingContext (KoOdfLoadingContext &context, KoShapeControllerBase *shapeController) | |
| constructor | |
| ~KoShapeLoadingContext () | |
| destructor | |
| KoOdfLoadingContext & | odfLoadingContext () |
| return the embedded loading context | |
| KoShapeLayer * | layer (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 | |
| KoShape * | shapeById (const QString &id) |
| return the shape formerly registered using addShapeId() | |
| KoImageCollection * | imageCollection () |
| 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. | |
| KoSharedLoadingData * | sharedData (const QString &id) const |
| Get the shared data. | |
| KoDataCenter * | dataCenter (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< AdditionalAttributeData > | additionalAttributeData () |
| 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... | |
This class holds various variables as well as a context full of variables which all together form the context of a loading operation.
| KoShapeLoadingContext::KoShapeLoadingContext | ( | KoOdfLoadingContext & | context, | |
| KoShapeControllerBase * | shapeController | |||
| ) |
constructor
| 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. |
| 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
| 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.
| 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.
| id | The id used to identify the shared data. |
1.4.7