Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeLoadingContext.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2007 Thorsten Zachmann <zachmann@kde.org>
3 SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
4 SPDX-FileCopyrightText: 2014-2015 Denis Kuplyakov <dener.kup@gmail.com>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KOSHAPELOADINGCONTEXT_H
10#define KOSHAPELOADINGCONTEXT_H
11
12#include <QSet>
13#include <QString>
14#include <QPair>
15
16#include "kritaflake_export.h"
17
18class KoShapeLayer;
19class KoShape;
24class KoSectionModel;
25class QVariant;
26class QObject;
27class KoStore;
28
34class KRITAFLAKE_EXPORT KoShapeLoadingContext
35{
36public:
46 AdditionalAttributeData(const QString &ns, const QString &tag, const QString &name)
47 : ns(ns)
48 , tag(tag)
49 , name(name) {
50 }
51
52 const QString ns;
53 const QString tag;
54 const QString name;
55
56 bool operator==(const AdditionalAttributeData &other) const {
57 return name == other.name;
58 }
59 };
60
67
70
71 KoStore *store() const;
72 QString mimeTypeForPath(const QString &href, bool b = true);
73
75 KoShapeLayer *layer(const QString &layerName);
77 void addLayer(KoShapeLayer *layer, const QString &layerName);
78
84 void clearLayers();
85
87 void addShapeId(KoShape *shape, const QString &id);
88
90 KoShape *shapeById(const QString &id);
91
93 void addShapeSubItemId(KoShape *shape, const QVariant &subItem, const QString &id);
95 QPair<KoShape *, QVariant> shapeSubItemById(const QString &id);
96
101 void updateShape(const QString &id, KoLoadingShapeUpdater *shapeUpdater);
102
107 void shapeLoaded(KoShape *shape);
108
110 int zIndex();
111
113 void setZIndex(int index);
114
132 void addSharedData(const QString &id, KoSharedLoadingData *data);
133
142 KoSharedLoadingData *sharedData(const QString &id) const;
143
154 static void addAdditionalAttributeData(const AdditionalAttributeData &attributeData);
155
162 static QSet<AdditionalAttributeData> additionalAttributeData();
163
164 KoDocumentResourceManager *documentResourceManager() const;
169 KoSectionModel *sectionModel();
170
175 void setSectionModel(KoSectionModel *sectionModel);
176
177private:
178 // to allow only the KoShapeRegistry access to the KoShapeControllerBase
179 class Private;
180 Private * const d;
181};
182
183#endif /* KOSHAPELOADINGCONTEXT_H */
KoSectionModel * sectionModel()
returns the current section model
KoStore * store() const
KoSharedLoadingData * sharedData(const QString &id) const
int zIndex()
Get current z-index.
bool operator==(const AdditionalAttributeData &other) const
AdditionalAttributeData(const QString &ns, const QString &tag, const QString &name)