OdtGenerator.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libodfgen
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) 2002-2004 William Lachance (wrlach@gmail.com)
11 * Copyright (C) 2004 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://libwpd.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 _ODTGENERATOR_HXX_
28 #define _ODTGENERATOR_HXX_
29
30 #include <librevenge/librevenge.h>
31
32 #include "libodfgen-api.hxx"
33 #include "OdfDocumentHandler.hxx"
34
35 class OdtGeneratorPrivate;
36 class OdfGenerator;
37
43 class ODFGENAPI OdtGenerator : public librevenge::RVNGTextInterface
44 {
45 public:
46 OdtGenerator();
47 ~OdtGenerator() override;
48 void addDocumentHandler(OdfDocumentHandler *pHandler, const OdfStreamType streamType);
49 librevenge::RVNGStringVector getObjectNames() const;
50 bool getObjectContent(librevenge::RVNGString const &objectName, OdfDocumentHandler *pHandler);
51
52 void setDocumentMetaData(const librevenge::RVNGPropertyList &propList) override;
53 void startDocument(const librevenge::RVNGPropertyList &) override;
54 void endDocument() override;
55
56 void defineEmbeddedFont(const librevenge::RVNGPropertyList &propList) override;
57
58 void definePageStyle(const librevenge::RVNGPropertyList &) override;
59 void openPageSpan(const librevenge::RVNGPropertyList &propList) override;
60 void closePageSpan() override;
61
62 void defineSectionStyle(const librevenge::RVNGPropertyList &) override;
63 void openSection(const librevenge::RVNGPropertyList &propList) override;
64 void closeSection() override;
65
66 void openHeader(const librevenge::RVNGPropertyList &propList) override;
67 void closeHeader() override;
68 void openFooter(const librevenge::RVNGPropertyList &propList) override;
69 void closeFooter() override;
70
71 void defineParagraphStyle(const librevenge::RVNGPropertyList &propList) override;
72 void openParagraph(const librevenge::RVNGPropertyList &propList) override;
73 void closeParagraph() override;
74
75 void defineCharacterStyle(const librevenge::RVNGPropertyList &propList) override;
76 void openSpan(const librevenge::RVNGPropertyList &propList) override;
77 void closeSpan() override;
78
79 void openLink(const librevenge::RVNGPropertyList &propList) override;
80 void closeLink() override;
81
82 void insertTab() override;
83 void insertSpace() override;
84 void insertText(const librevenge::RVNGString &text) override;
85 void insertLineBreak() override;
86 void insertField(const librevenge::RVNGPropertyList &propList) override;
87
88 void openOrderedListLevel(const librevenge::RVNGPropertyList &propList) override;
89 void openUnorderedListLevel(const librevenge::RVNGPropertyList &propList) override;
90 void closeOrderedListLevel() override;
91 void closeUnorderedListLevel() override;
92 void openListElement(const librevenge::RVNGPropertyList &propList) override;
93 void closeListElement() override;
94
95 void openFootnote(const librevenge::RVNGPropertyList &propList) override;
96 void closeFootnote() override;
97 void openEndnote(const librevenge::RVNGPropertyList &propList) override;
98 void closeEndnote() override;
99 void openComment(const librevenge::RVNGPropertyList &propList) override;
100 void closeComment() override;
101 void openTextBox(const librevenge::RVNGPropertyList &propList) override;
102 void closeTextBox() override;
103
104 void openTable(const librevenge::RVNGPropertyList &propList) override;
105 void openTableRow(const librevenge::RVNGPropertyList &propList) override;
106 void closeTableRow() override;
107 void openTableCell(const librevenge::RVNGPropertyList &propList) override;
108 void closeTableCell() override;
109 void insertCoveredTableCell(const librevenge::RVNGPropertyList &propList) override;
110 void closeTable() override;
111
112 //
113 // simple Graphic
114 //
115
116 void openGroup(const librevenge::RVNGPropertyList &propList) override;
117 void closeGroup() override;
118
119 void defineGraphicStyle(const librevenge::RVNGPropertyList &propList) override;
120 void drawRectangle(const librevenge::RVNGPropertyList &propList) override;
121 void drawEllipse(const librevenge::RVNGPropertyList &propList) override;
122 void drawPolygon(const librevenge::RVNGPropertyList &propList) override;
123 void drawPolyline(const librevenge::RVNGPropertyList &propList) override;
124 void drawPath(const librevenge::RVNGPropertyList &propList) override;
125 void drawConnector(const librevenge::RVNGPropertyList &propList) override;
126
127 void openFrame(const librevenge::RVNGPropertyList &propList) override;
128 void closeFrame() override;
129
130 void insertBinaryObject(const librevenge::RVNGPropertyList &propList) override;
131 void insertEquation(const librevenge::RVNGPropertyList &propList) override;
132
139 void registerEmbeddedObjectHandler(const librevenge::RVNGString &mimeType, OdfEmbeddedObject objectHandler);
140
150 void registerEmbeddedImageHandler(const librevenge::RVNGString &mimeType, OdfEmbeddedImage imageHandler);
152 void initStateWith(OdfGenerator const &orig);
153
154 private:
155 OdtGenerator(OdtGenerator const &);
156 OdtGenerator &operator=(OdtGenerator const &);
157
158 OdtGeneratorPrivate *mpImpl;
159 };
160 #endif
161
162 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
OdtGenerator::mpImpl
OdtGeneratorPrivate * mpImpl
Definition: OdtGenerator.hxx:158
OdfDocumentHandler
XML writer.
Definition: OdfDocumentHandler.hxx:65
OdfEmbeddedImage
bool(* OdfEmbeddedImage)(const librevenge::RVNGBinaryData &input, librevenge::RVNGBinaryData &output)
Handler for embedded images.
Definition: OdfDocumentHandler.hxx:56
libodfgen-api.hxx
OdfStreamType
OdfStreamType
Type of ODF content a generator should produce.
Definition: OdfDocumentHandler.hxx:35
ODFGENAPI
#define ODFGENAPI
Definition: libodfgen-api.hxx:36
OdtGenerator
A generator for text documents.
Definition: OdtGenerator.hxx:43
OdfDocumentHandler.hxx
OdfEmbeddedObject
bool(* OdfEmbeddedObject)(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
Handler for embedded objects.
Definition: OdfDocumentHandler.hxx:45