WP1ContentListener.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* libwpd
* Version: MPL 2.0 / LGPLv2.1+
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Major Contributor(s):
* Copyright (C) 2003 William Lachance (wrlach@gmail.com)
* Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU Lesser General Public License Version 2.1 or later
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
* applicable instead of those above.
*
* For further information visit http://libwpd.sourceforge.net
*/
/* "This product is not manufactured, approved, or supported by
* Corel Corporation or Corel Corporation Limited."
*/
#ifndef WP1CONTENTLISTENER_H
#define WP1CONTENTLISTENER_H
#include <memory>
#include "WP1Listener.h"
#include "WPXContentListener.h"
class WP1SubDocument;
struct WP1ContentParsingState
{
WP1ContentParsingState();
~WP1ContentParsingState();
librevenge::RVNGString m_textBuffer;
int m_numDeferredTabs;
int m_footNoteNumber, m_endNoteNumber;
private:
WP1ContentParsingState(const WP1ContentParsingState &);
WP1ContentParsingState &operator=(const WP1ContentParsingState &);
};
class WP1ContentListener : public WP1Listener, protected WPXContentListener
{
public:
WP1ContentListener(std::list<WPXPageSpan> &pageList, librevenge::RVNGTextInterface *documentInterface);
~WP1ContentListener() override;
void startDocument() override
{
WPXContentListener::startDocument();
}
void startSubDocument() override
{
WPXContentListener::startSubDocument();
}
void insertCharacter(unsigned character) override;
void insertExtendedCharacter(unsigned char extendedCharacter) override;
void insertTab() override;
void insertBreak(unsigned char breakType) override
{
WPXContentListener::insertBreak(breakType);
}
void insertEOL() override;
void insertNote(WPXNoteType noteType, WP1SubDocument *subDocument) override;
void attributeChange(bool isOn, unsigned char attribute) override;
void fontPointSize(unsigned char pointSize) override;
void fontId(unsigned short id) override;
void marginReset(unsigned short leftMargin, unsigned short rightMargin) override;
void topMarginSet(unsigned short /* topMargin */) override {}
void bottomMarginSet(unsigned short /* bottomMargin */) override {}
void leftIndent(unsigned short leftMarginOffset) override;
void leftRightIndent(unsigned short leftRightMarginOffset) override;
void leftMarginRelease(unsigned short release) override;
void setTabs(const std::vector<WPXTabStop> &tabStops) override;
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr<WP1SubDocument> &subDocument) override;
void suppressPageCharacteristics(unsigned char /* suppressCode */) override {}
void justificationChange(unsigned char justification) override;
void lineSpacingChange(unsigned char spacing) override
{
WPXContentListener::lineSpacingChange((double)((double)spacing/2.0));
}
void flushRightOn() override;
void flushRightOff() override {}
void centerOn() override;
void centerOff() override {}
void endDocument() override
{
WPXContentListener::endDocument();
}
void endSubDocument() override
{
WPXContentListener::endSubDocument();
}
void insertPicture(unsigned short width, unsigned short height, const librevenge::RVNGBinaryData &binaryData) override;
protected:
using WPXContentListener::lineSpacingChange;
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0) override;
void _flushText() override;
void _changeList() override {}
private:
std::unique_ptr<WP1ContentParsingState> m_parseState;
WP1ContentListener(const WP1ContentListener &);
WP1ContentListener &operator=(WP1ContentListener &);
};
#endif /* WP1LISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP1Listener.h
WPXContentListener.h
WP1ContentListener::attributeChange
void attributeChange(bool isOn, unsigned char attribute) override
Definition WP1ContentListener.cpp:170
WP1ContentListener::justificationChange
void justificationChange(unsigned char justification) override
Definition WP1ContentListener.cpp:470
WP1ContentListener::flushRightOff
void flushRightOff() override
Definition WP1ContentListener.h:91
WP1ContentListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char) override
Definition WP1ContentListener.h:84
WP1ContentListener::lineSpacingChange
void lineSpacingChange(unsigned char spacing) override
Definition WP1ContentListener.h:86
WP1ContentListener::insertPicture
void insertPicture(unsigned short width, unsigned short height, const librevenge::RVNGBinaryData &binaryData) override
Definition WP1ContentListener.cpp:533
WP1ContentListener::endSubDocument
void endSubDocument() override
Definition WP1ContentListener.h:98
WP1ContentListener::leftIndent
void leftIndent(unsigned short leftMarginOffset) override
Definition WP1ContentListener.cpp:411
WP1ContentListener::leftRightIndent
void leftRightIndent(unsigned short leftRightMarginOffset) override
Definition WP1ContentListener.cpp:429
WP1ContentListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice=0) override
Definition WP1ContentListener.cpp:555
WP1ContentListener::insertExtendedCharacter
void insertExtendedCharacter(unsigned char extendedCharacter) override
Definition WP1ContentListener.cpp:78
WP1ContentListener::endDocument
void endDocument() override
Definition WP1ContentListener.h:94
WP1ContentListener::_changeList
void _changeList() override
Definition WP1ContentListener.h:109
WP1ContentListener::marginReset
void marginReset(unsigned short leftMargin, unsigned short rightMargin) override
Definition WP1ContentListener.cpp:386
WP1ContentListener::insertTab
void insertTab() override
Definition WP1ContentListener.cpp:95
WP1ContentListener::centerOn
void centerOn() override
Definition WP1ContentListener.cpp:519
WP1ContentListener::insertCharacter
void insertCharacter(unsigned character) override
Definition WP1ContentListener.cpp:62
WP1ContentListener::WP1ContentListener
WP1ContentListener(const WP1ContentListener &)
WP1ContentListener::bottomMarginSet
void bottomMarginSet(unsigned short) override
Definition WP1ContentListener.h:78
WP1ContentListener::fontPointSize
void fontPointSize(unsigned char pointSize) override
Definition WP1ContentListener.cpp:215
WP1ContentListener::insertNote
void insertNote(WPXNoteType noteType, WP1SubDocument *subDocument) override
Definition WP1ContentListener.cpp:131
WP1ContentListener::flushRightOn
void flushRightOn() override
Definition WP1ContentListener.cpp:505
WP1ContentListener::m_parseState
std::unique_ptr< WP1ContentParsingState > m_parseState
Definition WP1ContentListener.h:112
WP1ContentListener::startSubDocument
void startSubDocument() override
Definition WP1ContentListener.h:60
WP1ContentListener::topMarginSet
void topMarginSet(unsigned short) override
Definition WP1ContentListener.h:77
WP1ContentListener::operator=
WP1ContentListener & operator=(WP1ContentListener &)
WP1ContentListener::setTabs
void setTabs(const std::vector< WPXTabStop > &tabStops) override
Definition WP1ContentListener.cpp:496
WP1ContentListener::fontId
void fontId(unsigned short id) override
Definition WP1ContentListener.cpp:225
WP1ContentListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition WP1ContentListener.h:67
WP1ContentListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP1SubDocument > &subDocument) override
Definition WP1ContentListener.cpp:492
WP1ContentListener::startDocument
void startDocument() override
Definition WP1ContentListener.h:56
WP1ContentListener::~WP1ContentListener
~WP1ContentListener() override
Definition WP1ContentListener.cpp:57
WP1ContentListener::centerOff
void centerOff() override
Definition WP1ContentListener.h:93
WP1ContentListener::insertEOL
void insertEOL() override
Definition WP1ContentListener.cpp:113
WP1ContentListener::_flushText
void _flushText() override
Definition WP1ContentListener.cpp:589
WP1ContentListener::WP1ContentListener
WP1ContentListener(std::list< WPXPageSpan > &pageList, librevenge::RVNGTextInterface *documentInterface)
Definition WP1ContentListener.cpp:48
WP1ContentListener::leftMarginRelease
void leftMarginRelease(unsigned short release) override
Definition WP1ContentListener.cpp:451
WP1Listener::WP1Listener
WP1Listener()
Definition WP1Listener.cpp:30
WP1SubDocument
Definition WP1SubDocument.h:34
WPXContentListener::lineSpacingChange
void lineSpacingChange(const double lineSpacing)
Definition WPXContentListener.cpp:1296
WPXContentListener::endSubDocument
void endSubDocument()
Definition WPXContentListener.cpp:180
WPXContentListener::endDocument
void endDocument()
Definition WPXContentListener.cpp:159
WPXContentListener::insertBreak
void insertBreak(const unsigned char breakType)
Definition WPXContentListener.cpp:1242
WPXContentListener::startSubDocument
void startSubDocument()
Definition WPXContentListener.cpp:153
WPXContentListener::WPXContentListener
WPXContentListener(std::list< WPXPageSpan > &pageList, librevenge::RVNGTextInterface *documentInterface)
Definition WPXContentListener.cpp:126
WPXContentListener::startDocument
void startDocument()
Definition WPXContentListener.cpp:138
WPXSubDocument
Definition WPXSubDocument.h:37
WPXTableList
Definition WPXTableList.h:36
WPXSubDocumentType
WPXSubDocumentType
Definition libwpd_internal.h:111
WPXNoteType
WPXNoteType
Definition libwpd_internal.h:93
WP1ContentParsingState::m_numDeferredTabs
int m_numDeferredTabs
Definition WP1ContentListener.h:43
WP1ContentParsingState::~WP1ContentParsingState
~WP1ContentParsingState()
Definition WP1ContentListener.cpp:43
WP1ContentParsingState::m_footNoteNumber
int m_footNoteNumber
Definition WP1ContentListener.h:44
WP1ContentParsingState::WP1ContentParsingState
WP1ContentParsingState(const WP1ContentParsingState &)
WP1ContentParsingState::operator=
WP1ContentParsingState & operator=(const WP1ContentParsingState &)
WP1ContentParsingState::m_endNoteNumber
int m_endNoteNumber
Definition WP1ContentListener.h:44
WP1ContentParsingState::WP1ContentParsingState
WP1ContentParsingState()
Definition WP1ContentListener.cpp:35
WP1ContentParsingState::m_textBuffer
librevenge::RVNGString m_textBuffer
Definition WP1ContentListener.h:42