Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeSavingContext.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2004-2006 David Faure <faure@kde.org>
3 SPDX-FileCopyrightText: 2007-2008 Thorsten Zachmann <zachmann@kde.org>
4 SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
5 SPDX-FileCopyrightText: 2010 Benjamin Port <port.benjamin@gmail.com>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#ifndef KOSHAPESAVINGCONTEXT_H
11#define KOSHAPESAVINGCONTEXT_H
12
13#include "kritaflake_export.h"
14
15#include <QMap>
16
17class KoShape;
18class KoXmlWriter;
19class KoMarker;
20class KoShapeLayer;
21class KoStore;
24
25class QImage;
26class QTransform;
27
31class KRITAFLAKE_EXPORT KoShapeSavingContext
32{
33public:
41 PresentationShape = 1,
47 DrawId = 2,
51 AutoStyleInStyleXml = 4,
55 UniqueMasterPages = 8,
59 ZIndex = 16
60 };
61 Q_DECLARE_FLAGS(ShapeSavingOptions, ShapeSavingOption)
62
63
70 virtual ~KoShapeSavingContext();
71
77 KoXmlWriter &xmlWriter();
78
87 void setXmlWriter(KoXmlWriter &xmlWriter);
88
94 bool isSet(ShapeSavingOption option) const;
95
101 void setOptions(ShapeSavingOptions options);
102
104 void addOption(ShapeSavingOption option);
105
107 void removeOption(ShapeSavingOption option);
108
114 ShapeSavingOptions options() const;
115
120 void addLayerForSaving(const KoShapeLayer *layer);
121
125 void saveLayerSet(KoXmlWriter &xmlWriter) const;
126
132 void clearLayers();
133
137 QMap<qint64, QString> imagesToSave();
138
142 QString markerRef(const KoMarker *marker);
143
161 void addSharedData(const QString &id, KoSharedSavingData *data);
162
171 KoSharedSavingData *sharedData(const QString &id) const;
172
182 void addShapeOffset(const KoShape *shape, const QTransform &matrix);
183
189 void removeShapeOffset(const KoShape *shape);
190
197 QTransform shapeOffset(const KoShape *shape) const;
198
199private:
201};
202
203Q_DECLARE_OPERATORS_FOR_FLAGS(KoShapeSavingContext::ShapeSavingOptions)
204
205#endif // KOSHAPESAVINGCONTEXT_H
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)
KoShapeSavingContextPrivate *const d
ShapeSavingOption
The Style used for saving the shape.
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)