2
* Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
3
* Copyright (C) 2002 Marc Maurer (j.m.maurer@student.utwente.nl)
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 WPXHLLISTENER_H
27
#define WPXHLLISTENER_H
29
#include "WPXLLListener.h"
30
#include "WPXHLListenerImpl.h"
34
typedef struct _WPXDocumentMetaData WPXDocumentMetaData;
35
struct _WPXDocumentMetaData
39
UCSString m_publisher;
44
UCSString m_descriptiveName;
45
UCSString m_descriptiveType;
48
typedef struct _WPXParsingState WPXParsingState;
49
struct _WPXParsingState
51
_WPXParsingState(bool sectionAttributesChanged=true);
52
~_WPXParsingState() {}
56
UCSString m_textBeforeNumber;
57
UCSString m_textBeforeDisplayReference;
58
UCSString m_numberText;
59
UCSString m_textAfterDisplayReference;
60
UCSString m_textAfterNumber;
62
guint32 m_textAttributeBits;
63
bool m_textAttributesChanged;
67
bool m_isParagraphColumnBreak;
68
bool m_isParagraphPageBreak;
69
/* guint8 m_paragraphJustification;
70
guint8 m_tempParagraphJustification;
71
float m_paragraphLineSpacing;
73
bool m_isSectionOpened;
75
bool m_isParagraphOpened;
76
bool m_isParagraphClosed;
78
guint m_numDeferredParagraphBreaks;
79
/* guint m_numRemovedParagraphBreaks;
81
WPXTable *m_currentTable;
82
int m_nextTableIndice;
83
int m_currentTableCol;
84
int m_currentTableRow;
86
bool m_isTableRowOpened;
87
bool m_isTableColumnOpened;
88
bool m_isTableCellOpened;
90
bool m_isPageSpanOpened;
91
int m_nextPageSpanIndice;
92
int m_numPagesRemainingInSpan;
94
bool m_sectionAttributesChanged;
97
float m_pageMarginLeft;
98
float m_pageMarginRight;
99
float m_paragraphMarginLeft;
100
float m_paragraphMarginRight;
102
/*gint32 m_currentRow;
103
gint32 m_currentColumn;
105
stack<int> m_listLevelStack;
106
guint16 m_currentOutlineHash; // probably should replace Hash with Key in these sorts of cases
107
guint8 m_oldListLevel;
108
guint8 m_currentListLevel;
109
WP6StyleStateSequence m_styleStateSequence;
110
bool m_putativeListElementHasParagraphNumber;
111
bool m_putativeListElementHasDisplayReferenceNumber;
119
class WPXHLListener : public WPXLLListener
122
WPXHLListener(vector<WPXPageSpan *> *pageList, WPXHLListenerImpl *listenerImpl);
123
WPXHLListener::~WPXHLListener();
125
void startDocument();
126
void handleSubDocument(guint16 textPID);
128
WPXParsingState *m_ps; // parse state
129
WPXHLListenerImpl * m_listenerImpl;
130
WPXDocumentMetaData m_metaData;
131
vector <WPXPageSpan *> *m_pageList;
134
virtual void _handleSubDocument(guint16 textPID) = 0;
137
void _closeSection();
139
void _openPageSpan();
140
void _closePageSpan();
142
// void _openParagraph();
143
void _closeParagraph();
149
#endif /* WPXHLLISTENER_H */