WPXPageSpan.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) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002 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 WPXPAGE_H
#define WPXPAGE_H
#include <memory>
#include <vector>
#include "WPXFileStructure.h"
#include "WPXHeaderFooter.h"
#include "WPXSubDocument.h"
#include "WPXTable.h"
#include "libwpd_internal.h"
// intermediate page representation class: for internal use only (by the high-level content/styles listeners). should not be exported.
class WPXPageSpan
{
public:
WPXPageSpan();
WPXPageSpan(const WPXPageSpan &page, double paragraphMarginLeft, double paragraphMarginRight);
virtual ~WPXPageSpan();
bool getPageNumberSuppression() const
{
return m_isPageNumberSuppressed;
}
bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
{
if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType];
return false;
}
double getFormLength() const
{
return m_formLength;
}
double getFormWidth() const
{
return m_formWidth;
}
WPXFormOrientation getFormOrientation() const
{
return m_formOrientation;
}
double getMarginLeft() const
{
return m_marginLeft;
}
double getMarginRight() const
{
return m_marginRight;
}
double getMarginTop() const
{
return m_marginTop;
}
double getMarginBottom() const
{
return m_marginBottom;
}
WPXPageNumberPosition getPageNumberPosition() const
{
return m_pageNumberPosition;
}
bool getPageNumberOverriden() const
{
return m_isPageNumberOverridden;
}
int getPageNumberOverride() const
{
return m_pageNumberOverride;
}
WPXNumberingType getPageNumberingType() const
{
return m_pageNumberingType;
}
double getPageNumberingFontSize() const
{
return m_pageNumberingFontSize;
}
librevenge::RVNGString getPageNumberingFontName() const
{
return m_pageNumberingFontName;
}
int getPageSpan() const
{
return m_pageSpan;
}
const std::vector<WPXHeaderFooter> &getHeaderFooterList() const
{
return m_headerFooterList;
}
void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence,
const std::shared_ptr<WPXSubDocument> &subDocument, WPXTableList tableList);
void setPageNumberSuppression(const bool suppress)
{
m_isPageNumberSuppressed = suppress;
}
void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
{
m_isHeaderFooterSuppressed[headerFooterType] = suppress;
}
void setFormLength(const double formLength)
{
m_formLength = formLength;
}
void setFormWidth(const double formWidth)
{
m_formWidth = formWidth;
}
void setFormOrientation(const WPXFormOrientation formOrientation)
{
m_formOrientation = formOrientation;
}
void setMarginLeft(const double marginLeft)
{
m_marginLeft = marginLeft;
}
void setMarginRight(const double marginRight)
{
m_marginRight = marginRight;
}
void setMarginTop(const double marginTop)
{
m_marginTop = marginTop;
}
void setMarginBottom(const double marginBottom)
{
m_marginBottom = marginBottom;
}
void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
{
m_pageNumberPosition = pageNumberPosition;
}
void setPageNumber(const int pageNumberOverride)
{
m_pageNumberOverride = pageNumberOverride;
m_isPageNumberOverridden = true;
}
void setPageNumberingType(const WPXNumberingType pageNumberingType)
{
m_pageNumberingType = pageNumberingType;
}
void setPageNumberingFontSize(const double pageNumberingFontSize)
{
m_pageNumberingFontSize = pageNumberingFontSize;
}
void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
{
m_pageNumberingFontName = pageNumberingFontName;
}
void setPageSpan(const int pageSpan)
{
m_pageSpan = pageSpan;
}
protected:
void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence);
bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence);
private:
bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES];
bool m_isPageNumberSuppressed;
double m_formLength, m_formWidth;
WPXFormOrientation m_formOrientation;
double m_marginLeft, m_marginRight;
double m_marginTop, m_marginBottom;
WPXPageNumberPosition m_pageNumberPosition;
bool m_isPageNumberOverridden;
int m_pageNumberOverride;
WPXNumberingType m_pageNumberingType;
librevenge::RVNGString m_pageNumberingFontName;
double m_pageNumberingFontSize;
std::vector<WPXHeaderFooter> m_headerFooterList;
int m_pageSpan;
};
bool operator==(const WPXPageSpan &, const WPXPageSpan &);
#endif /* WPXPAGE_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXFileStructure.h
WPX_FOOTER_B
#define WPX_FOOTER_B
Definition WPXFileStructure.h:45
WPX_NUM_HEADER_FOOTER_TYPES
#define WPX_NUM_HEADER_FOOTER_TYPES
Definition WPXFileStructure.h:41
operator==
bool operator==(const WPXPageSpan &, const WPXPageSpan &)
Definition WPXPageSpan.cpp:164
WPXSubDocument.h
WPXTable.h
WPXPageSpan
Definition WPXPageSpan.h:43
WPXPageSpan::getMarginBottom
double getMarginBottom() const
Definition WPXPageSpan.h:82
WPXPageSpan::getPageNumberingFontSize
double getPageNumberingFontSize() const
Definition WPXPageSpan.h:102
WPXPageSpan::_containsHeaderFooter
bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition WPXPageSpan.cpp:145
WPXPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
Definition WPXPageSpan.h:178
WPXPageSpan::setPageNumber
void setPageNumber(const int pageNumberOverride)
Definition WPXPageSpan.h:161
WPXPageSpan::m_pageNumberPosition
WPXPageNumberPosition m_pageNumberPosition
Definition WPXPageSpan.h:194
WPXPageSpan::setPageNumberingType
void setPageNumberingType(const WPXNumberingType pageNumberingType)
Definition WPXPageSpan.h:166
WPXPageSpan::setMarginLeft
void setMarginLeft(const double marginLeft)
Definition WPXPageSpan.h:141
WPXPageSpan::getMarginTop
double getMarginTop() const
Definition WPXPageSpan.h:78
WPXPageSpan::getMarginRight
double getMarginRight() const
Definition WPXPageSpan.h:74
WPXPageSpan::m_formLength
double m_formLength
Definition WPXPageSpan.h:190
WPXPageSpan::setFormLength
void setFormLength(const double formLength)
Definition WPXPageSpan.h:129
WPXPageSpan::getPageNumberOverriden
bool getPageNumberOverriden() const
Definition WPXPageSpan.h:90
WPXPageSpan::setMarginRight
void setMarginRight(const double marginRight)
Definition WPXPageSpan.h:145
WPXPageSpan::m_marginBottom
double m_marginBottom
Definition WPXPageSpan.h:193
WPXPageSpan::getMarginLeft
double getMarginLeft() const
Definition WPXPageSpan.h:70
WPXPageSpan::m_pageNumberingFontName
librevenge::RVNGString m_pageNumberingFontName
Definition WPXPageSpan.h:198
WPXPageSpan::m_formOrientation
WPXFormOrientation m_formOrientation
Definition WPXPageSpan.h:191
WPXPageSpan::WPXPageSpan
WPXPageSpan()
Definition WPXPageSpan.cpp:36
WPXPageSpan::getHeaderFooterSuppression
bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
Definition WPXPageSpan.h:53
WPXPageSpan::m_isHeaderFooterSuppressed
bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES]
Definition WPXPageSpan.h:188
WPXPageSpan::m_pageSpan
int m_pageSpan
Definition WPXPageSpan.h:202
WPXPageSpan::getHeaderFooterList
const std::vector< WPXHeaderFooter > & getHeaderFooterList() const
Definition WPXPageSpan.h:114
WPXPageSpan::getFormWidth
double getFormWidth() const
Definition WPXPageSpan.h:62
WPXPageSpan::setHeaderFooter
void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence, const std::shared_ptr< WPXSubDocument > &subDocument, WPXTableList tableList)
Definition WPXPageSpan.cpp:87
WPXPageSpan::setMarginBottom
void setMarginBottom(const double marginBottom)
Definition WPXPageSpan.h:153
WPXPageSpan::getPageNumberingType
WPXNumberingType getPageNumberingType() const
Definition WPXPageSpan.h:98
WPXPageSpan::m_pageNumberingFontSize
double m_pageNumberingFontSize
Definition WPXPageSpan.h:199
WPXPageSpan::setPageNumberingFontName
void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
Definition WPXPageSpan.h:174
WPXPageSpan::setHeadFooterSuppression
void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
Definition WPXPageSpan.h:125
WPXPageSpan::m_marginTop
double m_marginTop
Definition WPXPageSpan.h:193
WPXPageSpan::getPageSpan
int getPageSpan() const
Definition WPXPageSpan.h:110
WPXPageSpan::setFormOrientation
void setFormOrientation(const WPXFormOrientation formOrientation)
Definition WPXPageSpan.h:137
WPXPageSpan::m_isPageNumberSuppressed
bool m_isPageNumberSuppressed
Definition WPXPageSpan.h:189
WPXPageSpan::m_pageNumberOverride
int m_pageNumberOverride
Definition WPXPageSpan.h:196
WPXPageSpan::getFormLength
double getFormLength() const
Definition WPXPageSpan.h:58
WPXPageSpan::m_marginRight
double m_marginRight
Definition WPXPageSpan.h:192
WPXPageSpan::_removeHeaderFooter
void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition WPXPageSpan.cpp:132
WPXPageSpan::setPageNumberingFontSize
void setPageNumberingFontSize(const double pageNumberingFontSize)
Definition WPXPageSpan.h:170
WPXPageSpan::m_marginLeft
double m_marginLeft
Definition WPXPageSpan.h:192
WPXPageSpan::m_headerFooterList
std::vector< WPXHeaderFooter > m_headerFooterList
Definition WPXPageSpan.h:200
WPXPageSpan::getFormOrientation
WPXFormOrientation getFormOrientation() const
Definition WPXPageSpan.h:66
WPXPageSpan::~WPXPageSpan
virtual ~WPXPageSpan()
Definition WPXPageSpan.cpp:82
WPXPageSpan::getPageNumberingFontName
librevenge::RVNGString getPageNumberingFontName() const
Definition WPXPageSpan.h:106
WPXPageSpan::setMarginTop
void setMarginTop(const double marginTop)
Definition WPXPageSpan.h:149
WPXPageSpan::getPageNumberSuppression
bool getPageNumberSuppression() const
Definition WPXPageSpan.h:49
WPXPageSpan::getPageNumberOverride
int getPageNumberOverride() const
Definition WPXPageSpan.h:94
WPXPageSpan::m_isPageNumberOverridden
bool m_isPageNumberOverridden
Definition WPXPageSpan.h:195
WPXPageSpan::getPageNumberPosition
WPXPageNumberPosition getPageNumberPosition() const
Definition WPXPageSpan.h:86
WPXPageSpan::setFormWidth
void setFormWidth(const double formWidth)
Definition WPXPageSpan.h:133
WPXPageSpan::setPageNumberPosition
void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
Definition WPXPageSpan.h:157
WPXPageSpan::m_pageNumberingType
WPXNumberingType m_pageNumberingType
Definition WPXPageSpan.h:197
WPXPageSpan::m_formWidth
double m_formWidth
Definition WPXPageSpan.h:190
WPXPageSpan::setPageNumberSuppression
void setPageNumberSuppression(const bool suppress)
Definition WPXPageSpan.h:121
WPXTableList
Definition WPXTableList.h:36
libwpd_internal.h
WPXHeaderFooterOccurrence
WPXHeaderFooterOccurrence
Definition libwpd_internal.h:96
WPXHeaderFooterType
WPXHeaderFooterType
Definition libwpd_internal.h:94
WPXFormOrientation
WPXFormOrientation
Definition libwpd_internal.h:105
WPXPageNumberPosition
WPXPageNumberPosition
Definition libwpd_internal.h:97
WPXNumberingType
WPXNumberingType
Definition libwpd_internal.h:92