WP5Listener.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpd
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) 2003 William Lachance (wrlach@gmail.com)
11 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
12 * Copyright (C) 2005-2007 Fridrich Strba (fridrich.strba@bluewin.ch)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 *
21 * For further information visit http://libwpd.sourceforge.net
22 */
23
24 /* "This product is not manufactured, approved, or supported by
25 * Corel Corporation or Corel Corporation Limited."
26 */
27
28 #ifndef WP5LISTENER_H
29 #define WP5LISTENER_H
30
31 #include <memory>
32 #include <vector>
33 #include <librevenge/librevenge.h>
34 #include "libwpd_internal.h"
35
36 class WP5SubDocument;
37 class WP5PrefixData;
38 class WP5GeneralPacketData;
39
40 class WP5Listener
41 {
42 public:
43 WP5Listener();
44 virtual ~WP5Listener() {}
45
46 virtual void startDocument() = 0;
47 virtual void startSubDocument() = 0;
48 virtual void setFont(const librevenge::RVNGString &fontName, double fontSize) = 0;
49 virtual void setTabs(const std::vector<WPXTabStop> &tabStops, unsigned short tabOffset) = 0;
50 virtual void insertCharacter(unsigned character) = 0;
51 virtual void insertTab(unsigned char tabType, double tabPosition) = 0;
52 virtual void insertIndent(unsigned char indentType, double indentPosition) = 0;
53 virtual void insertEOL() = 0;
54 virtual void insertBreak(unsigned char breakType) = 0;
55 virtual void lineSpacingChange(double lineSpacing) = 0;
56 virtual void justificationChange(unsigned char justification) = 0;
57 virtual void characterColorChange(unsigned char red, unsigned char green, unsigned char blue) = 0;
58 virtual void attributeChange(bool isOn, unsigned char attribute) = 0;
59 virtual void pageMarginChange(unsigned char side, unsigned short margin) = 0;
60 virtual void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation) = 0;
61 virtual void marginChange(unsigned char side, unsigned short margin) = 0;
62 virtual void endDocument() = 0;
63 virtual void endSubDocument() = 0;
64
65 virtual void defineTable(unsigned char position, unsigned short leftOffset) = 0;
66 virtual void addTableColumnDefinition(unsigned width, unsigned leftGutter, unsigned rightGutter,
67 unsigned attributes, unsigned char alignment) = 0;
68 virtual void startTable() = 0;
69 virtual void insertRow(unsigned short rowHeight, bool isMinimumHeight, bool isHeaderRow) = 0;
70 virtual void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits,
71 const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
72 const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
73 bool useCellAttributes, unsigned cellAttributes) = 0;
74 virtual void endTable() = 0;
75
76 virtual void insertNoteReference(const librevenge::RVNGString &noteReference) = 0;
77 virtual void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument) = 0;
78 virtual void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr<WP5SubDocument> &subDocument) = 0;
79 virtual void suppressPageCharacteristics(unsigned char suppressCode) = 0;
80
81 virtual void boxOn(unsigned char positionAndType, unsigned char alignment, unsigned short width, unsigned short height, unsigned short x, unsigned short y) = 0;
82 virtual void boxOff() = 0;
83 virtual void insertGraphicsData(const librevenge::RVNGBinaryData *data) = 0;
84
85 void setPrefixData(WP5PrefixData *prefixData)
86 {
87 m_prefixData = prefixData;
88 }
89 const WP5GeneralPacketData *getGeneralPacketData(const int type) const;
90
91 private:
92 WP5Listener(const WP5Listener &);
93 WP5Listener &operator=(const WP5Listener &);
94 WP5PrefixData *m_prefixData;
95 };
96
97 #endif /* WP5LISTENER_H */
98 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP5GeneralPacketData
Definition: WP5GeneralPacketData.h:33
WP5Listener
Definition: WP5Listener.h:41
WP5Listener::lineSpacingChange
virtual void lineSpacingChange(double lineSpacing)=0
WP5Listener::justificationChange
virtual void justificationChange(unsigned char justification)=0
WP5Listener::addTableColumnDefinition
virtual void addTableColumnDefinition(unsigned width, unsigned leftGutter, unsigned rightGutter, unsigned attributes, unsigned char alignment)=0
WP5Listener::insertIndent
virtual void insertIndent(unsigned char indentType, double indentPosition)=0
WP5Listener::setPrefixData
void setPrefixData(WP5PrefixData *prefixData)
Definition: WP5Listener.h:85
WP5Listener::marginChange
virtual void marginChange(unsigned char side, unsigned short margin)=0
WP5Listener::suppressPageCharacteristics
virtual void suppressPageCharacteristics(unsigned char suppressCode)=0
WP5Listener::startSubDocument
virtual void startSubDocument()=0
WP5Listener::insertBreak
virtual void insertBreak(unsigned char breakType)=0
WP5Listener::insertCell
virtual void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits, const RGBSColor *cellFgColor, const RGBSColor *cellBgColor, const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment, bool useCellAttributes, unsigned cellAttributes)=0
WP5Listener::WP5Listener
WP5Listener(const WP5Listener &)
WP5Listener::insertNoteReference
virtual void insertNoteReference(const librevenge::RVNGString &noteReference)=0
WP5Listener::boxOn
virtual void boxOn(unsigned char positionAndType, unsigned char alignment, unsigned short width, unsigned short height, unsigned short x, unsigned short y)=0
WP5Listener::~WP5Listener
virtual ~WP5Listener()
Definition: WP5Listener.h:44
WP5Listener::operator=
WP5Listener & operator=(const WP5Listener &)
WP5Listener::insertTab
virtual void insertTab(unsigned char tabType, double tabPosition)=0
WP5Listener::startTable
virtual void startTable()=0
WP5Listener::startDocument
virtual void startDocument()=0
WP5Listener::insertCharacter
virtual void insertCharacter(unsigned character)=0
WP5Listener::insertGraphicsData
virtual void insertGraphicsData(const librevenge::RVNGBinaryData *data)=0
WP5Listener::m_prefixData
WP5PrefixData * m_prefixData
Definition: WP5Listener.h:94
WP5Listener::setFont
virtual void setFont(const librevenge::RVNGString &fontName, double fontSize)=0
WP5Listener::endDocument
virtual void endDocument()=0
WP5Listener::endSubDocument
virtual void endSubDocument()=0
WP5Listener::getGeneralPacketData
const WP5GeneralPacketData * getGeneralPacketData(const int type) const
Definition: WP5Listener.cpp:39
WP5Listener::insertEOL
virtual void insertEOL()=0
WP5Listener::pageFormChange
virtual void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation)=0
WP5Listener::endTable
virtual void endTable()=0
WP5Listener::insertRow
virtual void insertRow(unsigned short rowHeight, bool isMinimumHeight, bool isHeaderRow)=0
WP5Listener::setTabs
virtual void setTabs(const std::vector< WPXTabStop > &tabStops, unsigned short tabOffset)=0
WP5Listener::attributeChange
virtual void attributeChange(bool isOn, unsigned char attribute)=0
WP5Listener::pageMarginChange
virtual void pageMarginChange(unsigned char side, unsigned short margin)=0
WP5Listener::boxOff
virtual void boxOff()=0
WP5Listener::insertNote
virtual void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument)=0
WP5Listener::headerFooterGroup
virtual void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr< WP5SubDocument > &subDocument)=0
WP5Listener::defineTable
virtual void defineTable(unsigned char position, unsigned short leftOffset)=0
WP5Listener::characterColorChange
virtual void characterColorChange(unsigned char red, unsigned char green, unsigned char blue)=0
WP5Listener::WP5Listener
WP5Listener()
Definition: WP5Listener.cpp:34
WP5PrefixData
Definition: WP5PrefixData.h:35
WP5SubDocument
Definition: WP5SubDocument.h:34
libwpd_internal.h
WPXFormOrientation
WPXFormOrientation
Definition: libwpd_internal.h:105
WPXVerticalAlignment
WPXVerticalAlignment
Definition: libwpd_internal.h:107
WPXNoteType
WPXNoteType
Definition: libwpd_internal.h:93
RGBSColor
Definition: libwpd_internal.h:167