WPSPageSpan.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
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 WPSPAGESPAN_H
29 #define WPSPAGESPAN_H
30 #include <vector>
31 #include "libwps_internal.h"
32 
33 class WPXPropertyList;
34 class WPXDocumentProperty;
35 class WPSContentListener;
36 
38 typedef shared_ptr<WPSSubDocument> WPSSubDocumentPtr;
39 
40 namespace WPSPageSpanInternal
41 {
43 typedef shared_ptr<HeaderFooter> HeaderFooterPtr;
44 }
45 
47 {
48  friend class WPSContentListener;
49 public:
51 
54 
57  };
58 public:
59  WPSPageSpan();
60  WPSPageSpan(const WPSPageSpan &page);
61  virtual ~WPSPageSpan();
62 
63  double getFormLength() const
64  {
65  return m_formLength;
66  }
67  double getFormWidth() const
68  {
69  return m_formWidth;
70  }
72  {
73  return m_formOrientation;
74  }
75  double getMarginLeft() const
76  {
77  return m_marginLeft;
78  }
79  double getMarginRight() const
80  {
81  return m_marginRight;
82  }
83  double getMarginTop() const
84  {
85  return m_marginTop;
86  }
87  double getMarginBottom() const
88  {
89  return m_marginBottom;
90  }
92  {
93  return m_pageNumberPosition;
94  }
95  int getPageNumber() const
96  {
97  return m_pageNumber;
98  }
100  {
101  return m_pageNumberingType;
102  }
104  {
106  }
107  WPXString getPageNumberingFontName() const
108  {
110  }
111  int getPageSpan() const
112  {
113  return m_pageSpan;
114  }
115  const std::vector<WPSPageSpanInternal::HeaderFooterPtr> & getHeaderFooterList() const
116  {
117  return m_headerFooterList;
118  }
119 
120  void setHeaderFooter(const HeaderFooterType type, const HeaderFooterOccurence occurence,
121  WPSSubDocumentPtr &subDocument);
122  void setFormLength(const double formLength)
123  {
124  m_formLength = formLength;
125  }
126  void setFormWidth(const double formWidth)
127  {
128  m_formWidth = formWidth;
129  }
130  void setFormOrientation(const FormOrientation formOrientation)
131  {
132  m_formOrientation = formOrientation;
133  }
134  void setMarginLeft(const double marginLeft)
135  {
136  m_marginLeft = marginLeft;
137  }
138  void setMarginRight(const double marginRight)
139  {
140  m_marginRight = marginRight;
141  }
142  void setMarginTop(const double marginTop)
143  {
144  m_marginTop = marginTop;
145  }
146  void setMarginBottom(const double marginBottom)
147  {
148  m_marginBottom = marginBottom;
149  }
150  void setPageNumberPosition(const PageNumberPosition pageNumberPosition)
151  {
152  m_pageNumberPosition = pageNumberPosition;
153  }
154  void setPageNumber(const int pageNumber)
155  {
156  m_pageNumber = pageNumber;
157  }
158  void setPageNumberingType(const libwps::NumberingType pageNumberingType)
159  {
160  m_pageNumberingType = pageNumberingType;
161  }
162  void setPageNumberingFontSize(const double pageNumberingFontSize)
163  {
164  m_pageNumberingFontSize = pageNumberingFontSize;
165  }
166  void setPageNumberingFontName(const WPXString &pageNumberingFontName)
167  {
168  m_pageNumberingFontName = pageNumberingFontName;
169  }
170  void setPageSpan(const int pageSpan)
171  {
172  m_pageSpan = pageSpan;
173  }
174 
175  bool operator==(shared_ptr<WPSPageSpan> const &pageSpan) const;
176  bool operator!=(shared_ptr<WPSPageSpan> const &pageSpan) const
177  {
178  return !operator==(pageSpan);
179  }
180 protected:
181  // interface with WPSContentListener
182  void getPageProperty(WPXPropertyList &pList) const;
183  void sendHeaderFooters(WPSContentListener *listener,
184  WPXDocumentInterface *documentInterface);
185 
186 protected:
187 
192 
193  void _insertPageNumberParagraph(WPXDocumentInterface *documentInterface);
194 private:
204  std::vector<WPSPageSpanInternal::HeaderFooterPtr> m_headerFooterList;
205 
207 };
208 
209 #endif
210 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated on Wed Aug 8 2012 16:07:57 for libwps by doxygen 1.8.1.2