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  * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
4  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
5  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
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  WPXPageSpan(const WPXPageSpan &page);
83  virtual ~WPXPageSpan();
84 
86  {
88  }
89  bool getHeaderFooterSuppression(const uint8_t headerFooterType) const
90  {
91  if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType];
92  return false;
93  }
94  double getFormLength() const
95  {
96  return m_formLength;
97  }
98  double getFormWidth() const
99  {
100  return m_formWidth;
101  }
103  {
104  return m_formOrientation;
105  }
106  double getMarginLeft() const
107  {
108  return m_marginLeft;
109  }
110  double getMarginRight() const
111  {
112  return m_marginRight;
113  }
114  double getMarginTop() const
115  {
116  return m_marginTop;
117  }
118  double getMarginBottom() const
119  {
120  return m_marginBottom;
121  }
123  {
124  return m_pageNumberPosition;
125  }
127  {
129  }
131  {
132  return m_pageNumberOverride;
133  }
135  {
136  return m_pageNumberingType;
137  }
139  {
141  }
143  {
145  }
146  int getPageSpan() const
147  {
148  return m_pageSpan;
149  }
150  const std::vector<WPXHeaderFooter> & getHeaderFooterList() const
151  {
152  return m_headerFooterList;
153  }
154 
155  void setHeaderFooter(const WPXHeaderFooterType type, const uint8_t headerFooterType, const WPXHeaderFooterOccurence occurence,
156  const WPXSubDocument *subDocument, WPXTableList tableList);
157  void setPageNumberSuppression(const bool suppress)
158  {
159  m_isPageNumberSuppressed = suppress;
160  }
161  void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress)
162  {
163  m_isHeaderFooterSuppressed[headerFooterType] = suppress;
164  }
165  void setFormLength(const double formLength)
166  {
167  m_formLength = formLength;
168  }
169  void setFormWidth(const double formWidth)
170  {
171  m_formWidth = formWidth;
172  }
173  void setFormOrientation(const WPXFormOrientation formOrientation)
174  {
175  m_formOrientation = formOrientation;
176  }
177  void setMarginLeft(const double marginLeft)
178  {
179  m_marginLeft = marginLeft;
180  }
181  void setMarginRight(const double marginRight)
182  {
183  m_marginRight = marginRight;
184  }
185  void setMarginTop(const double marginTop)
186  {
187  m_marginTop = marginTop;
188  }
189  void setMarginBottom(const double marginBottom)
190  {
191  m_marginBottom = marginBottom;
192  }
193  void setPageNumberPosition(const WPXPageNumberPosition pageNumberPosition)
194  {
195  m_pageNumberPosition = pageNumberPosition;
196  }
197  void setPageNumber(const int pageNumberOverride)
198  {
199  m_pageNumberOverride = pageNumberOverride;
201  }
202  void setPageNumberingType(const WPXNumberingType pageNumberingType)
203  {
204  m_pageNumberingType = pageNumberingType;
205  }
206  void setPageNumberingFontSize(const double pageNumberingFontSize)
207  {
208  m_pageNumberingFontSize = pageNumberingFontSize;
209  }
210  void setPageNumberingFontName(const WPXString &pageNumberingFontName)
211  {
212  m_pageNumberingFontName = pageNumberingFontName;
213  }
214  void setPageSpan(const int pageSpan)
215  {
216  m_pageSpan = pageSpan;
217  }
218 
219 protected:
222 
223 private:
236  std::vector<WPXHeaderFooter> m_headerFooterList;
237 
239 };
240 
241 bool operator==(const WPXPageSpan &, const WPXPageSpan &);
242 #endif /* WPXPAGE_H */
243 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.1.2