Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

WP1ContentListener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
00003  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
00004  * Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00019  *
00020  * For further information visit http://libwpd.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef WP1CONTENTLISTENER_H
00028 #define WP1CONTENTLISTENER_H
00029 
00030 #include "WP1Listener.h"
00031 #include "WPXContentListener.h"
00032 
00033 class WP1SubDocument;
00034 
00035 typedef struct _WP1ContentParsingState WP1ContentParsingState;
00036 struct _WP1ContentParsingState
00037 {
00038         _WP1ContentParsingState();
00039         ~_WP1ContentParsingState();
00040         WPXString m_textBuffer;
00041         int m_numDeferredTabs;
00042         int m_footNoteNumber, m_endNoteNumber;
00043 private:
00044         _WP1ContentParsingState(const _WP1ContentParsingState&);
00045         _WP1ContentParsingState& operator=(const _WP1ContentParsingState&);
00046 };
00047 
00048 class WP1ContentListener : public WP1Listener, protected WPXContentListener
00049 {
00050 public:
00051         WP1ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP1SubDocument *> &subDocuments, WPXHLListenerImpl *listenerImpl);
00052         ~WP1ContentListener();
00053 
00054         void startDocument() { WPXContentListener::startDocument(); }
00055         void insertCharacter(const uint16_t character);
00056         void insertExtendedCharacter(const uint8_t extendedCharacter);
00057         void insertTab();
00058         void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); }
00059         void insertEOL();
00060         void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument);
00061         void attributeChange(const bool isOn, const uint8_t attribute);
00062         void fontPointSize(const uint8_t pointSize);
00063         void fontId(const uint16_t id);
00064         void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
00065         void topMarginSet(const uint16_t /* topMargin */) {}
00066         void bottomMarginSet(const uint16_t /* bottomMargin */) {}
00067         void leftIndent(const uint16_t leftMarginOffset);
00068         void leftRightIndent(const uint16_t leftRightMarginOffset);
00069         void leftMarginRelease(const uint16_t release);
00070         void setTabs(const std::vector<WPXTabStop> tabStops);
00071         void headerFooterGroup(const uint8_t headerFooterDefinition, WP1SubDocument *subDocument);
00072         void suppressPageCharacteristics(const uint8_t /* suppressCode */) {}
00073         void justificationChange(const uint8_t justification);
00074         void lineSpacingChange(const uint8_t spacing) { WPXContentListener::lineSpacingChange((float)((double)spacing/2.0f)); }
00075         void flushRightOn();
00076         void flushRightOff() {}
00077         void centerOn();
00078         void centerOff() {}
00079         void endDocument() { WPXContentListener::endDocument(); };
00080 
00081 protected:
00082         using WPXContentListener::lineSpacingChange;
00083         void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00084 
00085         void _flushText();
00086         void _changeList() {};
00087 
00088 private:
00089         WP1ContentParsingState *m_parseState;
00090         std::vector<WP1SubDocument *> &m_subDocuments;
00091         WP1ContentListener(const WP1ContentListener&);
00092         WP1ContentListener& operator=(WP1ContentListener&);
00093 };
00094 
00095 #endif /* WP1LISTENER_H */

Generated on Sat Aug 20 05:20:56 2022 for libwpd by doxygen 1.3.5