WP6StylesListener.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)
*
* 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."
*/
// WP6StylesListener: creates an intermediate table representation, given a
// sequence of messages passed to it by the parser.
#ifndef WP6STYLESLISTENER_H
#define WP6STYLESLISTENER_H
#include "WP6Listener.h"
#include "WPXStylesListener.h"
#include <vector>
#include <set>
#include <list>
#include "WPXPageSpan.h"
#include "WPXTable.h"
class WPXSubDocument;
class WP6StylesListener : public WP6Listener, protected WPXStylesListener
{
public:
WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
void setDate(const unsigned short /* type */, const unsigned short /* year */,
const unsigned char /* month */, const unsigned char /* day */,
const unsigned char /* hour */, const unsigned char /* minute */,
const unsigned char /* second */, const unsigned char /* dayOfWeek */,
const unsigned char /* timeZone */, const unsigned char /* unused */) override {}
void setExtendedInformation(const unsigned short /* type */, const librevenge::RVNGString & /*data*/) override {}
void startDocument() override {}
void startSubDocument() override {}
void setAlignmentCharacter(const unsigned /* character */) override {}
void setLeaderCharacter(const unsigned /* character */, const unsigned char /* numberOfSpaces */) override {}
void defineTabStops(const bool /* isRelative */, const std::vector<WPXTabStop> & /* tabStops */,
const std::vector<bool> & /* usePreWP9LeaderMethods */) override {}
void insertCharacter(unsigned /* character */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertTab(const unsigned char /* tabType */, double /* tabPosition */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void handleLineBreak() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertEOL() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertBreak(const unsigned char breakType) override;
void characterColorChange(const unsigned char /* red */, const unsigned char /* green */, const unsigned char /* blue */) override {}
void characterShadingChange(const unsigned char /* shading */) override {}
void highlightChange(const bool /* isOn */, const RGBSColor & /* color */) override {}
void fontChange(const unsigned short /* matchedFontPointSize */, const unsigned short /* fontPID */, const librevenge::RVNGString & /* fontName */) override {}
void attributeChange(const bool /* isOn */, const unsigned char /* attribute */) override {}
void lineSpacingChange(const double /* lineSpacing */) override {}
void spacingAfterParagraphChange(const double /* spacingRelative */, const double /* spacingAbsolute */) override {}
void justificationChange(const unsigned char /* justification */) override {}
void pageNumberingChange(const WPXPageNumberPosition /* page numbering position */, const unsigned short /* matchedFontPointSize */, const unsigned short /* fontPID */) override;
void pageMarginChange(const unsigned char side, const unsigned short margin) override;
void pageFormChange(const unsigned short length, const unsigned short width, const WPXFormOrientation orientation) override;
void marginChange(const unsigned char side, const unsigned short margin) override;
void paragraphMarginChange(const unsigned char /* side */, const signed short /* margin */) override {}
void indentFirstLineChange(const signed short /* offset */) override {}
void columnChange(const WPXTextColumnType /* columnType */, const unsigned char /* numColumns */,
const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) override {}
void updateOutlineDefinition(const unsigned short /* outlineHash */, const unsigned char * /* numberingMethods */, const unsigned char /* tabBehaviourFlag */) override {}
void paragraphNumberOn(const unsigned short /* outlineHash */, const unsigned char /* level */, const unsigned char /* flag */) override {}
void paragraphNumberOff() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void displayNumberReferenceGroupOn(const unsigned char /* subGroup */, const unsigned char /* level */) override {}
void displayNumberReferenceGroupOff(const unsigned char /* subGroup */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void styleGroupOn(const unsigned char /* subGroup */) override {}
void styleGroupOff(const unsigned char /* subGroup */) override {}
void globalOn(const unsigned char /* systemStyle */) override {}
void globalOff() override {}
void noteOn(const unsigned short textPID) override;
void noteOff(const WPXNoteType /* noteType */) override {}
void headerFooterGroup(const unsigned char headerFooterType, const unsigned char occurrenceBits, const unsigned short textPID) override;
void suppressPageCharacteristics(const unsigned char suppressCode) override;
void setPageNumber(const unsigned short pageNumber) override;
void setPageNumberingType(const WPXNumberingType pageNumberingType) override;
void endDocument() override;
void endSubDocument() override;
void defineTable(const unsigned char position, const unsigned short leftOffset) override;
void addTableColumnDefinition(const unsigned /* width */, const unsigned /* leftGutter */, const unsigned /* rightGutter */,
const unsigned /* attributes */, const unsigned char /* alignment */) override {}
void startTable() override;
void insertRow(const unsigned short rowHeight, const bool isMinimumHeight, const bool isHeaderRow) override;
void insertCell(const unsigned char colSpan, const unsigned char rowSpan, const unsigned char borderBits,
const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
const RGBSColor *cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment,
const bool useCellAttributes, const unsigned cellAttributes) override;
void endTable() override;
void boxOn(const unsigned char /* anchoringType */, const unsigned char /* generalPositioningFlags */, const unsigned char /* horizontalPositioningFlags */,
const signed short /* horizontalOffset */, const unsigned char /* leftColumn */, const unsigned char /* rightColumn */,
const unsigned char /* verticalPositioningFlags */, const signed short /* verticalOffset */, const unsigned char /* widthFlags */,
const unsigned short /* width */, const unsigned char /* heightFlags */, const unsigned short /* height */, const unsigned char /* boxContentType */,
const unsigned short /* nativeWidth */, const unsigned short /* nativeHeight */,
const librevenge::RVNGString & /* linkTarget */) override {}
void boxOff() override {}
void insertGraphicsData(const unsigned short /* packetId */) override {}
void insertTextBox(const WP6SubDocument *subDocument) override;
void commentAnnotation(const unsigned short textPID) override;
void undoChange(const unsigned char undoType, const unsigned short undoLevel) override;
protected:
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
void _flushText() {}
void _changeList() {}
private:
WP6StylesListener(const WP6StylesListener &);
WP6StylesListener &operator=(const WP6StylesListener &);
WPXPageSpan m_currentPage;
WPXTableList m_tableList;
std::shared_ptr<WPXTable> m_currentTable;
double m_tempMarginLeft, m_tempMarginRight;
bool m_currentPageHasContent;
bool m_isTableDefined;
bool m_isSubDocument;
std::set <const WPXSubDocument *> m_subDocuments;
std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
};
#endif /* WP6STYLESLISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP6Listener.h
WPXPageSpan.h
WPXStylesListener.h
WPXTable.h
WP6Listener::WP6Listener
WP6Listener()
Definition WP6Listener.cpp:39
WP6StylesListener::indentFirstLineChange
void indentFirstLineChange(const signed short) override
Definition WP6StylesListener.h:90
WP6StylesListener::WP6StylesListener
WP6StylesListener(std::list< WPXPageSpan > &pageList, WPXTableList tableList)
Definition WP6StylesListener.cpp:39
WP6StylesListener::WP6StylesListener
WP6StylesListener(const WP6StylesListener &)
WP6StylesListener::setPageNumberingType
void setPageNumberingType(const WPXNumberingType pageNumberingType) override
Definition WP6StylesListener.cpp:257
WP6StylesListener::insertTab
void insertTab(const unsigned char, double) override
Definition WP6StylesListener.h:64
WP6StylesListener::startSubDocument
void startSubDocument() override
Definition WP6StylesListener.h:55
WP6StylesListener::highlightChange
void highlightChange(const bool, const RGBSColor &) override
Definition WP6StylesListener.h:79
WP6StylesListener::startDocument
void startDocument() override
Definition WP6StylesListener.h:54
WP6StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition WP6StylesListener.cpp:345
WP6StylesListener::insertCell
void insertCell(const unsigned char colSpan, const unsigned char rowSpan, const unsigned char borderBits, const RGBSColor *cellFgColor, const RGBSColor *cellBgColor, const RGBSColor *cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment, const bool useCellAttributes, const unsigned cellAttributes) override
Definition WP6StylesListener.cpp:306
WP6StylesListener::characterShadingChange
void characterShadingChange(const unsigned char) override
Definition WP6StylesListener.h:78
WP6StylesListener::marginChange
void marginChange(const unsigned char side, const unsigned short margin) override
Definition WP6StylesListener.cpp:154
WP6StylesListener::pageNumberingChange
void pageNumberingChange(const WPXPageNumberPosition, const unsigned short, const unsigned short) override
Definition WP6StylesListener.cpp:103
WP6StylesListener::columnChange
void columnChange(const WPXTextColumnType, const unsigned char, const std::vector< double > &, const std::vector< bool > &) override
Definition WP6StylesListener.h:91
WP6StylesListener::setPageNumber
void setPageNumber(const unsigned short pageNumber) override
Definition WP6StylesListener.cpp:249
WP6StylesListener::paragraphMarginChange
void paragraphMarginChange(const unsigned char, const signed short) override
Definition WP6StylesListener.h:89
WP6StylesListener::globalOn
void globalOn(const unsigned char) override
Definition WP6StylesListener.h:107
WP6StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition WP6StylesListener.h:151
WP6StylesListener::m_subDocuments
std::set< const WPXSubDocument * > m_subDocuments
Definition WP6StylesListener.h:159
WP6StylesListener::pageFormChange
void pageFormChange(const unsigned short length, const unsigned short width, const WPXFormOrientation orientation) override
Definition WP6StylesListener.cpp:139
WP6StylesListener::boxOff
void boxOff() override
Definition WP6StylesListener.h:135
WP6StylesListener::insertEOL
void insertEOL() override
Definition WP6StylesListener.h:72
WP6StylesListener::insertTextBox
void insertTextBox(const WP6SubDocument *subDocument) override
Definition WP6StylesListener.cpp:327
WP6StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition WP6StylesListener.h:156
WP6StylesListener::pageMarginChange
void pageMarginChange(const unsigned char side, const unsigned short margin) override
Definition WP6StylesListener.cpp:120
WP6StylesListener::_flushText
void _flushText()
Definition WP6StylesListener.h:145
WP6StylesListener::styleGroupOn
void styleGroupOn(const unsigned char) override
Definition WP6StylesListener.h:105
WP6StylesListener::updateOutlineDefinition
void updateOutlineDefinition(const unsigned short, const unsigned char *, const unsigned char) override
Definition WP6StylesListener.h:93
WP6StylesListener::characterColorChange
void characterColorChange(const unsigned char, const unsigned char, const unsigned char) override
Definition WP6StylesListener.h:77
WP6StylesListener::handleLineBreak
void handleLineBreak() override
Definition WP6StylesListener.h:68
WP6StylesListener::startTable
void startTable() override
Definition WP6StylesListener.cpp:276
WP6StylesListener::headerFooterGroup
void headerFooterGroup(const unsigned char headerFooterType, const unsigned char occurrenceBits, const unsigned short textPID) override
Definition WP6StylesListener.cpp:201
WP6StylesListener::m_tableList
WPXTableList m_tableList
Definition WP6StylesListener.h:153
WP6StylesListener::undoChange
void undoChange(const unsigned char undoType, const unsigned short undoLevel) override
Definition WP6StylesListener.cpp:384
WP6StylesListener::_changeList
void _changeList()
Definition WP6StylesListener.h:146
WP6StylesListener::lineSpacingChange
void lineSpacingChange(const double) override
Definition WP6StylesListener.h:82
WP6StylesListener::justificationChange
void justificationChange(const unsigned char) override
Definition WP6StylesListener.h:84
WP6StylesListener::endTable
void endTable() override
Definition WP6StylesListener.cpp:288
WP6StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition WP6StylesListener.h:160
WP6StylesListener::noteOff
void noteOff(const WPXNoteType) override
Definition WP6StylesListener.h:110
WP6StylesListener::boxOn
void boxOn(const unsigned char, const unsigned char, const unsigned char, const signed short, const unsigned char, const unsigned char, const unsigned char, const signed short, const unsigned char, const unsigned short, const unsigned char, const unsigned short, const unsigned char, const unsigned short, const unsigned short, const librevenge::RVNGString &) override
Definition WP6StylesListener.h:129
WP6StylesListener::noteOn
void noteOn(const unsigned short textPID) override
Definition WP6StylesListener.cpp:318
WP6StylesListener::globalOff
void globalOff() override
Definition WP6StylesListener.h:108
WP6StylesListener::setExtendedInformation
void setExtendedInformation(const unsigned short, const librevenge::RVNGString &) override
Definition WP6StylesListener.h:53
WP6StylesListener::commentAnnotation
void commentAnnotation(const unsigned short textPID) override
Definition WP6StylesListener.cpp:336
WP6StylesListener::m_isTableDefined
bool m_isTableDefined
Definition WP6StylesListener.h:157
WP6StylesListener::defineTable
void defineTable(const unsigned char position, const unsigned short leftOffset) override
Definition WP6StylesListener.cpp:265
WP6StylesListener::insertBreak
void insertBreak(const unsigned char breakType) override
Definition WP6StylesListener.cpp:65
WP6StylesListener::displayNumberReferenceGroupOff
void displayNumberReferenceGroupOff(const unsigned char) override
Definition WP6StylesListener.h:101
WP6StylesListener::paragraphNumberOff
void paragraphNumberOff() override
Definition WP6StylesListener.h:96
WP6StylesListener::attributeChange
void attributeChange(const bool, const unsigned char) override
Definition WP6StylesListener.h:81
WP6StylesListener::setLeaderCharacter
void setLeaderCharacter(const unsigned, const unsigned char) override
Definition WP6StylesListener.h:57
WP6StylesListener::insertRow
void insertRow(const unsigned short rowHeight, const bool isMinimumHeight, const bool isHeaderRow) override
Definition WP6StylesListener.cpp:297
WP6StylesListener::defineTabStops
void defineTabStops(const bool, const std::vector< WPXTabStop > &, const std::vector< bool > &) override
Definition WP6StylesListener.h:58
WP6StylesListener::paragraphNumberOn
void paragraphNumberOn(const unsigned short, const unsigned char, const unsigned char) override
Definition WP6StylesListener.h:95
WP6StylesListener::endDocument
void endDocument() override
Definition WP6StylesListener.cpp:55
WP6StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition WP6StylesListener.h:155
WP6StylesListener::endSubDocument
void endSubDocument() override
Definition WP6StylesListener.cpp:60
WP6StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition WP6StylesListener.h:155
WP6StylesListener::setAlignmentCharacter
void setAlignmentCharacter(const unsigned) override
Definition WP6StylesListener.h:56
WP6StylesListener::operator=
WP6StylesListener & operator=(const WP6StylesListener &)
WP6StylesListener::spacingAfterParagraphChange
void spacingAfterParagraphChange(const double, const double) override
Definition WP6StylesListener.h:83
WP6StylesListener::suppressPageCharacteristics
void suppressPageCharacteristics(const unsigned char suppressCode) override
Definition WP6StylesListener.cpp:229
WP6StylesListener::insertCharacter
void insertCharacter(unsigned) override
Definition WP6StylesListener.h:60
WP6StylesListener::addTableColumnDefinition
void addTableColumnDefinition(const unsigned, const unsigned, const unsigned, const unsigned, const unsigned char) override
Definition WP6StylesListener.h:120
WP6StylesListener::displayNumberReferenceGroupOn
void displayNumberReferenceGroupOn(const unsigned char, const unsigned char) override
Definition WP6StylesListener.h:100
WP6StylesListener::fontChange
void fontChange(const unsigned short, const unsigned short, const librevenge::RVNGString &) override
Definition WP6StylesListener.h:80
WP6StylesListener::setDate
void setDate(const unsigned short, const unsigned short, const unsigned char, const unsigned char, const unsigned char, const unsigned char, const unsigned char, const unsigned char, const unsigned char, const unsigned char) override
Definition WP6StylesListener.h:48
WP6StylesListener::m_currentTable
std::shared_ptr< WPXTable > m_currentTable
Definition WP6StylesListener.h:154
WP6StylesListener::m_isSubDocument
bool m_isSubDocument
Definition WP6StylesListener.h:158
WP6StylesListener::styleGroupOff
void styleGroupOff(const unsigned char) override
Definition WP6StylesListener.h:106
WP6StylesListener::insertGraphicsData
void insertGraphicsData(const unsigned short) override
Definition WP6StylesListener.h:136
WP6SubDocument
Definition WP6SubDocument.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
WPXFormOrientation
WPXFormOrientation
Definition libwpd_internal.h:105
WPXPageNumberPosition
WPXPageNumberPosition
Definition libwpd_internal.h:97
WPXTextColumnType
WPXTextColumnType
Definition libwpd_internal.h:109
WPXNumberingType
WPXNumberingType
Definition libwpd_internal.h:92
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