35 , documentResources(resourceManager)
50 QMap<QString, QPair<KoShape *, QVariant> >
subIds;
59 : d(new
Private(store, documentResources))
77 return "image/svg+xml";
82 return d->layers.value(layerName, 0);
87 d->layers[ layerName ] =
layer;
97 d->drawIds.insert(
id, shape);
98 auto it(
d->updaterById.find(
id));
99 while (it !=
d->updaterById.end() && it.key() ==
id) {
100 d->updaterByShape.insert(shape, it.value());
101 it =
d->updaterById.erase(it);
107 return d->drawIds.value(
id, 0);
112 d->subIds.insert(
id, QPair<KoShape *, QVariant>(shape, subItem));
117 return d->subIds.value(
id);
124 d->updaterById.insert(
id, shapeUpdater);
129 auto it(
d->updaterByShape.find(shape));
130 while (it !=
d->updaterByShape.end() && it.key() == shape) {
131 it.value()->update(shape);
133 it =
d->updaterByShape.erase(it);
150 auto it(
d->sharedData.find(
id));
152 if (it ==
d->sharedData.end()) {
153 d->sharedData.insert(
id, data);
155 warnFlake <<
"The id" <<
id <<
"is already registered. Data not inserted";
156 Q_ASSERT(it ==
d->sharedData.end());
163 QMap<QString, KoSharedLoadingData*>::const_iterator it(
d->sharedData.find(
id));
164 if (it !=
d->sharedData.constEnd()) {
182 return d->documentResources;
187 return d->sectionModel;
uint qHash(const KoShapeLoadingContext::AdditionalAttributeData &attributeData)
static QSet< KoShapeLoadingContext::AdditionalAttributeData > s_additionalAttributes
void setZIndex(int index)
Set z-index.
void addSharedData(const QString &id, KoSharedLoadingData *data)
KoShapeLayer * layer(const QString &layerName)
Returns layer referenced by given name.
void updateShape(const QString &id, KoLoadingShapeUpdater *shapeUpdater)
QMap< QString, KoShape * > drawIds
void addShapeId(KoShape *shape, const QString &id)
register the id for a specific shape
KoShapeLoadingContext(KoStore *store, KoDocumentResourceManager *documentResources)
KoDocumentResourceManager * documentResourceManager() const
void setSectionModel(KoSectionModel *sectionModel)
sets the section model for the loading context
QMap< QString, KoSharedLoadingData * > sharedData
void shapeLoaded(KoShape *shape)
static QSet< AdditionalAttributeData > additionalAttributeData()
Get the additional attribute data for loading of a shape.
void addShapeSubItemId(KoShape *shape, const QVariant &subItem, const QString &id)
register the id for a specific shape sub item
static void addAdditionalAttributeData(const AdditionalAttributeData &attributeData)
Add an additional attribute that should be loaded during shape loading.
QPair< KoShape *, QVariant > shapeSubItemById(const QString &id)
return the shape and subitem formerly registered using addShapeSubItemId()
KoShape * shapeById(const QString &id)
return the shape formerly registered using addShapeId()
QMap< QString, QPair< KoShape *, QVariant > > subIds
void addLayer(KoShapeLayer *layer, const QString &layerName)
Adds a new layer to be referenced by the given name later.
QString mimeTypeForPath(const QString &href, bool b=true)
QMultiMap< QString, KoLoadingShapeUpdater * > updaterById
QMap< QString, KoShapeLayer * > layers
QMultiMap< KoShape *, KoLoadingShapeUpdater * > updaterByShape
Private(KoStore *store, KoDocumentResourceManager *resourceManager)
KoDocumentResourceManager * documentResources
KoSectionModel * sectionModel
~KoShapeLoadingContext()
destructor