Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgWriter.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2002 Lars Siebold <khandha5@gmx.net>
3 SPDX-FileCopyrightText: 2002 Werner Trobin <trobin@kde.org>
4 SPDX-FileCopyrightText: 2002 Lennart Kudling <kudling@kde.org>
5 SPDX-FileCopyrightText: 2002-2003, 2005 Rob Buis <buis@kde.org>
6 SPDX-FileCopyrightText: 2005 Boudewijn Rempt <boud@valdyas.org>
7 SPDX-FileCopyrightText: 2005 Raphael Langerhorst <raphael.langerhorst@kdemail.net>
8 SPDX-FileCopyrightText: 2005 Thomas Zander <zander@kde.org>
9 SPDX-FileCopyrightText: 2005, 2008 Jan Hambrecht <jaham@gmx.net>
10 SPDX-FileCopyrightText: 2006 Inge Wallin <inge@lysator.liu.se>
11 SPDX-FileCopyrightText: 2006 Laurent Montel <montel@kde.org>
12
13 SPDX-License-Identifier: LGPL-2.0-or-later
14*/
15
16#ifndef SVGWRITER_H
17#define SVGWRITER_H
18
19#include "kritaflake_export.h"
20#include <QList>
21#include <QSizeF>
22
24class KoShapeLayer;
25class KoShapeGroup;
26class KoShape;
27class KoPathShape;
28class QIODevice;
29class QString;
30
32class KRITAFLAKE_EXPORT SvgWriter
33{
34public:
36 SvgWriter(const QList<KoShapeLayer*> &layers);
37
39 SvgWriter(const QList<KoShape*> &toplevelShapes);
40
42 virtual ~SvgWriter();
43
45 bool save(QIODevice &outputDevice, const QSizeF &pageSize);
46
48 bool save(const QString &filename, const QSizeF &pageSize, bool writeInlineImages);
49
50 bool saveDetached(QIODevice &outputDevice);
51
52 bool saveDetached(SvgSavingContext &savingContext);
53
54 void setDocumentTitle(QString title);
55 void setDocumentDescription(QString description);
56
57private:
58 void saveShapes(const QList<KoShape*> shapes, SvgSavingContext &savingContext);
59
60 void saveLayer(KoShapeLayer *layer, SvgSavingContext &context);
61 void saveGroup(KoShapeGroup *group, SvgSavingContext &context);
62 void saveShape(KoShape *shape, SvgSavingContext &context);
63 void savePath(KoPathShape *path, SvgSavingContext &context);
64 void saveGeneric(KoShape *shape, SvgSavingContext &context);
65
70};
71
72#endif // SVGWRITER_H
The position of a path point within a path shape.
Definition KoPathShape.h:63
Context for saving svg files.
Implements exporting shapes to SVG.
Definition SvgWriter.h:33
bool m_writeInlineImages
Definition SvgWriter.h:67
QString m_documentDescription
Definition SvgWriter.h:69
QString m_documentTitle
Definition SvgWriter.h:68
QList< KoShape * > m_toplevelShapes
Definition SvgWriter.h:66