merge the formfield patch from ooo-build
[ooovba.git] / writerperfect / source / wpgimp / OdgExporter.hxx
bloba974dcf2a747147155103a4b1bce07bc6b8ba5b2
1 /* libwpg
2 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3 * Copyright (C) 2007 Fridrich Strba (fridrich_strba@bluewin.ch)
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.
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.
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
20 * For further information visit http://libwpg.sourceforge.net
23 /* "This product is not manufactured, approved, or supported by
24 * Corel Corporation or Corel Corporation Limited."
27 #ifndef __ODGEXPORTER_HXX__
28 #define __ODGEXPORTER_HXX__
30 #include <iostream>
31 #include <sstream>
32 #include <string>
34 #include <libwpd/WPXString.h>
35 #include <libwpg/libwpg.h>
36 #include <libwpg/WPGBinaryData.h>
37 #include "filter/DocumentElement.hxx"
38 #include "filter/DocumentHandler.hxx"
40 class OdgExporter : public libwpg::WPGPaintInterface {
41 public:
42 OdgExporter(DocumentHandler *pHandler);
43 ~OdgExporter();
45 void startDocument(double width, double height);
46 void startGraphics(double width, double height) { startDocument(width, height); }
47 void endDocument();
48 void endGraphics() { endDocument(); };
49 void startLayer(unsigned int id);
50 void endLayer(unsigned int id);
52 void setPen(const libwpg::WPGPen& pen);
53 void setBrush(const libwpg::WPGBrush& brush);
54 void setFillRule(FillRule rule);
56 void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
57 void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
58 void drawPolygon(const libwpg::WPGPointArray& vertices);
59 void drawPath(const libwpg::WPGPath& path);
60 void drawBitmap(const libwpg::WPGBitmap& bitmap);
61 void drawImageObject(const libwpg::WPGBinaryData& binaryData);
63 private:
64 std::vector <DocumentElement *> mpBodyElements;
65 std::vector <DocumentElement *> mpStylesElements;
66 DocumentHandler *mpHandler;
68 libwpg::WPGPen m_pen;
69 libwpg::WPGBrush m_brush;
70 FillRule m_fillRule;
71 int m_gradientIndex;
72 int m_dashIndex;
73 int m_styleIndex;
74 void writeStyle();
75 WPXString doubleToString(const double value);
78 #endif // __ODGEXPORTER_HXX__