WPGSVGGenerator.h
Go to the documentation of this file.
1 /* libwpg
2  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3  * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02111-1301 USA
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 
39 public:
40  WPGSVGGenerator(std::ostream & output_sink);
42 
43  void startGraphics(const ::WPXPropertyList &propList);
44  void endGraphics();
45  void startLayer(const ::WPXPropertyList& propList);
46  void endLayer();
47  void startEmbeddedGraphics(const ::WPXPropertyList & /*propList*/) {}
49 
50  void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient);
51 
52  void drawRectangle(const ::WPXPropertyList &propList);
53  void drawEllipse(const ::WPXPropertyList &propList);
54  void drawPolyline(const ::WPXPropertyListVector &vertices);
55  void drawPolygon(const ::WPXPropertyListVector &vertices);
56  void drawPath(const ::WPXPropertyListVector &path);
57  void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData);
58  void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path);
59  void endTextObject();
60  void startTextLine(const ::WPXPropertyList & /* propList */) {}
61  void endTextLine() {}
62  void startTextSpan(const ::WPXPropertyList &propList);
63  void endTextSpan();
64  void insertText(const ::WPXString &str);
65 
66 private:
67  ::WPXPropertyListVector m_gradient;
68  ::WPXPropertyList m_style;
70  void writeStyle(bool isClosed=true);
71  void drawPolySomething(const ::WPXPropertyListVector& vertices, bool isClosed);
72 
73  std::ostream & m_outputSink;
74 };
75 
76 } // namespace libwpg
77 
78 #endif // __WPGSVGGENERATOR_H__

Generated for libwpg by doxygen 1.8.1.2