Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgStyleWriter.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 SVGSTYLEWRITER_H
17#define SVGSTYLEWRITER_H
18
19#include "kritaflake_export.h"
20#include "KoFlakeTypes.h"
21#include <QGradientStops>
22#include <QSharedPointer>
23#include <KoShape.h>
24
26class KoShape;
30class QTransform;
31class QGradient;
32class SvgMeshGradient;
33
35class KRITAFLAKE_EXPORT SvgStyleWriter
36{
37public:
39 static void saveSvgStyle(KoShape *shape, SvgSavingContext &context);
40
42 static void saveSvgBasicStyle(const bool isVisible, const qreal transparency, const QVector<KoShape::PaintOrder> paintOrder, bool inheritPaintorder, SvgSavingContext &context, bool textShape = false);
43
45 static void saveSvgFill(QSharedPointer<KoShapeBackground> background, const bool fillRuleEvenOdd, const QRectF outlineRect, const QSizeF size, const QTransform absoluteTransform, SvgSavingContext &context);
47 static void saveSvgStroke(KoShapeStrokeModelSP, SvgSavingContext &context);
48
49 // embed the given shape, returns an id to refer to.
50 static QString embedShape(const KoShape *shape, SvgSavingContext &context);
51
52 // Save title and desc elements.
53 static void saveMetadata(const KoShape *shape, SvgSavingContext &context);
54
55protected:
57 static void saveSvgEffects(KoShape *shape, SvgSavingContext &context);
59 static void saveSvgClipping(KoShape *shape, SvgSavingContext &context);
61 static void saveSvgMasking(KoShape *shape, SvgSavingContext &context);
63 static void saveSvgMarkers(KoShape *shape, SvgSavingContext &context);
65 static void saveSvgColorStops(const QGradientStops &colorStops, SvgSavingContext &context);
67 static QString saveSvgGradient(const QGradient *gradient, const QTransform &gradientTransform, SvgSavingContext &context);
68 static QString saveSvgMeshGradient(SvgMeshGradient* gradient, const QTransform &transform, SvgSavingContext &context);
70 static QString saveSvgPattern(QSharedPointer<KoPatternBackground> pattern, const QSizeF shapeSize, const QTransform absoluteTransform, SvgSavingContext &context);
71 static QString saveSvgVectorPattern(QSharedPointer<KoVectorPatternBackground> pattern, const QRectF outlineRect, SvgSavingContext &context);
72};
73
74#endif // SVGSTYLEWRITER_H
A pattern shape background.
Context for saving svg files.
Helper class to save svg styles.