WP3StylesListener.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) 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 WP3STYLESLISTENER_H
#define WP3STYLESLISTENER_H
#include "WP3Listener.h"
#include "WPXStylesListener.h"
#include "WPXPageSpan.h"
#include "WPXTable.h"
#include "WPXTableList.h"
class WP3StylesListener : public WP3Listener, protected WPXStylesListener
{
public:
WP3StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
void startDocument() override {}
void startSubDocument() override {}
void insertCharacter(unsigned /* character */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void insertTab() 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 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 indentFirstLineChange(double /* offset */) override {}
void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) override {}
void columnChange(WPXTextColumnType /* columnType */, unsigned char /* numColumns */,
const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) 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 closeCell() override {}
void closeRow() override {}
void setTableCellSpan(unsigned short /* colSpan */, unsigned short /* rowSpan */) override {}
void setTableCellFillColor(const RGBSColor * /* cellFillColor */) override {}
void endTable() override {}
void undoChange(unsigned char undoType, unsigned short undoLevel) override;
void setTextColor(const RGBSColor * /* fontColor */) override {}
void setTextFont(const librevenge::RVNGString & /* fontName */) override {}
void setFontSize(unsigned short /* fontSize */) override {}
void insertPageNumber(const librevenge::RVNGString & /* pageNumber */) override {}
void insertNoteReference(const librevenge::RVNGString & /* noteReference */) override {}
void insertNote(WPXNoteType /* noteType */, const WP3SubDocument * /* subDocument */) override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr<WP3SubDocument> &subDocument) override;
void suppressPage(unsigned short suppressCode) override;
void backTab() override
{
if (!isUndoOn()) m_currentPageHasContent = true;
}
void leftIndent() override {}
void leftIndent(double /* offset */) override {}
void leftRightIndent() override {}
void leftRightIndent(double /* offset */) override {}
void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
unsigned short /* figureFlags */, const librevenge::RVNGBinaryData & /* binaryData */) override {}
void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) override {}
void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) override {}
protected:
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
private:
WP3StylesListener(const WP3StylesListener &);
WP3StylesListener &operator=(const WP3StylesListener &);
WPXPageSpan m_currentPage;
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 /* WP3STYLESLISTENER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP3Listener.h
WPXPageSpan.h
WPXStylesListener.h
WPXTableList.h
WPXTable.h
WP3Listener::WP3Listener
WP3Listener()
Definition WP3Listener.cpp:30
WP3StylesListener::insertCharacter
void insertCharacter(unsigned) override
Definition WP3StylesListener.h:43
WP3StylesListener::closeRow
void closeRow() override
Definition WP3StylesListener.h:78
WP3StylesListener::setFontSize
void setFontSize(unsigned short) override
Definition WP3StylesListener.h:85
WP3StylesListener::backTab
void backTab() override
Definition WP3StylesListener.h:94
WP3StylesListener::insertNote
void insertNote(WPXNoteType, const WP3SubDocument *) override
Definition WP3StylesListener.h:88
WP3StylesListener::startSubDocument
void startSubDocument() override
Definition WP3StylesListener.h:42
WP3StylesListener::endTable
void endTable() override
Definition WP3StylesListener.h:81
WP3StylesListener::undoChange
void undoChange(unsigned char undoType, unsigned short undoLevel) override
Definition WP3StylesListener.cpp:101
WP3StylesListener::insertEOL
void insertEOL() override
Definition WP3StylesListener.h:55
WP3StylesListener::leftIndent
void leftIndent(double) override
Definition WP3StylesListener.h:99
WP3StylesListener::setTableCellSpan
void setTableCellSpan(unsigned short, unsigned short) override
Definition WP3StylesListener.h:79
WP3StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition WP3StylesListener.cpp:254
WP3StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition WP3StylesListener.h:119
WP3StylesListener::lineSpacingChange
void lineSpacingChange(double) override
Definition WP3StylesListener.h:61
WP3StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition WP3StylesListener.h:120
WP3StylesListener::operator=
WP3StylesListener & operator=(const WP3StylesListener &)
WP3StylesListener::m_isSubDocument
bool m_isSubDocument
Definition WP3StylesListener.h:121
WP3StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, const std::shared_ptr< WP3SubDocument > &subDocument) override
Definition WP3StylesListener.cpp:192
WP3StylesListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition WP3StylesListener.cpp:61
WP3StylesListener::leftIndent
void leftIndent() override
Definition WP3StylesListener.h:98
WP3StylesListener::setTabs
void setTabs(bool, const std::vector< WPXTabStop >) override
Definition WP3StylesListener.h:67
WP3StylesListener::startTable
void startTable() override
Definition WP3StylesListener.cpp:244
WP3StylesListener::endDocument
void endDocument() override
Definition WP3StylesListener.cpp:49
WP3StylesListener::closeCell
void closeCell() override
Definition WP3StylesListener.h:77
WP3StylesListener::m_tableList
WPXTableList m_tableList
Definition WP3StylesListener.h:117
WP3StylesListener::leftRightIndent
void leftRightIndent(double) override
Definition WP3StylesListener.h:101
WP3StylesListener::m_currentTable
std::shared_ptr< WPXTable > m_currentTable
Definition WP3StylesListener.h:118
WP3StylesListener::marginChange
void marginChange(unsigned char side, unsigned short margin) override
Definition WP3StylesListener.cpp:131
WP3StylesListener::insertPageNumber
void insertPageNumber(const librevenge::RVNGString &) override
Definition WP3StylesListener.h:86
WP3StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition WP3StylesListener.h:122
WP3StylesListener::insertTab
void insertTab(unsigned char, double) override
Definition WP3StylesListener.h:51
WP3StylesListener::insertWP51Table
void insertWP51Table(double, double, double, double, unsigned char, unsigned char, unsigned short, const WP3SubDocument *, const WP3SubDocument *) override
Definition WP3StylesListener.h:106
WP3StylesListener::attributeChange
void attributeChange(bool, unsigned char) override
Definition WP3StylesListener.h:60
WP3StylesListener::defineTable
void defineTable(unsigned char, unsigned short) override
Definition WP3StylesListener.h:73
WP3StylesListener::startDocument
void startDocument() override
Definition WP3StylesListener.h:41
WP3StylesListener::indentFirstLineChange
void indentFirstLineChange(double) override
Definition WP3StylesListener.h:66
WP3StylesListener::insertTextBox
void insertTextBox(double, double, double, double, unsigned char, unsigned char, unsigned short, const WP3SubDocument *, const WP3SubDocument *) override
Definition WP3StylesListener.h:104
WP3StylesListener::insertNoteReference
void insertNoteReference(const librevenge::RVNGString &) override
Definition WP3StylesListener.h:87
WP3StylesListener::insertTab
void insertTab() override
Definition WP3StylesListener.h:47
WP3StylesListener::pageFormChange
void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation) override
Definition WP3StylesListener.cpp:177
WP3StylesListener::suppressPage
void suppressPage(unsigned short suppressCode) override
Definition WP3StylesListener.cpp:228
WP3StylesListener::addTableColumnDefinition
void addTableColumnDefinition(unsigned, unsigned, unsigned, unsigned, unsigned char) override
Definition WP3StylesListener.h:74
WP3StylesListener::setTextFont
void setTextFont(const librevenge::RVNGString &) override
Definition WP3StylesListener.h:84
WP3StylesListener::endSubDocument
void endSubDocument() override
Definition WP3StylesListener.cpp:55
WP3StylesListener::insertPicture
void insertPicture(double, double, double, double, unsigned char, unsigned char, unsigned short, const librevenge::RVNGBinaryData &) override
Definition WP3StylesListener.h:102
WP3StylesListener::WP3StylesListener
WP3StylesListener(std::list< WPXPageSpan > &pageList, WPXTableList tableList)
Definition WP3StylesListener.cpp:34
WP3StylesListener::columnChange
void columnChange(WPXTextColumnType, unsigned char, const std::vector< double > &, const std::vector< bool > &) override
Definition WP3StylesListener.h:68
WP3StylesListener::setTableCellFillColor
void setTableCellFillColor(const RGBSColor *) override
Definition WP3StylesListener.h:80
WP3StylesListener::WP3StylesListener
WP3StylesListener(const WP3StylesListener &)
WP3StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition WP3StylesListener.h:119
WP3StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition WP3StylesListener.h:115
WP3StylesListener::leftRightIndent
void leftRightIndent() override
Definition WP3StylesListener.h:100
WP3StylesListener::setTextColor
void setTextColor(const RGBSColor *) override
Definition WP3StylesListener.h:83
WP3StylesListener::pageMarginChange
void pageMarginChange(unsigned char side, unsigned short margin) override
Definition WP3StylesListener.cpp:112
WP3StylesListener::justificationChange
void justificationChange(unsigned char) override
Definition WP3StylesListener.h:62
WP3SubDocument
Definition WP3SubDocument.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
WPXTextColumnType
WPXTextColumnType
Definition libwpd_internal.h:109
WPXSubDocumentType
WPXSubDocumentType
Definition libwpd_internal.h:111
WPXNoteType
WPXNoteType
Definition libwpd_internal.h:93
RGBSColor
Definition libwpd_internal.h:167