Main Page
Namespaces
Classes
Files
File List
File Members
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
38
class
WPXHeaderFooter
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);
46
~WPXHeaderFooter
();
47
WPXHeaderFooter
&
operator=
(
const
WPXHeaderFooter
&headerFooter);
48
WPXHeaderFooterType
getType
()
const
49
{
50
return
m_type
;
51
}
52
WPXHeaderFooterOccurence
getOccurence
()
const
53
{
54
return
m_occurence
;
55
}
56
uint8_t
getInternalType
()
const
57
{
58
return
m_internalType
;
59
}
60
const
WPXSubDocument
*
getSubDocument
()
const
61
{
62
return
m_subDocument
;
63
}
64
WPXTableList
getTableList
()
const
65
{
66
return
m_tableList
;
67
}
68
69
private
:
70
WPXHeaderFooterType
m_type
;
71
WPXHeaderFooterOccurence
m_occurence
;
72
uint8_t
m_internalType
;
// for suppression
73
const
WPXSubDocument
*
m_subDocument
;
// for the actual text
74
WPXTableList
m_tableList
;
75
};
76
77
class
WPXPageSpan
78
{
79
public
:
80
WPXPageSpan
();
81
WPXPageSpan
(
const
WPXPageSpan
&page,
double
paragraphMarginLeft,
double
paragraphMarginRight);
82
WPXPageSpan
(
const
WPXPageSpan
&page);
83
virtual
~WPXPageSpan
();
84
85
bool
getPageNumberSuppression
()
const
86
{
87
return
m_isPageNumberSuppressed
;
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
}
102
WPXFormOrientation
getFormOrientation
()
const
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
}
122
WPXPageNumberPosition
getPageNumberPosition
()
const
123
{
124
return
m_pageNumberPosition
;
125
}
126
bool
getPageNumberOverriden
()
const
127
{
128
return
m_isPageNumberOverridden
;
129
}
130
int
getPageNumberOverride
()
const
131
{
132
return
m_pageNumberOverride
;
133
}
134
WPXNumberingType
getPageNumberingType
()
const
135
{
136
return
m_pageNumberingType
;
137
}
138
double
getPageNumberingFontSize
()
const
139
{
140
return
m_pageNumberingFontSize
;
141
}
142
WPXString
getPageNumberingFontName
()
const
143
{
144
return
m_pageNumberingFontName
;
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;
200
m_isPageNumberOverridden
=
true
;
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
:
220
void
_removeHeaderFooter
(
WPXHeaderFooterType
type,
WPXHeaderFooterOccurence
occurence);
221
bool
_containsHeaderFooter
(
WPXHeaderFooterType
type,
WPXHeaderFooterOccurence
occurence);
222
223
private
:
224
bool
m_isHeaderFooterSuppressed
[
WPX_NUM_HEADER_FOOTER_TYPES
];
225
bool
m_isPageNumberSuppressed
;
226
double
m_formLength
,
m_formWidth
;
227
WPXFormOrientation
m_formOrientation
;
228
double
m_marginLeft
,
m_marginRight
;
229
double
m_marginTop
,
m_marginBottom
;
230
WPXPageNumberPosition
m_pageNumberPosition
;
231
bool
m_isPageNumberOverridden
;
232
int
m_pageNumberOverride
;
233
WPXNumberingType
m_pageNumberingType
;
234
WPXString
m_pageNumberingFontName
;
235
double
m_pageNumberingFontSize
;
236
std::vector<WPXHeaderFooter>
m_headerFooterList
;
237
238
int
m_pageSpan
;
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