MWAWPageSpan.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 #ifndef MWAWPAGESPAN_H
35 #define MWAWPAGESPAN_H
36 #include <vector>
37 #include "libmwaw_internal.hxx"
38 
39 class WPXPropertyList;
40 class WPXDocumentInterface;
41 class WPXDocumentProperty;
42 
44 
46 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
47 
48 namespace MWAWPageSpanInternal
49 {
51 typedef shared_ptr<HeaderFooter> HeaderFooterPtr;
52 }
53 
56 {
57  friend class MWAWContentListener;
58 public:
60 
63 
66  };
67 public:
69  MWAWPageSpan();
71  virtual ~MWAWPageSpan();
72 
74  double getFormLength() const {
75  return m_formLength;
76  }
78  double getFormWidth() const {
79  return m_formWidth;
80  }
83  return m_formOrientation;
84  }
86  double getMarginLeft() const {
87  return m_marginLeft;
88  }
90  double getMarginRight() const {
91  return m_marginRight;
92  }
94  double getMarginTop() const {
95  return m_marginTop;
96  }
98  double getMarginBottom() const {
99  return m_marginBottom;
100  }
103  return m_backgroundColor;
104  }
106  return m_pageNumberPosition;
107  }
108  int getPageNumber() const {
109  return m_pageNumber;
110  }
112  return m_pageNumberingType;
113  }
114  double getPageNumberingFontSize() const {
116  }
117  WPXString getPageNumberingFontName() const {
119  }
120  int getPageSpan() const {
121  return m_pageSpan;
122  }
123  const std::vector<MWAWPageSpanInternal::HeaderFooterPtr> & getHeaderFooterList() const {
124  return m_headerFooterList;
125  }
126 
128  void setHeaderFooter(const HeaderFooterType type, const HeaderFooterOccurence occurence,
129  MWAWSubDocumentPtr &subDocument);
131  void setFormLength(const double formLength) {
132  m_formLength = formLength;
133  }
135  void setFormWidth(const double formWidth) {
136  m_formWidth = formWidth;
137  }
139  void setFormOrientation(const FormOrientation formOrientation) {
140  m_formOrientation = formOrientation;
141  }
143  void setMarginLeft(const double marginLeft) {
144  m_marginLeft = (marginLeft > 0) ? marginLeft : 0.01;
145  }
147  void setMarginRight(const double marginRight) {
148  m_marginRight = (marginRight > 0) ? marginRight : 0.01;
149  }
151  void setMarginTop(const double marginTop) {
152  m_marginTop =(marginTop > 0) ? marginTop : 0.01;
153  }
155  void setMarginBottom(const double marginBottom) {
156  m_marginBottom = (marginBottom > 0) ? marginBottom : 0.01;
157  }
159  void checkMargins();
160 
163  m_backgroundColor=color;
164  }
165  void setPageNumberPosition(const PageNumberPosition pageNumberPosition) {
166  m_pageNumberPosition = pageNumberPosition;
167  }
168  void setPageNumber(const int pageNumber) {
169  m_pageNumber = pageNumber;
170  }
171  void setPageNumberingType(const libmwaw::NumberingType pageNumberingType) {
172  m_pageNumberingType = pageNumberingType;
173  }
174  void setPageNumberingFontSize(const double pageNumberingFontSize) {
175  m_pageNumberingFontSize = pageNumberingFontSize;
176  }
177  void setPageNumberingFontName(const WPXString &pageNumberingFontName) {
178  m_pageNumberingFontName = pageNumberingFontName;
179  }
180  void setPageSpan(const int pageSpan) {
181  m_pageSpan = pageSpan;
182  }
183 
184  bool operator==(shared_ptr<MWAWPageSpan> const &pageSpan) const;
185  bool operator!=(shared_ptr<MWAWPageSpan> const &pageSpan) const {
186  return !operator==(pageSpan);
187  }
188 protected:
189  // interface with MWAWContentListener
190  void getPageProperty(WPXPropertyList &pList) const;
191  void sendHeaderFooters(MWAWContentListener *listener,
192  WPXDocumentInterface *documentInterface);
193 
194 protected:
195 
200 
201  void _insertPageNumberParagraph(WPXDocumentInterface *documentInterface);
202 private:
213  std::vector<MWAWPageSpanInternal::HeaderFooterPtr> m_headerFooterList;
214 
216 };
217 
218 #endif
219 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Sat May 4 2013 11:47:12 for libmwaw by doxygen 1.8.3.1