00001 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */ 00002 00003 /* libmwaw 00004 * Version: MPL 2.0 / LGPLv2+ 00005 * 00006 * The contents of this file are subject to the Mozilla Public License Version 00007 * 2.0 (the "License"); you may not use this file except in compliance with 00008 * the License or as specified alternatively below. You may obtain a copy of 00009 * the License at http://www.mozilla.org/MPL/ 00010 * 00011 * Software distributed under the License is distributed on an "AS IS" basis, 00012 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 00013 * for the specific language governing rights and limitations under the 00014 * License. 00015 * 00016 * Major Contributor(s): 00017 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org) 00018 * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl) 00019 * Copyright (C) 2002 William Lachance (wrlach@gmail.com) 00020 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net) 00021 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch) 00022 * Copyright (C) 2006, 2007 Andrew Ziem 00023 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr) 00024 * 00025 * 00026 * All Rights Reserved. 00027 * 00028 * For minor contributions see the git repository. 00029 * 00030 * Alternatively, the contents of this file may be used under the terms of 00031 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), 00032 * in which case the provisions of the LGPLv2+ are applicable 00033 * instead of those above. 00034 */ 00035 00036 #ifndef __MWAW_GRAPHIC_INTERFACE_HXX__ 00037 #define __MWAW_GRAPHIC_INTERFACE_HXX__ 00038 00039 #include <libwpd/libwpd.h> 00040 #include <libmwaw_internal.hxx> 00041 00042 class MWAWPropertyHandlerEncoder; 00043 00044 namespace MWAWGraphicInterfaceInternal 00045 { 00046 struct State; 00047 } 00052 class MWAWGraphicInterface 00053 { 00054 public: 00056 MWAWGraphicInterface(); 00058 ~MWAWGraphicInterface(); 00060 bool getBinaryResult(WPXBinaryData &result, std::string &mimeType); 00061 00062 // none of the other callback functions will be called before this function is called 00063 void startDocument(const ::WPXPropertyList &propList); 00064 00065 // none of the other callback functions will be called after this function is called 00066 void endDocument(); 00067 00123 void setDocumentMetaData(const WPXPropertyList &propList); 00124 00125 void startPage(const ::WPXPropertyList &propList); 00126 00127 void endPage(); 00128 00129 void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient); 00130 00131 void startLayer(const ::WPXPropertyList &propList); 00132 00133 void endLayer(); 00134 00135 void startEmbeddedGraphics(const ::WPXPropertyList &propList); 00136 00137 void endEmbeddedGraphics(); 00138 00139 // Different primitive shapes 00140 void drawRectangle(const ::WPXPropertyList &propList); 00141 00142 void drawEllipse(const ::WPXPropertyList &propList); 00143 00144 void drawPolygon(const ::WPXPropertyListVector &vertices); 00145 00146 void drawPolyline(const ::WPXPropertyListVector &vertices); 00147 00148 void drawPath(const ::WPXPropertyListVector &path); 00149 00150 // Embedded binary/raster data 00151 void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData); 00152 00153 // Embedded text object 00154 void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path); 00155 void endTextObject(); 00156 00160 void insertTab(); 00161 00165 void insertSpace(); 00166 00171 void insertText(const WPXString &text); 00172 00176 void insertLineBreak(); 00177 00186 void insertField(const WPXString &type, const WPXPropertyList &propList); 00187 00200 void defineOrderedListLevel(const WPXPropertyList &propList); 00210 void defineUnorderedListLevel(const WPXPropertyList &propList); 00217 void openOrderedListLevel(const WPXPropertyList &/*propList*/) {} 00218 00225 void openUnorderedListLevel(const WPXPropertyList &/*propList*/) {} 00226 00230 void closeOrderedListLevel() {} 00231 00235 void closeUnorderedListLevel() {} 00236 00254 void openListElement(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); 00255 00259 void closeListElement(); 00260 00278 void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); 00279 00283 void closeParagraph(); 00284 00301 void openSpan(const WPXPropertyList &propList); 00302 00306 void closeSpan(); 00307 00308 protected: 00310 shared_ptr<MWAWGraphicInterfaceInternal::State> m_state; 00311 }; 00312 00313 #endif 00314 00315 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: