WPXPageSpan.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpd
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
11  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
12  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  *
14  * For minor contributions see the git repository.
15  *
16  * Alternatively, the contents of this file may be used under the terms
17  * of the GNU Lesser General Public License Version 2.1 or later
18  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19  * applicable instead of those above.
20  *
21  * For further information visit http://libwpd.sourceforge.net
22  */
23 
24 /* "This product is not manufactured, approved, or supported by
25  * Corel Corporation or Corel Corporation Limited."
26  */
27 
28 #ifndef WPXPAGE_H
29 #define WPXPAGE_H
30 
31 #include <memory>
32 #include <vector>
33 
34 #include "WPXFileStructure.h"
35 #include "WPXHeaderFooter.h"
36 #include "WPXSubDocument.h"
37 #include "WPXTable.h"
38 #include "libwpd_internal.h"
39 
40 // intermediate page representation class: for internal use only (by the high-level content/styles listeners). should not be exported.
41 
43 {
44 public:
45  WPXPageSpan();
46  WPXPageSpan(const WPXPageSpan &page, double paragraphMarginLeft, double paragraphMarginRight);
47  virtual ~WPXPageSpan();
48 
50  {
52  }
53  bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
54  {
55  if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType];
56  return false;
57  }
58  double getFormLength() const
59  {
60  return m_formLength;
61  }
62  double getFormWidth() const
63  {
64  return m_formWidth;
65  }
67  {
68  return m_formOrientation;
69  }
70  double getMarginLeft() const
71  {
72  return m_marginLeft;
73  }
74  double getMarginRight() const
75  {
76  return m_marginRight;
77  }
78  double getMarginTop() const
79  {
80  return m_marginTop;
81  }
82  double getMarginBottom() const
83  {
84  return m_marginBottom;
85  }
87  {
88  return m_pageNumberPosition;
89  }
91  {
93  }
95  {
96  return m_pageNumberOverride;
97  }
99  {
100  return m_pageNumberingType;
101  }
103  {
105  }
106  librevenge::RVNGString getPageNumberingFontName() const
107  {
109  }
110  int getPageSpan() const
111  {
112  return m_pageSpan;
113  }
114  const std::vector<WPXHeaderFooter> &getHeaderFooterList() const
115  {
116  return m_headerFooterList;
117  }
118 
119  void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence,
120  const std::shared_ptr<WPXSubDocument> &subDocument, WPXTableList tableList);
121  void setPageNumberSuppression(const bool suppress)
122  {
123  m_isPageNumberSuppressed = suppress;
124  }
125  void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
126  {
127  m_isHeaderFooterSuppressed[headerFooterType] = suppress;
128  }
129  void setFormLength(const double formLength)
130  {
131  m_formLength = formLength;
132  }
133  void setFormWidth(const double formWidth)
134  {
135  m_formWidth = formWidth;
136  }
137  void setFormOrientation(const WPXFormOrientation formOrientation)
138  {
139  m_formOrientation = formOrientation;
140  }
141  void setMarginLeft(const double marginLeft)
142  {
143  m_marginLeft = marginLeft;
144  }
145  void setMarginRight(const double marginRight)
146  {
147  m_marginRight = marginRight;
148  }
149  void setMarginTop(const double marginTop)
150  {
151  m_marginTop = marginTop;
152  }
153  void setMarginBottom(const double marginBottom)
154  {
155  m_marginBottom = marginBottom;
156  }
157  void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
158  {
159  m_pageNumberPosition = pageNumberPosition;
160  }
161  void setPageNumber(const int pageNumberOverride)
162  {
163  m_pageNumberOverride = pageNumberOverride;
165  }
166  void setPageNumberingType(const WPXNumberingType pageNumberingType)
167  {
168  m_pageNumberingType = pageNumberingType;
169  }
170  void setPageNumberingFontSize(const double pageNumberingFontSize)
171  {
172  m_pageNumberingFontSize = pageNumberingFontSize;
173  }
174  void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
175  {
176  m_pageNumberingFontName = pageNumberingFontName;
177  }
178  void setPageSpan(const int pageSpan)
179  {
180  m_pageSpan = pageSpan;
181  }
182 
183 protected:
186 
187 private:
198  librevenge::RVNGString m_pageNumberingFontName;
200  std::vector<WPXHeaderFooter> m_headerFooterList;
201 
203 };
204 
205 bool operator==(const WPXPageSpan &, const WPXPageSpan &);
206 #endif /* WPXPAGE_H */
207 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
#define WPX_FOOTER_B
Definition: WPXFileStructure.h:45
#define WPX_NUM_HEADER_FOOTER_TYPES
Definition: WPXFileStructure.h:41
bool operator==(const WPXPageSpan &, const WPXPageSpan &)
Definition: WPXPageSpan.cpp:164
Definition: WPXPageSpan.h:43
double getMarginBottom() const
Definition: WPXPageSpan.h:82
const std::vector< WPXHeaderFooter > & getHeaderFooterList() const
Definition: WPXPageSpan.h:114
double getPageNumberingFontSize() const
Definition: WPXPageSpan.h:102
bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition: WPXPageSpan.cpp:145
void setPageSpan(const int pageSpan)
Definition: WPXPageSpan.h:178
void setPageNumber(const int pageNumberOverride)
Definition: WPXPageSpan.h:161
WPXPageNumberPosition m_pageNumberPosition
Definition: WPXPageSpan.h:194
void setPageNumberingType(const WPXNumberingType pageNumberingType)
Definition: WPXPageSpan.h:166
void setMarginLeft(const double marginLeft)
Definition: WPXPageSpan.h:141
double getMarginTop() const
Definition: WPXPageSpan.h:78
double getMarginRight() const
Definition: WPXPageSpan.h:74
double m_formLength
Definition: WPXPageSpan.h:190
void setFormLength(const double formLength)
Definition: WPXPageSpan.h:129
bool getPageNumberOverriden() const
Definition: WPXPageSpan.h:90
void setMarginRight(const double marginRight)
Definition: WPXPageSpan.h:145
double m_marginBottom
Definition: WPXPageSpan.h:193
double getMarginLeft() const
Definition: WPXPageSpan.h:70
librevenge::RVNGString m_pageNumberingFontName
Definition: WPXPageSpan.h:198
WPXFormOrientation m_formOrientation
Definition: WPXPageSpan.h:191
WPXPageSpan()
Definition: WPXPageSpan.cpp:36
bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
Definition: WPXPageSpan.h:53
bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES]
Definition: WPXPageSpan.h:188
int m_pageSpan
Definition: WPXPageSpan.h:202
double getFormWidth() const
Definition: WPXPageSpan.h:62
void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence, const std::shared_ptr< WPXSubDocument > &subDocument, WPXTableList tableList)
Definition: WPXPageSpan.cpp:87
void setMarginBottom(const double marginBottom)
Definition: WPXPageSpan.h:153
WPXNumberingType getPageNumberingType() const
Definition: WPXPageSpan.h:98
double m_pageNumberingFontSize
Definition: WPXPageSpan.h:199
void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
Definition: WPXPageSpan.h:174
void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
Definition: WPXPageSpan.h:125
double m_marginTop
Definition: WPXPageSpan.h:193
int getPageSpan() const
Definition: WPXPageSpan.h:110
void setFormOrientation(const WPXFormOrientation formOrientation)
Definition: WPXPageSpan.h:137
bool m_isPageNumberSuppressed
Definition: WPXPageSpan.h:189
int m_pageNumberOverride
Definition: WPXPageSpan.h:196
double getFormLength() const
Definition: WPXPageSpan.h:58
double m_marginRight
Definition: WPXPageSpan.h:192
void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition: WPXPageSpan.cpp:132
void setPageNumberingFontSize(const double pageNumberingFontSize)
Definition: WPXPageSpan.h:170
double m_marginLeft
Definition: WPXPageSpan.h:192
std::vector< WPXHeaderFooter > m_headerFooterList
Definition: WPXPageSpan.h:200
WPXFormOrientation getFormOrientation() const
Definition: WPXPageSpan.h:66
virtual ~WPXPageSpan()
Definition: WPXPageSpan.cpp:82
librevenge::RVNGString getPageNumberingFontName() const
Definition: WPXPageSpan.h:106
void setMarginTop(const double marginTop)
Definition: WPXPageSpan.h:149
bool getPageNumberSuppression() const
Definition: WPXPageSpan.h:49
int getPageNumberOverride() const
Definition: WPXPageSpan.h:94
bool m_isPageNumberOverridden
Definition: WPXPageSpan.h:195
WPXPageNumberPosition getPageNumberPosition() const
Definition: WPXPageSpan.h:86
void setFormWidth(const double formWidth)
Definition: WPXPageSpan.h:133
void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
Definition: WPXPageSpan.h:157
WPXNumberingType m_pageNumberingType
Definition: WPXPageSpan.h:197
double m_formWidth
Definition: WPXPageSpan.h:190
void setPageNumberSuppression(const bool suppress)
Definition: WPXPageSpan.h:121
Definition: WPXTableList.h:36
WPXHeaderFooterOccurrence
Definition: libwpd_internal.h:96
WPXHeaderFooterType
Definition: libwpd_internal.h:94
WPXFormOrientation
Definition: libwpd_internal.h:105
WPXPageNumberPosition
Definition: libwpd_internal.h:97
WPXNumberingType
Definition: libwpd_internal.h:92

Generated for libwpd by doxygen 1.9.1