WP5StylesListener.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-2007 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 WP5STYLESLISTENER_H
#define WP5STYLESLISTENER_H
#include "WP5Listener.h"
#include "WPXStylesListener.h"
#include <list>
#include "WPXPageSpan.h"
#include "WPXTable.h"
#include "WP5SubDocument.h"
#include "WPXTableList.h"
class WP5StylesListener : public WP5Listener, protected WPXStylesListener
{
public:
WP5StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
void startDocument() override {}
void startSubDocument() override {}
void setFont(const librevenge::RVNGString & /* fontName */, double /* fontSize */) override {}
void setTabs(const std::vector<WPXTabStop> & /* tabStops */, unsigned short /* tabOffset */) 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 insertIndent(unsigned char /* indentType */, double /* indentPosition */) override
{
/*if (!isUndoOn())*/ m_currentPageHasContent = true;
}
void characterColorChange(unsigned char /* red */, unsigned char /* green */, unsigned char /* blue */) override {}
void insertEOL() override
{
/*if (!isUndoOn())*/ m_currentPageHasContent = true;
}
void insertBreak(unsigned char breakType) override;
void attributeChange(bool /* isOn */, unsigned char /* attribute */) override {}
void lineSpacingChange(double /* lineSpacing */) override {}
void justificationChange(unsigned char /* justification */) override {}
void pageMarginChange(unsigned char side, unsigned short margin) override;
void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation) override;
void marginChange(unsigned char side, unsigned short margin) override;
void endDocument() override;
void endSubDocument() override;
void defineTable(unsigned char /* position */, unsigned short /* leftOffset */) override {}
void addTableColumnDefinition(unsigned /* width */, unsigned /* leftGutter */, unsigned /* rightGutter */,
unsigned /* attributes */, unsigned char /* alignment */) override {}
void startTable() override;
void insertRow(unsigned short rowHeight, bool isMinimumHeight, bool isHeaderRow) override;
void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits,
const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
bool useCellAttributes, unsigned cellAttributes) override;
void endTable() override {}
void insertNoteReference(const librevenge::RVNGString & /* noteReference */) override {}
void insertNote(WPXNoteType /* noteType */, const WP5SubDocument * /* subDocument */) override {}
void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr<WP5SubDocument> &subDocument) override;
void suppressPageCharacteristics(unsigned char suppressCode) override;
void boxOn(unsigned char /* positionAndType */, unsigned char /* alignment */, unsigned short /* width */, unsigned short /* height */, unsigned short /* x */, unsigned short /* y */) override {}
void boxOff() override {}
void insertGraphicsData(const librevenge::RVNGBinaryData * /* data */) override {}
protected:
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
private:
WP5StylesListener(const WP5StylesListener &);
WP5StylesListener &operator=(const WP5StylesListener &);
WPXPageSpan m_currentPage, m_nextPage;
WPXTableList m_tableList;
std::shared_ptr<WPXTable> m_currentTable;
double m_tempMarginLeft, m_tempMarginRight;
bool m_currentPageHasContent;
bool m_isSubDocument;
std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
};
#endif /* WP5STYLESLISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP5Listener.h
WP5SubDocument.h
WPXPageSpan.h
WPXStylesListener.h
WPXTableList.h
WPXTable.h
WP5Listener::WP5Listener
WP5Listener()
Definition WP5Listener.cpp:34
WP5StylesListener::startTable
void startTable() override
Definition WP5StylesListener.cpp:259
WP5StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr< WP5SubDocument > &subDocument) override
Definition WP5StylesListener.cpp:198
WP5StylesListener::WP5StylesListener
WP5StylesListener(std::list< WPXPageSpan > &pageList, WPXTableList tableList)
Definition WP5StylesListener.cpp:35
WP5StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition WP5StylesListener.h:106
WP5StylesListener::m_nextPage
WPXPageSpan m_nextPage
Definition WP5StylesListener.h:101
WP5StylesListener::endSubDocument
void endSubDocument() override
Definition WP5StylesListener.cpp:55
WP5StylesListener::operator=
WP5StylesListener & operator=(const WP5StylesListener &)
WP5StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition WP5StylesListener.cpp:294
WP5StylesListener::insertIndent
void insertIndent(unsigned char, double) override
Definition WP5StylesListener.h:56
WP5StylesListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition WP5StylesListener.cpp:60
WP5StylesListener::boxOn
void boxOn(unsigned char, unsigned char, unsigned short, unsigned short, unsigned short, unsigned short) override
Definition WP5StylesListener.h:91
WP5StylesListener::startDocument
void startDocument() override
Definition WP5StylesListener.h:44
WP5StylesListener::insertGraphicsData
void insertGraphicsData(const librevenge::RVNGBinaryData *) override
Definition WP5StylesListener.h:93
WP5StylesListener::setFont
void setFont(const librevenge::RVNGString &, double) override
Definition WP5StylesListener.h:46
WP5StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition WP5StylesListener.h:108
WP5StylesListener::pageFormChange
void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation) override
Definition WP5StylesListener.cpp:135
WP5StylesListener::insertRow
void insertRow(unsigned short rowHeight, bool isMinimumHeight, bool isHeaderRow) override
Definition WP5StylesListener.cpp:269
WP5StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition WP5StylesListener.h:101
WP5StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition WP5StylesListener.h:105
WP5StylesListener::endDocument
void endDocument() override
Definition WP5StylesListener.cpp:50
WP5StylesListener::startSubDocument
void startSubDocument() override
Definition WP5StylesListener.h:45
WP5StylesListener::endTable
void endTable() override
Definition WP5StylesListener.h:84
WP5StylesListener::WP5StylesListener
WP5StylesListener(const WP5StylesListener &)
WP5StylesListener::insertCell
void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits, const RGBSColor *cellFgColor, const RGBSColor *cellBgColor, const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment, bool useCellAttributes, unsigned cellAttributes) override
Definition WP5StylesListener.cpp:280
WP5StylesListener::characterColorChange
void characterColorChange(unsigned char, unsigned char, unsigned char) override
Definition WP5StylesListener.h:60
WP5StylesListener::insertCharacter
void insertCharacter(unsigned) override
Definition WP5StylesListener.h:48
WP5StylesListener::insertEOL
void insertEOL() override
Definition WP5StylesListener.h:61
WP5StylesListener::justificationChange
void justificationChange(unsigned char) override
Definition WP5StylesListener.h:68
WP5StylesListener::m_currentTable
std::shared_ptr< WPXTable > m_currentTable
Definition WP5StylesListener.h:104
WP5StylesListener::addTableColumnDefinition
void addTableColumnDefinition(unsigned, unsigned, unsigned, unsigned, unsigned char) override
Definition WP5StylesListener.h:76
WP5StylesListener::setTabs
void setTabs(const std::vector< WPXTabStop > &, unsigned short) override
Definition WP5StylesListener.h:47
WP5StylesListener::lineSpacingChange
void lineSpacingChange(double) override
Definition WP5StylesListener.h:67
WP5StylesListener::m_tableList
WPXTableList m_tableList
Definition WP5StylesListener.h:103
WP5StylesListener::insertTab
void insertTab(unsigned char, double) override
Definition WP5StylesListener.h:52
WP5StylesListener::insertNoteReference
void insertNoteReference(const librevenge::RVNGString &) override
Definition WP5StylesListener.h:86
WP5StylesListener::pageMarginChange
void pageMarginChange(unsigned char side, unsigned short margin) override
Definition WP5StylesListener.cpp:116
WP5StylesListener::attributeChange
void attributeChange(bool, unsigned char) override
Definition WP5StylesListener.h:66
WP5StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition WP5StylesListener.h:105
WP5StylesListener::boxOff
void boxOff() override
Definition WP5StylesListener.h:92
WP5StylesListener::m_isSubDocument
bool m_isSubDocument
Definition WP5StylesListener.h:107
WP5StylesListener::defineTable
void defineTable(unsigned char, unsigned short) override
Definition WP5StylesListener.h:75
WP5StylesListener::marginChange
void marginChange(unsigned char side, unsigned short margin) override
Definition WP5StylesListener.cpp:151
WP5StylesListener::insertNote
void insertNote(WPXNoteType, const WP5SubDocument *) override
Definition WP5StylesListener.h:87
WP5StylesListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char suppressCode) override
Definition WP5StylesListener.cpp:243
WP5SubDocument
Definition WP5SubDocument.h:34
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
WPXFormOrientation
WPXFormOrientation
Definition libwpd_internal.h:105
WPXSubDocumentType
WPXSubDocumentType
Definition libwpd_internal.h:111
WPXVerticalAlignment
WPXVerticalAlignment
Definition libwpd_internal.h:107
WPXNoteType
WPXNoteType
Definition libwpd_internal.h:93
RGBSColor
Definition libwpd_internal.h:167