Krita Source Code Documentation
Loading...
Searching...
No Matches
HtmlSavingContext.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#include "HtmlSavingContext.h"
8#include <KoXmlWriter.h>
9#include <KoShape.h>
10#include <QBuffer>
11
13
14 Private(QIODevice *_shapeDevice)
15 : shapeDevice(_shapeDevice)
16 , shapeWriter(0)
17 {
18 shapeWriter.reset(new KoXmlWriter(&shapeBuffer, 1));
19 }
20
21 QIODevice *shapeDevice;
22 QBuffer shapeBuffer;
23 QScopedPointer<KoXmlWriter> shapeWriter;
24};
25
27 : d(new Private(&shapeDevice))
28{
29}
30
32{
33 d->shapeDevice->write(d->shapeBuffer.data());
34}
35
37{
38 return *d->shapeWriter;
39}
KoXmlWriter & shapeWriter()
Provides access to the shape writer.
const QScopedPointer< Private > d
HtmlSavingContext(QIODevice &shapeDevice)
QScopedPointer< KoXmlWriter > shapeWriter
Private(QIODevice *_shapeDevice)