OdtGenerator.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libodfgen
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2002-2004 William Lachance (wrlach@gmail.com)
00011  * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
00012  *
00013  * For minor contributions see the git repository.
00014  *
00015  * Alternatively, the contents of this file may be used under the terms
00016  * of the GNU Lesser General Public License Version 2.1 or later
00017  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00018  * applicable instead of those above.
00019  *
00020  * For further information visit http://libwpd.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef _ODTGENERATOR_HXX_
00028 #define _ODTGENERATOR_HXX_
00029 
00030 #include <libwpd/libwpd.h>
00031 
00032 #include "OdfDocumentHandler.hxx"
00033 
00040 typedef bool (*OdfEmbeddedObject)(const WPXBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType);
00041 
00048 typedef bool (*OdfEmbeddedImage)(const WPXBinaryData &input, WPXBinaryData &output);
00049 
00050 class OdtGeneratorPrivate;
00051 
00057 class OdtGenerator : public WPXDocumentInterface
00058 {
00059 public:
00060         OdtGenerator(OdfDocumentHandler *pHandler, const OdfStreamType streamType);
00061         ~OdtGenerator();
00062 
00063         void setDocumentMetaData(const WPXPropertyList &propList);
00064         void startDocument();
00065         void endDocument();
00066 
00067         void definePageStyle(const WPXPropertyList &);
00068         void openPageSpan(const WPXPropertyList &propList);
00069         void closePageSpan();
00070 
00071         void defineSectionStyle(const WPXPropertyList &, const WPXPropertyListVector &);
00072         void openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns);
00073         void closeSection();
00074 
00075         void openHeader(const WPXPropertyList &propList);
00076         void closeHeader();
00077         void openFooter(const WPXPropertyList &propList);
00078         void closeFooter();
00079 
00080         void defineParagraphStyle(const WPXPropertyList &, const WPXPropertyListVector &);
00081         void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
00082         void closeParagraph();
00083 
00084         void defineCharacterStyle(const WPXPropertyList &);
00085         void openSpan(const WPXPropertyList &propList);
00086         void closeSpan();
00087 
00088         void insertTab();
00089         void insertSpace();
00090         void insertText(const WPXString &text);
00091         void insertLineBreak();
00092         void insertField(const WPXString &type, const WPXPropertyList &propList);
00093 
00094         void defineOrderedListLevel(const WPXPropertyList &propList);
00095         void defineUnorderedListLevel(const WPXPropertyList &propList);
00096         void openOrderedListLevel(const WPXPropertyList &propList);
00097         void openUnorderedListLevel(const WPXPropertyList &propList);
00098         void closeOrderedListLevel();
00099         void closeUnorderedListLevel();
00100         void openListElement(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
00101         void closeListElement();
00102 
00103         void openFootnote(const WPXPropertyList &propList);
00104         void closeFootnote();
00105         void openEndnote(const WPXPropertyList &propList);
00106         void closeEndnote();
00107         void openComment(const WPXPropertyList &propList);
00108         void closeComment();
00109         void openTextBox(const WPXPropertyList &propList);
00110         void closeTextBox();
00111 
00112         void openTable(const WPXPropertyList &propList, const WPXPropertyListVector &columns);
00113         void openTableRow(const WPXPropertyList &propList);
00114         void closeTableRow();
00115         void openTableCell(const WPXPropertyList &propList);
00116         void closeTableCell();
00117         void insertCoveredTableCell(const WPXPropertyList &propList);
00118         void closeTable();
00119 
00120         void openFrame(const WPXPropertyList &propList);
00121         void closeFrame();
00122 
00123         void insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &data);
00124         void insertEquation(const WPXPropertyList &propList, const WPXString &data);
00125 
00132         void registerEmbeddedObjectHandler(const WPXString &mimeType, OdfEmbeddedObject objectHandler);
00133 
00143         void registerEmbeddedImageHandler(const WPXString &mimeType, OdfEmbeddedImage imageHandler);
00144 
00145 private:
00146         OdtGenerator(OdtGenerator const &);
00147         OdtGenerator &operator=(OdtGenerator const &);
00148 
00149         OdtGeneratorPrivate *mpImpl;
00150 };
00151 #endif
00152 
00153 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */