Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/svg/SvgParser.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 55 | public: | |||
---|---|---|---|---|---|
59 | /// Parses a svg fragment, returning the list of top level child shapes | 59 | /// Parses a svg fragment, returning the list of top level child shapes | ||
60 | QList<KoShape*> parseSvg(const KoXmlElement &e, QSizeF * fragmentSize = 0); | 60 | QList<KoShape*> parseSvg(const KoXmlElement &e, QSizeF * fragmentSize = 0); | ||
61 | 61 | | |||
62 | /// Sets the initial xml base directory (the directory form where the file is read) | 62 | /// Sets the initial xml base directory (the directory form where the file is read) | ||
63 | void setXmlBaseDir(const QString &baseDir); | 63 | void setXmlBaseDir(const QString &baseDir); | ||
64 | 64 | | |||
65 | void setResolution(const QRectF boundsInPixels, qreal pixelsPerInch); | 65 | void setResolution(const QRectF boundsInPixels, qreal pixelsPerInch); | ||
66 | 66 | | |||
67 | /// A special workaround coeff for usign when loading old ODF-embedded SVG files, | 67 | /// A special workaround coeff for using when loading old ODF-embedded SVG files, | ||
68 | /// which used hard-coded 96 ppi for font size | 68 | /// which used hard-coded 96 ppi for font size | ||
69 | void setForcedFontSizeResolution(qreal value); | 69 | void setForcedFontSizeResolution(qreal value); | ||
70 | 70 | | |||
71 | /// Returns the list of all shapes of the svg document | 71 | /// Returns the list of all shapes of the svg document | ||
72 | QList<KoShape*> shapes() const; | 72 | QList<KoShape*> shapes() const; | ||
73 | 73 | | |||
74 | /// Takes the collection of symbols contained in the svg document. The parser will | 74 | /// Takes the collection of symbols contained in the svg document. The parser will | ||
75 | /// no longer know about the symbols. | 75 | /// no longer know about the symbols. | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 90 | protected: | |||
193 | void applyClipping(KoShape *shape, const QPointF &shapeToOriginalUserCoordinates); | 193 | void applyClipping(KoShape *shape, const QPointF &shapeToOriginalUserCoordinates); | ||
194 | void applyMaskClipping(KoShape *shape, const QPointF &shapeToOriginalUserCoordinates); | 194 | void applyMaskClipping(KoShape *shape, const QPointF &shapeToOriginalUserCoordinates); | ||
195 | void applyMarkers(KoPathShape *shape); | 195 | void applyMarkers(KoPathShape *shape); | ||
196 | 196 | | |||
197 | /// Applies id to specified shape | 197 | /// Applies id to specified shape | ||
198 | void applyId(const QString &id, KoShape *shape); | 198 | void applyId(const QString &id, KoShape *shape); | ||
199 | 199 | | |||
200 | /// Applies viewBox transformation to the current graphical context | 200 | /// Applies viewBox transformation to the current graphical context | ||
201 | /// NOTE: after applying the function currectBoundingBox can become null! | 201 | /// NOTE: after applying the function currentBoundingBox can become null! | ||
202 | void applyViewBoxTransform(const KoXmlElement &element); | 202 | void applyViewBoxTransform(const KoXmlElement &element); | ||
203 | 203 | | |||
204 | private: | 204 | private: | ||
205 | QSizeF m_documentSize; | 205 | QSizeF m_documentSize; | ||
206 | SvgLoadingContext m_context; | 206 | SvgLoadingContext m_context; | ||
207 | QMap<QString, SvgGradientHelper> m_gradients; | 207 | QMap<QString, SvgGradientHelper> m_gradients; | ||
208 | QMap<QString, SvgFilterHelper> m_filters; | 208 | QMap<QString, SvgFilterHelper> m_filters; | ||
209 | QMap<QString, SvgClipPathHelper> m_clipPaths; | 209 | QMap<QString, SvgClipPathHelper> m_clipPaths; | ||
Show All 13 Lines |