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 
39 {
40 public:
41  WPGSVGGenerator(std::ostream &output_sink);
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*/) {}
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;
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: */

Generated for libwpg by doxygen 1.8.3.1