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 #include "WPXFileStructure.h"
31 #include <vector>
32 #include "WPXTable.h"
33 #include "libwpd_internal.h"
34 #include "WPXSubDocument.h"
35 
36 // intermediate page representation class: for internal use only (by the high-level content/styles listeners). should not be exported.
37 
39 {
40 public:
41  WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurrence occurrence,
42  const unsigned char internalType, const WPXSubDocument *subDocument, WPXTableList tableList);
43  WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurrence occurrence,
44  const unsigned char internalType, const WPXSubDocument *subDocument);
45  WPXHeaderFooter(const WPXHeaderFooter &headerFooter);
47  WPXHeaderFooter &operator=(const WPXHeaderFooter &headerFooter);
49  {
50  return m_type;
51  }
53  {
54  return m_occurrence;
55  }
56  unsigned char getInternalType() const
57  {
58  return m_internalType;
59  }
61  {
62  return m_subDocument;
63  }
65  {
66  return m_tableList;
67  }
68 
69 private:
72  unsigned char m_internalType; // for suppression
73  const WPXSubDocument *m_subDocument; // for the actual text
75 };
76 
78 {
79 public:
80  WPXPageSpan();
81  WPXPageSpan(const WPXPageSpan &page, double paragraphMarginLeft, double paragraphMarginRight);
82  virtual ~WPXPageSpan();
83 
85  {
87  }
88  bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
89  {
90  if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType];
91  return false;
92  }
93  double getFormLength() const
94  {
95  return m_formLength;
96  }
97  double getFormWidth() const
98  {
99  return m_formWidth;
100  }
102  {
103  return m_formOrientation;
104  }
105  double getMarginLeft() const
106  {
107  return m_marginLeft;
108  }
109  double getMarginRight() const
110  {
111  return m_marginRight;
112  }
113  double getMarginTop() const
114  {
115  return m_marginTop;
116  }
117  double getMarginBottom() const
118  {
119  return m_marginBottom;
120  }
122  {
123  return m_pageNumberPosition;
124  }
126  {
128  }
130  {
131  return m_pageNumberOverride;
132  }
134  {
135  return m_pageNumberingType;
136  }
138  {
140  }
141  librevenge::RVNGString getPageNumberingFontName() const
142  {
144  }
145  int getPageSpan() const
146  {
147  return m_pageSpan;
148  }
149  const std::vector<WPXHeaderFooter> &getHeaderFooterList() const
150  {
151  return m_headerFooterList;
152  }
153 
154  void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence,
155  const WPXSubDocument *subDocument, WPXTableList tableList);
156  void setPageNumberSuppression(const bool suppress)
157  {
158  m_isPageNumberSuppressed = suppress;
159  }
160  void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
161  {
162  m_isHeaderFooterSuppressed[headerFooterType] = suppress;
163  }
164  void setFormLength(const double formLength)
165  {
166  m_formLength = formLength;
167  }
168  void setFormWidth(const double formWidth)
169  {
170  m_formWidth = formWidth;
171  }
172  void setFormOrientation(const WPXFormOrientation formOrientation)
173  {
174  m_formOrientation = formOrientation;
175  }
176  void setMarginLeft(const double marginLeft)
177  {
178  m_marginLeft = marginLeft;
179  }
180  void setMarginRight(const double marginRight)
181  {
182  m_marginRight = marginRight;
183  }
184  void setMarginTop(const double marginTop)
185  {
186  m_marginTop = marginTop;
187  }
188  void setMarginBottom(const double marginBottom)
189  {
190  m_marginBottom = marginBottom;
191  }
192  void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
193  {
194  m_pageNumberPosition = pageNumberPosition;
195  }
196  void setPageNumber(const int pageNumberOverride)
197  {
198  m_pageNumberOverride = pageNumberOverride;
200  }
201  void setPageNumberingType(const WPXNumberingType pageNumberingType)
202  {
203  m_pageNumberingType = pageNumberingType;
204  }
205  void setPageNumberingFontSize(const double pageNumberingFontSize)
206  {
207  m_pageNumberingFontSize = pageNumberingFontSize;
208  }
209  void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
210  {
211  m_pageNumberingFontName = pageNumberingFontName;
212  }
213  void setPageSpan(const int pageSpan)
214  {
215  m_pageSpan = pageSpan;
216  }
217 
218 protected:
221 
222 private:
233  librevenge::RVNGString m_pageNumberingFontName;
235  std::vector<WPXHeaderFooter> m_headerFooterList;
236 
238 };
239 
240 bool operator==(const WPXPageSpan &, const WPXPageSpan &);
241 #endif /* WPXPAGE_H */
242 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXNumberingType
Definition: libwpd_internal.h:92
void setPageNumberSuppression(const bool suppress)
Definition: WPXPageSpan.h:156
void setFormOrientation(const WPXFormOrientation formOrientation)
Definition: WPXPageSpan.h:172
void setPageSpan(const int pageSpan)
Definition: WPXPageSpan.h:213
WPXFormOrientation getFormOrientation() const
Definition: WPXPageSpan.h:101
WPXHeaderFooterOccurrence m_occurrence
Definition: WPXPageSpan.h:71
void setPageNumberingType(const WPXNumberingType pageNumberingType)
Definition: WPXPageSpan.h:201
void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
Definition: WPXPageSpan.h:192
std::vector< WPXHeaderFooter > m_headerFooterList
Definition: WPXPageSpan.h:235
WPXPageNumberPosition m_pageNumberPosition
Definition: WPXPageSpan.h:229
double m_marginRight
Definition: WPXPageSpan.h:227
WPXHeaderFooterOccurrence getOccurrence() const
Definition: WPXPageSpan.h:52
bool operator==(const WPXPageSpan &, const WPXPageSpan &)
Definition: WPXPageSpan.cpp:214
librevenge::RVNGString getPageNumberingFontName() const
Definition: WPXPageSpan.h:141
WPXPageSpan()
Definition: WPXPageSpan.cpp:86
void setHeaderFooter(const WPXHeaderFooterType type, const unsigned char headerFooterType, const WPXHeaderFooterOccurrence occurrence, const WPXSubDocument *subDocument, WPXTableList tableList)
Definition: WPXPageSpan.cpp:137
WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurrence occurrence, const unsigned char internalType, const WPXSubDocument *subDocument, WPXTableList tableList)
Definition: WPXPageSpan.cpp:39
void _removeHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition: WPXPageSpan.cpp:182
void setPageNumber(const int pageNumberOverride)
Definition: WPXPageSpan.h:196
int getPageNumberOverride() const
Definition: WPXPageSpan.h:129
int m_pageNumberOverride
Definition: WPXPageSpan.h:231
double m_formWidth
Definition: WPXPageSpan.h:225
int m_pageSpan
Definition: WPXPageSpan.h:237
WPXHeaderFooterOccurrence
Definition: libwpd_internal.h:96
void setPageNumberingFontName(const librevenge::RVNGString &pageNumberingFontName)
Definition: WPXPageSpan.h:209
unsigned char m_internalType
Definition: WPXPageSpan.h:72
WPXHeaderFooterType getType() const
Definition: WPXPageSpan.h:48
WPXNumberingType getPageNumberingType() const
Definition: WPXPageSpan.h:133
int getPageSpan() const
Definition: WPXPageSpan.h:145
Definition: WPXTable.h:79
void setFormWidth(const double formWidth)
Definition: WPXPageSpan.h:168
void setMarginRight(const double marginRight)
Definition: WPXPageSpan.h:180
WPXPageNumberPosition getPageNumberPosition() const
Definition: WPXPageSpan.h:121
double getMarginRight() const
Definition: WPXPageSpan.h:109
~WPXHeaderFooter()
Definition: WPXPageSpan.cpp:81
void setPageNumberingFontSize(const double pageNumberingFontSize)
Definition: WPXPageSpan.h:205
void setMarginLeft(const double marginLeft)
Definition: WPXPageSpan.h:176
double getMarginBottom() const
Definition: WPXPageSpan.h:117
WPXNumberingType m_pageNumberingType
Definition: WPXPageSpan.h:232
const std::vector< WPXHeaderFooter > & getHeaderFooterList() const
Definition: WPXPageSpan.h:149
double getPageNumberingFontSize() const
Definition: WPXPageSpan.h:137
WPXTableList m_tableList
Definition: WPXPageSpan.h:74
WPXFormOrientation
Definition: libwpd_internal.h:105
double m_pageNumberingFontSize
Definition: WPXPageSpan.h:234
Definition: WPXSubDocument.h:34
bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES]
Definition: WPXPageSpan.h:223
const WPXSubDocument * m_subDocument
Definition: WPXPageSpan.h:73
bool getPageNumberSuppression() const
Definition: WPXPageSpan.h:84
double m_marginLeft
Definition: WPXPageSpan.h:227
double getFormLength() const
Definition: WPXPageSpan.h:93
void setFormLength(const double formLength)
Definition: WPXPageSpan.h:164
virtual ~WPXPageSpan()
Definition: WPXPageSpan.cpp:132
librevenge::RVNGString m_pageNumberingFontName
Definition: WPXPageSpan.h:233
bool m_isPageNumberOverridden
Definition: WPXPageSpan.h:230
bool getHeaderFooterSuppression(const unsigned char headerFooterType) const
Definition: WPXPageSpan.h:88
WPXTableList getTableList() const
Definition: WPXPageSpan.h:64
const WPXSubDocument * getSubDocument() const
Definition: WPXPageSpan.h:60
Definition: WPXPageSpan.h:77
bool m_isPageNumberSuppressed
Definition: WPXPageSpan.h:224
double getFormWidth() const
Definition: WPXPageSpan.h:97
double getMarginTop() const
Definition: WPXPageSpan.h:113
WPXPageNumberPosition
Definition: libwpd_internal.h:97
unsigned char getInternalType() const
Definition: WPXPageSpan.h:56
WPXFormOrientation m_formOrientation
Definition: WPXPageSpan.h:226
void setMarginTop(const double marginTop)
Definition: WPXPageSpan.h:184
double m_formLength
Definition: WPXPageSpan.h:225
#define WPX_FOOTER_B
Definition: WPXFileStructure.h:45
double getMarginLeft() const
Definition: WPXPageSpan.h:105
void setMarginBottom(const double marginBottom)
Definition: WPXPageSpan.h:188
void setHeadFooterSuppression(const unsigned char headerFooterType, const bool suppress)
Definition: WPXPageSpan.h:160
WPXHeaderFooter & operator=(const WPXHeaderFooter &headerFooter)
Definition: WPXPageSpan.cpp:68
Definition: WPXPageSpan.h:38
bool _containsHeaderFooter(WPXHeaderFooterType type, WPXHeaderFooterOccurrence occurrence)
Definition: WPXPageSpan.cpp:195
WPXHeaderFooterType
Definition: libwpd_internal.h:94
double m_marginBottom
Definition: WPXPageSpan.h:228
double m_marginTop
Definition: WPXPageSpan.h:228
WPXHeaderFooterType m_type
Definition: WPXPageSpan.h:70
bool getPageNumberOverriden() const
Definition: WPXPageSpan.h:125
#define WPX_NUM_HEADER_FOOTER_TYPES
Definition: WPXFileStructure.h:41

Generated for libwpd by doxygen 1.8.14