libs/flake
KoShapeSavingContext.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KOSHAPESAVINGCONTEXT_H
00023 #define KOSHAPESAVINGCONTEXT_H
00024
00025 #include "flake_export.h"
00026
00027 #include <QImage>
00028 #include <QMatrix>
00029
00030 class KoShape;
00031 class KoXmlWriter;
00032 class KoGenStyles;
00033 class KoDataCenterBase;
00034 class KoEmbeddedDocumentSaver;
00035 class KoImageData;
00036 class KoShapeLayer;
00037 class KoStore;
00038 class KoSharedSavingData;
00039 class KoShapeSavingContextPrivate;
00040
00044 class FLAKE_EXPORT KoShapeSavingContext
00045 {
00046 public:
00048 enum ShapeSavingOption {
00054 PresentationShape = 1,
00059 DrawId = 2,
00063 AutoStyleInStyleXml = 4,
00067 UniqueMasterPages = 8
00068 };
00069 Q_DECLARE_FLAGS(ShapeSavingOptions, ShapeSavingOption)
00070
00071
00077 KoShapeSavingContext(KoXmlWriter &xmlWriter, KoGenStyles &mainStyles,
00078 KoEmbeddedDocumentSaver &embeddedSaver);
00079 virtual ~KoShapeSavingContext();
00080
00086 KoXmlWriter &xmlWriter();
00087
00096 void setXmlWriter(KoXmlWriter &xmlWriter);
00097
00103 KoGenStyles &mainStyles();
00104
00110 KoEmbeddedDocumentSaver &embeddedSaver();
00111
00117 bool isSet(ShapeSavingOption option) const;
00118
00124 void setOptions(ShapeSavingOptions options);
00125
00127 void addOption(ShapeSavingOption option);
00128
00130 void removeOption(ShapeSavingOption option);
00131
00137 ShapeSavingOptions options() const;
00138
00149 QString drawId(const KoShape *shape, bool insert = true);
00150
00159 void clearDrawIds();
00160
00165 void addLayerForSaving(const KoShapeLayer *layer);
00166
00170 void saveLayerSet(KoXmlWriter &xmlWriter) const;
00171
00177 void clearLayers();
00178
00182 QString imageHref(KoImageData *image);
00183
00190 QString imageHref(QImage &image);
00191
00195 QMap<qint64, QString> imagesToSave();
00196
00200 void addDataCenter(KoDataCenterBase *dataCenter);
00201
00208 bool saveDataCenter(KoStore *store, KoXmlWriter *manifestWriter);
00209
00227 void addSharedData(const QString &id, KoSharedSavingData *data);
00228
00237 KoSharedSavingData *sharedData(const QString &id) const;
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248 void addShapeOffset(const KoShape *shape, const QMatrix &matrix);
00249
00255 void removeShapeOffset(const KoShape *shape);
00256
00263 QMatrix shapeOffset(const KoShape *shape) const;
00264
00265 private:
00266 KoShapeSavingContextPrivate *d;
00267 };
00268
00269 Q_DECLARE_OPERATORS_FOR_FLAGS(KoShapeSavingContext::ShapeSavingOptions)
00270
00271 #endif // KOSHAPESAVINGCONTEXT_H
|