CDRSVGGenerator.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libcdr project.
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 
10 #ifndef __CDRSVGGENERATOR_H__
11 #define __CDRSVGGENERATOR_H__
12 
13 #include <stdio.h>
14 #include <iostream>
15 #include <sstream>
16 #include <libwpd/libwpd.h>
17 #include <libwpg/libwpg.h>
18 #include <libcdr/libcdr.h>
19 
20 namespace libcdr
21 {
22 
23 class CDRSVGGenerator : public libwpg::WPGPaintInterface
24 {
25 public:
28 
29  void startGraphics(const ::WPXPropertyList &propList);
30  void endGraphics();
31  void startLayer(const ::WPXPropertyList &propList);
32  void endLayer();
33  void startEmbeddedGraphics(const ::WPXPropertyList & /*propList*/) {}
35 
36  void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient);
37 
38  void drawRectangle(const ::WPXPropertyList &propList);
39  void drawEllipse(const ::WPXPropertyList &propList);
40  void drawPolyline(const ::WPXPropertyListVector &vertices);
41  void drawPolygon(const ::WPXPropertyListVector &vertices);
42  void drawPath(const ::WPXPropertyListVector &path);
43  void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData);
44  void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path);
45  void endTextObject();
46  void startTextLine(const ::WPXPropertyList & /* propList */) {}
47  void endTextLine() {}
48  void startTextSpan(const ::WPXPropertyList &propList);
49  void endTextSpan();
50  void insertText(const ::WPXString &str);
51 
52 private:
53  ::WPXPropertyListVector m_gradient;
54  ::WPXPropertyList m_style;
58  void writeStyle(bool isClosed=true);
59  void drawPolySomething(const ::WPXPropertyListVector &vertices, bool isClosed);
60 
61  std::ostringstream m_outputSink;
63 };
64 
65 } // namespace libcdr
66 
67 #endif // __CDRSVGGENERATOR_H__
68 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libcdr by doxygen 1.8.3.1