~ubuntu-branches/ubuntu/trusty/libwpd/trusty

« back to all changes in this revision

Viewing changes to src/lib/WP42ContentListener.h

  • Committer: Bazaar Package Importer
  • Author(s): Rene Engelhard
  • Date: 2006-06-11 23:56:17 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060611235617-ce504k38fuqe8twa
Tags: 0.8.5-2
* dpatch'ize 
* add patch from upstream fixing WP5 font handling regression

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* libwpd
 
2
 * Copyright (C) 2003 William Lachance (william.lachance@sympatico.ca)
 
3
 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
 
4
 * Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Library General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General Public
 
17
 * License along with this library; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
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 WP42CONTENTLISTENER_H
 
28
#define WP42CONTENTLISTENER_H
 
29
 
 
30
#include "WP42Listener.h"
 
31
#include "WPXContentListener.h"
 
32
#include "WPXHLListenerImpl.h"
 
33
 
 
34
typedef struct _WP42ContentParsingState WP42ContentParsingState;
 
35
struct _WP42ContentParsingState
 
36
{
 
37
        _WP42ContentParsingState();
 
38
        ~_WP42ContentParsingState();
 
39
        WPXString m_textBuffer;
 
40
};
 
41
 
 
42
class WP42ContentListener : public WP42Listener, public WPXContentListener
 
43
{
 
44
public:
 
45
        WP42ContentListener(std::list<WPXPageSpan> &pageList, WPXHLListenerImpl *listenerImpl);
 
46
        ~WP42ContentListener();
 
47
 
 
48
        void startDocument() { WPXContentListener::startDocument(); };
 
49
        void setAlignmentCharacter(const uint16_t character) {};
 
50
        void setLeaderCharacter(const uint16_t character, const uint8_t numberOfSpaces) {};
 
51
        void defineTabStops(const bool isRelative, const std::vector<WPXTabStop> &tabStops, 
 
52
                                    const std::vector<bool> &usePreWP9LeaderMethods) {};
 
53
        void insertCharacter(const uint16_t character);
 
54
        void insertTab(const uint8_t tabType, float tabPosition);
 
55
        void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); };
 
56
        void handleLineBreak() {};
 
57
        void insertEOL();
 
58
        void attributeChange(const bool isOn, const uint8_t attribute);
 
59
        void lineSpacingChange(const float lineSpacing) {};
 
60
        void spacingAfterParagraphChange(const float spacingRelative, const float spacingAbsolute) {};
 
61
        void justificationChange(const uint8_t justification) {};
 
62
        void pageMarginChange(const uint8_t side, const uint16_t margin) {};
 
63
        void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation, const bool isPersistent) {};
 
64
        void marginChange(const uint8_t side, const uint16_t margin) {};
 
65
        void paragraphMarginChange(const uint8_t side, const int16_t margin) {};
 
66
        void indentFirstLineChange(const int16_t offset) {};
 
67
        void columnChange(const WPXTextColumnType typeColumn, const uint8_t numColumns, const std::vector<float> &columnWidth,
 
68
                                  const std::vector<bool> &isFixedWidth) {};
 
69
        void endDocument();
 
70
 
 
71
        void defineTable(const uint8_t position, const uint16_t leftOffset) {};
 
72
        void addTableColumnDefinition(const uint32_t width, const uint32_t leftGutter, const uint32_t rightGutter,
 
73
                                const uint32_t attributes, const uint8_t alignment) {};
 
74
        void startTable() {};
 
75
        void insertRow(const uint16_t rowHeight, const bool isMinimumHeight, const bool isHeaderRow) {};
 
76
        void insertCell(const uint8_t colSpan, const uint8_t rowSpan, const bool boundFromLeft, const bool boundFromAbove,
 
77
                                const uint8_t borderBits, const RGBSColor * cellFgColor, const RGBSColor * cellBgColor, 
 
78
                                const RGBSColor * cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment, 
 
79
                                const bool useCellAttributes, const uint32_t cellAttributes) {};
 
80
        void endTable() {};
 
81
 
 
82
protected:
 
83
        void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0) {}
 
84
 
 
85
private:
 
86
        void _flushText();
 
87
        void _changeList() {};
 
88
 
 
89
        WP42ContentParsingState *m_parseState;
 
90
};
 
91
 
 
92
#endif /* WP42LISTENER_H */