WP1StylesListener.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) 2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 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 WP1STYLESLISTENER_H
#define WP1STYLESLISTENER_H
#include "WP1Listener.h"
#include "WP1SubDocument.h"
#include "WPXStylesListener.h"
#include <memory>
#include "WPXPageSpan.h"
#include "WPXTable.h"
#include "WPXTableList.h"
class WP1StylesListener : public WP1Listener, protected WPXStylesListener
{
public:
explicit WP1StylesListener(std::list<WPXPageSpan> &pageList);
~WP1StylesListener() override {}
void startDocument() override {}
void startSubDocument() override {}
void insertCharacter(unsigned /* character */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertExtendedCharacter(unsigned char /* extendedCharacter */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertTab() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertEOL() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertBreak(unsigned char breakType) 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
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void leftRightIndent(unsigned short /* leftRightMarginOffset */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
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 {}
void flushRightOn() override {}
void flushRightOff() override {}
void centerOn() override {}
void centerOff() override {}
void endDocument() override;
void endSubDocument() override;
void insertPicture(unsigned short /* width */, unsigned short /* height */, const librevenge::RVNGBinaryData & /* binaryData */) override {}
protected:
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
private:
WPXPageSpan m_currentPage, m_nextPage;
double m_tempMarginLeft, m_tempMarginRight;
bool m_currentPageHasContent;
bool m_isSubDocument;
std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
};
#endif /* WP1STYLESLISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP1Listener.h
WP1SubDocument.h
WPXPageSpan.h
WPXStylesListener.h
WPXTableList.h
WPXTable.h
WP1Listener::WP1Listener
WP1Listener()
Definition WP1Listener.cpp:30
WP1StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition WP1StylesListener.h:97
WP1StylesListener::insertPicture
void insertPicture(unsigned short, unsigned short, const librevenge::RVNGBinaryData &) override
Definition WP1StylesListener.h:91
WP1StylesListener::~WP1StylesListener
~WP1StylesListener() override
Definition WP1StylesListener.h:43
WP1StylesListener::leftIndent
void leftIndent(unsigned short) override
Definition WP1StylesListener.h:71
WP1StylesListener::startSubDocument
void startSubDocument() override
Definition WP1StylesListener.h:46
WP1StylesListener::insertExtendedCharacter
void insertExtendedCharacter(unsigned char) override
Definition WP1StylesListener.h:51
WP1StylesListener::bottomMarginSet
void bottomMarginSet(unsigned short bottomMargin) override
Definition WP1StylesListener.cpp:174
WP1StylesListener::centerOn
void centerOn() override
Definition WP1StylesListener.h:87
WP1StylesListener::setTabs
void setTabs(const std::vector< WPXTabStop > &) override
Definition WP1StylesListener.h:80
WP1StylesListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition WP1StylesListener.cpp:56
WP1StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition WP1StylesListener.h:98
WP1StylesListener::centerOff
void centerOff() override
Definition WP1StylesListener.h:88
WP1StylesListener::justificationChange
void justificationChange(unsigned char) override
Definition WP1StylesListener.h:83
WP1StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP1SubDocument > &subDocument) override
Definition WP1StylesListener.cpp:184
WP1StylesListener::startDocument
void startDocument() override
Definition WP1StylesListener.h:45
WP1StylesListener::endSubDocument
void endSubDocument() override
Definition WP1StylesListener.cpp:51
WP1StylesListener::insertCharacter
void insertCharacter(unsigned) override
Definition WP1StylesListener.h:47
WP1StylesListener::endDocument
void endDocument() override
Definition WP1StylesListener.cpp:46
WP1StylesListener::fontPointSize
void fontPointSize(unsigned char) override
Definition WP1StylesListener.h:66
WP1StylesListener::insertEOL
void insertEOL() override
Definition WP1StylesListener.h:59
WP1StylesListener::flushRightOff
void flushRightOff() override
Definition WP1StylesListener.h:86
WP1StylesListener::leftRightIndent
void leftRightIndent(unsigned short) override
Definition WP1StylesListener.h:75
WP1StylesListener::leftMarginRelease
void leftMarginRelease(unsigned short) override
Definition WP1StylesListener.h:79
WP1StylesListener::insertTab
void insertTab() override
Definition WP1StylesListener.h:55
WP1StylesListener::m_nextPage
WPXPageSpan m_nextPage
Definition WP1StylesListener.h:97
WP1StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition WP1StylesListener.cpp:249
WP1StylesListener::attributeChange
void attributeChange(bool, unsigned char) override
Definition WP1StylesListener.h:65
WP1StylesListener::WP1StylesListener
WP1StylesListener(std::list< WPXPageSpan > &pageList)
Definition WP1StylesListener.cpp:33
WP1StylesListener::topMarginSet
void topMarginSet(unsigned short topMargin) override
Definition WP1StylesListener.cpp:164
WP1StylesListener::lineSpacingChange
void lineSpacingChange(unsigned char) override
Definition WP1StylesListener.h:84
WP1StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition WP1StylesListener.h:101
WP1StylesListener::insertNote
void insertNote(WPXNoteType, WP1SubDocument *) override
Definition WP1StylesListener.h:64
WP1StylesListener::flushRightOn
void flushRightOn() override
Definition WP1StylesListener.h:85
WP1StylesListener::fontId
void fontId(unsigned short) override
Definition WP1StylesListener.h:67
WP1StylesListener::marginReset
void marginReset(unsigned short leftMargin, unsigned short rightMargin) override
Definition WP1StylesListener.cpp:116
WP1StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition WP1StylesListener.h:99
WP1StylesListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char suppressCode) override
Definition WP1StylesListener.cpp:227
WP1StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition WP1StylesListener.h:98
WP1StylesListener::m_isSubDocument
bool m_isSubDocument
Definition WP1StylesListener.h:100
WP1SubDocument
Definition WP1SubDocument.h:34
WPXListener::isUndoOn
bool isUndoOn()
Definition WPXListener.h:40
WPXPageSpan
Definition WPXPageSpan.h:43
WPXStylesListener::WPXStylesListener
WPXStylesListener(std::list< WPXPageSpan > &pageList)
Definition WPXStylesListener.cpp:31
WPXSubDocument
Definition WPXSubDocument.h:37
WPXTableList
Definition WPXTableList.h:36
WPXSubDocumentType
WPXSubDocumentType
Definition libwpd_internal.h:111
WPXNoteType
WPXNoteType
Definition libwpd_internal.h:93