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 WPXHeaderFooterOccurence occurence,
42  const uint8_t internalType, const WPXSubDocument *subDocument, WPXTableList tableList);
43  WPXHeaderFooter(const WPXHeaderFooterType headerFooterType, const WPXHeaderFooterOccurence occurence,
44  const uint8_t 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_occurence;
55  }
56  uint8_t getInternalType() const
57  {
58  return m_internalType;
59  }
61  {
62  return m_subDocument;
63  }
65  {
66  return m_tableList;
67  }
68 
69 private:
72  uint8_t 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 uint8_t 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  }
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 uint8_t headerFooterType, const WPXHeaderFooterOccurence occurence,
155  const WPXSubDocument *subDocument, WPXTableList tableList);
156  void setPageNumberSuppression(const bool suppress)
157  {
158  m_isPageNumberSuppressed = suppress;
159  }
160  void setHeadFooterSuppression(const uint8_t 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 WPXString &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:
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: */

Generated for libwpd by doxygen 1.8.4