2
* Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
3
* Copyright (C) 2005-2006 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 Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19
* For further information visit http://libwpd.sourceforge.net
22
/* "This product is not manufactured, approved, or supported by
23
* Corel Corporation or Corel Corporation Limited."
26
#ifndef WP3CONTENTLISTENER_H
27
#define WP3CONTENTLISTENER_H
29
#include "WP3Listener.h"
30
#include "WPXHLListenerImpl.h"
31
#include "WPXContentListener.h"
32
#include "libwpd_internal.h"
33
#include "WP3SubDocument.h"
35
typedef struct _WP3ContentParsingState WP3ContentParsingState;
36
struct _WP3ContentParsingState
38
_WP3ContentParsingState();
39
~_WP3ContentParsingState();
42
WPXString m_textBuffer;
43
RGBSColor * m_cellFillColor;
44
WPXString m_noteReference;
46
WPXTableList m_tableList;
49
class WP3ContentListener : public WP3Listener, public WPXContentListener
52
WP3ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP3SubDocument *> &subDocuments, WPXHLListenerImpl *listenerImpl);
53
~WP3ContentListener();
55
void startDocument() { WPXContentListener::startDocument(); };
56
void setAlignmentCharacter(const uint16_t character) {};
57
void setLeaderCharacter(const uint16_t character, const uint8_t numberOfSpaces) {};
58
void defineTabStops(const bool isRelative, const std::vector<WPXTabStop> &tabStops,
59
const std::vector<bool> &usePreWP9LeaderMethods) {};
60
void insertCharacter(const uint16_t character);
61
void insertTab(const uint8_t tabType, float tabPosition);
62
void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); };
63
void handleLineBreak() {};
65
void attributeChange(const bool isOn, const uint8_t attribute);
66
void lineSpacingChange(const float lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); };
67
void spacingAfterParagraphChange(const float spacingRelative, const float spacingAbsolute) {};
68
void pageMarginChange(const uint8_t side, const uint16_t margin) {};
69
void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation, const bool isPersistent) {};
70
void marginChange(const uint8_t side, const uint16_t margin);
71
void paragraphMarginChange(const uint8_t side, const int16_t margin) {};
72
void indentFirstLineChange(const int16_t offset);
73
void columnChange(const WPXTextColumnType columnType, const uint8_t numColumns, const std::vector<float> &columnWidth,
74
const std::vector<bool> &isFixedWidth);
77
void defineTable(const uint8_t position, const uint16_t leftOffset);
78
void addTableColumnDefinition(const uint32_t width, const uint32_t leftGutter, const uint32_t rightGutter,
79
const uint32_t attributes, const uint8_t alignment);
85
void setTableCellSpan(const uint16_t colSpan, const uint16_t rowSpan);
86
void setTableCellFillColor(const RGBSColor * cellFillColor);
88
void undoChange(const uint8_t undoType, const uint16_t undoLevel);
89
void justificationChange(const uint8_t justification);
90
void setTextColor(const RGBSColor * fontColor);
91
void setTextFont(const WPXString fontName);
92
void setFontSize(const uint16_t fontSize);
93
void insertPageNumber(const WPXString &pageNumber);
94
void insertNoteReference(const WPXString ¬eReference);
95
void insertNote(const WPXNoteType noteType, WP3SubDocument *subDocument);
96
void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, WP3SubDocument *subDocument);
97
void suppressPage(const uint16_t suppressCode) {};
100
void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
101
void _openParagraph();
105
void _changeList() {};
107
WP3ContentParsingState *m_parseState;
108
std::vector<WP3SubDocument *> &m_subDocuments;
111
#endif /* WP3CONTENTLISTENER_H */