WP42StylesListener.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 WP42STYLESLISTENER_H
#define WP42STYLESLISTENER_H
#include "WP42Listener.h"
#include "WP42SubDocument.h"
#include "WPXStylesListener.h"
#include <vector>
#include "WPXPageSpan.h"
#include "WPXTable.h"
#include "WPXTableList.h"
class WP42StylesListener : public WP42Listener, protected WPXStylesListener
{
public:
explicit WP42StylesListener(std::list<WPXPageSpan> &pageList);
void startDocument() override {}
void startSubDocument() override {}
void insertCharacter(unsigned /* character */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertTab(unsigned char /* tabType */, double /* tabPosition */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertEOL() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertBreak(unsigned char breakType) override;
void attributeChange(bool /* isOn */, unsigned char /* attribute */) override {}
void marginReset(unsigned char /* leftMargin */, unsigned char /* rightMargin */) override {}
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr<WP42SubDocument> &subDocument) override;
void suppressPageCharacteristics(unsigned char suppressCode) override;
void endDocument() override;
void endSubDocument() 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 /* WP42STYLESLISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP42Listener.h
WP42SubDocument.h
WPXPageSpan.h
WPXStylesListener.h
WPXTableList.h
WPXTable.h
WP42Listener::WP42Listener
WP42Listener()
Definition WP42Listener.cpp:30
WP42StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition WP42StylesListener.h:71
WP42StylesListener::insertEOL
void insertEOL() override
Definition WP42StylesListener.h:54
WP42StylesListener::attributeChange
void attributeChange(bool, unsigned char) override
Definition WP42StylesListener.h:59
WP42StylesListener::startDocument
void startDocument() override
Definition WP42StylesListener.h:44
WP42StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition WP42StylesListener.h:70
WP42StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition WP42StylesListener.h:74
WP42StylesListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition WP42StylesListener.cpp:57
WP42StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition WP42StylesListener.h:71
WP42StylesListener::insertTab
void insertTab(unsigned char, double) override
Definition WP42StylesListener.h:50
WP42StylesListener::startSubDocument
void startSubDocument() override
Definition WP42StylesListener.h:45
WP42StylesListener::endDocument
void endDocument() override
Definition WP42StylesListener.cpp:47
WP42StylesListener::m_isSubDocument
bool m_isSubDocument
Definition WP42StylesListener.h:73
WP42StylesListener::WP42StylesListener
WP42StylesListener(std::list< WPXPageSpan > &pageList)
Definition WP42StylesListener.cpp:34
WP42StylesListener::endSubDocument
void endSubDocument() override
Definition WP42StylesListener.cpp:52
WP42StylesListener::insertCharacter
void insertCharacter(unsigned) override
Definition WP42StylesListener.h:46
WP42StylesListener::m_nextPage
WPXPageSpan m_nextPage
Definition WP42StylesListener.h:70
WP42StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition WP42StylesListener.cpp:188
WP42StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition WP42StylesListener.h:72
WP42StylesListener::marginReset
void marginReset(unsigned char, unsigned char) override
Definition WP42StylesListener.h:60
WP42StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP42SubDocument > &subDocument) override
Definition WP42StylesListener.cpp:118
WP42StylesListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char suppressCode) override
Definition WP42StylesListener.cpp:161
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