- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPGSVGGenerator.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpg
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
11 * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
12 *
13 * For minor contributions see the git repository.
14 *
15 * Alternatively, the contents of this file may be used under the terms
16 * of the GNU Lesser General Public License Version 2.1 or later
17 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18 * applicable instead of those above.
19 *
20 * For further information visit http://libwpg.sourceforge.net
21 */
22
23 /* "This product is not manufactured, approved, or supported by
24 * Corel Corporation or Corel Corporation Limited."
25 */
26
27 #ifndef __WPGSVGGENERATOR_H__
28 #define __WPGSVGGENERATOR_H__
29
30 #include <stdio.h>
31 #include <iostream>
32 #include <libwpd/libwpd.h>
33 #include "libwpg.h"
34
35 namespace libwpg
36 {
37
38 class WPGSVGGenerator : public WPGPaintInterface
39 {
40 public:
41 WPGSVGGenerator(std::ostream &output_sink);
42 ~WPGSVGGenerator();
43
44 void startGraphics(const ::WPXPropertyList &propList);
45 void endGraphics();
46 void startLayer(const ::WPXPropertyList &propList);
47 void endLayer();
48 void startEmbeddedGraphics(const ::WPXPropertyList & /*propList*/) {}
49 void endEmbeddedGraphics() {}
50
51 void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient);
52
53 void drawRectangle(const ::WPXPropertyList &propList);
54 void drawEllipse(const ::WPXPropertyList &propList);
55 void drawPolyline(const ::WPXPropertyListVector &vertices);
56 void drawPolygon(const ::WPXPropertyListVector &vertices);
57 void drawPath(const ::WPXPropertyListVector &path);
58 void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData);
59 void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path);
60 void endTextObject();
61 void startTextLine(const ::WPXPropertyList & /* propList */) {}
62 void endTextLine() {}
63 void startTextSpan(const ::WPXPropertyList &propList);
64 void endTextSpan();
65 void insertText(const ::WPXString &str);
66
67 private:
68 ::WPXPropertyListVector m_gradient;
69 ::WPXPropertyList m_style;
70 int m_gradientIndex, m_shadowIndex;
71 void writeStyle(bool isClosed=true);
72 void drawPolySomething(const ::WPXPropertyListVector &vertices, bool isClosed);
73
74 std::ostream &m_outputSink;
75 };
76
77 } // namespace libwpg
78
79 #endif // __WPGSVGGENERATOR_H__
80 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
libwpg::WPGSVGGenerator::startLayer
void startLayer(const ::WPXPropertyList &propList)
Definition: WPGSVGGenerator.cpp:294
libwpg::WPGSVGGenerator::endLayer
void endLayer()
Definition: WPGSVGGenerator.cpp:302
libwpg::WPGSVGGenerator::drawRectangle
void drawRectangle(const ::WPXPropertyList &propList)
Definition: WPGSVGGenerator.cpp:307
libwpg::WPGSVGGenerator::drawGraphicObject
void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData)
Definition: WPGSVGGenerator.cpp:421
libwpg::WPGSVGGenerator::endTextSpan
void endTextSpan()
Definition: WPGSVGGenerator.cpp:551
libwpg::WPGSVGGenerator::startTextLine
void startTextLine(const ::WPXPropertyList &)
Definition: WPGSVGGenerator.h:61
libwpg::WPGSVGGenerator::drawPolyline
void drawPolyline(const ::WPXPropertyListVector &vertices)
Definition: WPGSVGGenerator.cpp:332
libwpg::WPGSVGGenerator::m_gradient
::WPXPropertyListVector m_gradient
Definition: WPGSVGGenerator.h:68
libwpg::WPGPaintInterface
Definition: WPGPaintInterface.h:35
libwpg::WPGSVGGenerator::endGraphics
void endGraphics()
Definition: WPGSVGGenerator.cpp:97
libwpg::WPGSVGGenerator::m_gradientIndex
int m_gradientIndex
Definition: WPGSVGGenerator.h:70
libwpg.h
libwpg::WPGSVGGenerator::startGraphics
void startGraphics(const ::WPXPropertyList &propList)
Definition: WPGSVGGenerator.cpp:80
libwpg::WPGSVGGenerator::m_style
::WPXPropertyList m_style
Definition: WPGSVGGenerator.h:69
libwpg::WPGSVGGenerator::drawPolySomething
void drawPolySomething(const ::WPXPropertyListVector &vertices, bool isClosed)
Definition: WPGSVGGenerator.cpp:342
libwpg::WPGSVGGenerator::endTextObject
void endTextObject()
Definition: WPGSVGGenerator.cpp:522
libwpg::WPGSVGGenerator::startEmbeddedGraphics
void startEmbeddedGraphics(const ::WPXPropertyList &)
Definition: WPGSVGGenerator.h:48
libwpg::WPGSVGGenerator::drawEllipse
void drawEllipse(const ::WPXPropertyList &propList)
Definition: WPGSVGGenerator.cpp:318
libwpg::WPGSVGGenerator::drawPolygon
void drawPolygon(const ::WPXPropertyListVector &vertices)
Definition: WPGSVGGenerator.cpp:337
libwpg::WPGSVGGenerator::insertText
void insertText(const ::WPXString &str)
Definition: WPGSVGGenerator.cpp:556
libwpg::WPGSVGGenerator
Definition: WPGSVGGenerator.h:38
libwpg::WPGSVGGenerator::startTextSpan
void startTextSpan(const ::WPXPropertyList &propList)
Definition: WPGSVGGenerator.cpp:527
libwpg::WPGSVGGenerator::startTextObject
void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path)
Definition: WPGSVGGenerator.cpp:461
libwpg::WPGSVGGenerator::m_shadowIndex
int m_shadowIndex
Definition: WPGSVGGenerator.h:70
libwpg::WPGSVGGenerator::m_outputSink
std::ostream & m_outputSink
Definition: WPGSVGGenerator.h:74
libwpg::WPGSVGGenerator::~WPGSVGGenerator
~WPGSVGGenerator()
Definition: WPGSVGGenerator.cpp:76
libwpg::WPGSVGGenerator::endEmbeddedGraphics
void endEmbeddedGraphics()
Definition: WPGSVGGenerator.h:49
libwpg::WPGSVGGenerator::setStyle
void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient)
Definition: WPGSVGGenerator.cpp:102
libwpg::WPGSVGGenerator::endTextLine
void endTextLine()
Definition: WPGSVGGenerator.h:62
libwpg::WPGSVGGenerator::writeStyle
void writeStyle(bool isClosed=true)
Definition: WPGSVGGenerator.cpp:563
libwpg::WPGSVGGenerator::drawPath
void drawPath(const ::WPXPropertyListVector &path)
Definition: WPGSVGGenerator.cpp:375
libwpg::WPGSVGGenerator::WPGSVGGenerator
WPGSVGGenerator(std::ostream &output_sink)
Definition: WPGSVGGenerator.cpp:72