Foxit PDF SDK

fs_headerfooter.h
浏览该文件的文档.
1
15 #ifndef FS_HEADERFOOTER_H_
16 #define FS_HEADERFOOTER_H_
17
18 #include "common/fs_common.h"
19
25 namespace foxit {
29 namespace pdf {
35 class PageNumberRange FS_FINAL : public Object {
36 public:
44 explicit PageNumberRange(int32 start_number, int32 end_number, foxit::common::Range::Filter filter)
45 : start_number(start_number)
46 , end_number(end_number)
47 , filter(filter) {}
48
50 PageNumberRange()
51 : start_number(-1)
52 , end_number(-1)
53 , filter(foxit::common::Range::e_All) {}
54
60 PageNumberRange(const PageNumberRange& page_range)
61 : start_number(page_range.start_number)
62 , end_number(page_range.end_number)
63 , filter(page_range.filter) {}
64
72 PageNumberRange& operator=(const PageNumberRange& page_range) {
73 start_number = page_range.start_number;
74 end_number = page_range.end_number;
75 filter = page_range.filter;
76 return *this;
77 }
78
88 void Set(int32 start_number, int32 end_number, foxit::common::Range::Filter filter) {
89 this->start_number = start_number;
90 this->end_number = end_number;
91 this->filter = filter;
92 }
93
95 int32 start_number;
97 int32 end_number;
101 foxit::common::Range::Filter filter;
102 };
103
110 class HeaderFooterContent FS_FINAL : public Object {
111 public:
122 explicit HeaderFooterContent(const WString& header_left_content, const WString& header_center_content,
123 const WString& header_right_content, const WString& footer_left_content,
124 const WString& footer_center_content, const WString& footer_right_content)
125 : header_left_content(header_left_content)
126 , header_center_content(header_center_content)
127 , header_right_content(header_right_content)
128 , footer_left_content(footer_left_content)
129 , footer_center_content(footer_center_content)
130 , footer_right_content(footer_right_content) {}
131
133 HeaderFooterContent() {}
134
140 HeaderFooterContent(const HeaderFooterContent& other)
141 : header_left_content(other.header_left_content)
142 , header_center_content(other.header_center_content)
143 , header_right_content(other.header_right_content)
144 , footer_left_content(other.footer_left_content)
145 , footer_center_content(other.footer_center_content)
146 , footer_right_content(other.footer_right_content) {}
147
155 HeaderFooterContent& operator=(const HeaderFooterContent& other) {
156 header_left_content = other.header_left_content;
157 header_center_content = other.header_center_content;
158 header_right_content = other.header_right_content;
159 footer_left_content = other.footer_left_content;
160 footer_center_content = other.footer_center_content;
161 footer_right_content = other.footer_right_content;
162 return *this;
163 }
164
177 void Set(const WString& header_left_content, const WString& header_center_content,
178 const WString& header_right_content, const WString& footer_left_content,
179 const WString& footer_center_content, const WString& footer_right_content) {
180 this->header_left_content = header_left_content;
181 this->header_center_content = header_center_content;
182 this->header_right_content = header_right_content;
183 this->footer_left_content = footer_left_content;
184 this->footer_center_content = footer_center_content;
185 this->footer_right_content = footer_right_content;
186 }
187
189 WString header_left_content;
191 WString header_center_content;
193 WString header_right_content;
195 WString footer_left_content;
197 WString footer_center_content;
199 WString footer_right_content;
200 };
201
207 HeaderFooter(const HeaderFooter& other)
208 : font(other.font)
209 , text_size(other.text_size)
210 , text_color(other.text_color)
211 , page_range(other.page_range)
212 , page_margin(other.page_margin)
213 , has_text_shrinked(other.has_text_shrinked)
214 , has_fixedsize_for_print(other.has_fixedsize_for_print)
215 , start_page_number(other.start_page_number)
216 , content(other.content)
217 , is_to_embed_font(other.is_to_embed_font)
218 , is_underline(other.is_underline)
219 , is_replace_font(other.is_replace_font) {}
220
228 HeaderFooter& operator=(const HeaderFooter& other) {
229 font = other.font;
230 text_size = other.text_size;
231 text_color = other.text_color;
232 page_range = other.page_range;
233 page_margin = other.page_margin;
234 has_text_shrinked = other.has_text_shrinked;
235 has_fixedsize_for_print = other.has_fixedsize_for_print;
236 start_page_number = other.start_page_number;
237 content = other.content;
238 is_to_embed_font = other.is_to_embed_font;
239 is_underline = other.is_underline;
240 is_replace_font = other.is_replace_font;
241 return *this;
242 }
243
266 void Set(const common::Font& font, float text_size, RGB text_color, const PageNumberRange& page_range, RectF page_margin,
267 bool has_text_shrinked, bool has_fixedsize_for_print, int start_page_number,
268 const HeaderFooterContent& content, bool is_to_embed_font, bool is_underline) {
269 this->font = font;
270 this->text_size = text_size;
271 this->text_color = text_color;
272 this->page_range = page_range;
273 this->page_margin = page_margin;
274 this->has_text_shrinked = has_text_shrinked;
275 this->has_fixedsize_for_print = has_fixedsize_for_print;
276 this->start_page_number = start_page_number;
277 this->content = content;
278 this->is_to_embed_font = is_to_embed_font;
279 this->is_underline = is_underline;
280 this->is_replace_font = true;
281 }
282
289 common::Font font;
290
292 float text_size;
293
295 RGB text_color;
296
302 PageNumberRange page_range;
303
316 RectF page_margin;
317
319 bool has_text_shrinked;
320
322 bool has_fixedsize_for_print;
323
330 int start_page_number;
331
333 HeaderFooterContent content;
334
336 bool is_to_embed_font;
337
339 bool is_underline;
340
342 bool is_replace_font;
343 };
344
345 #endif
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:221
fs_common.h
通用定义和类的头文件。
foxit::WString
CFX_WideString WString
宽字符串。
Definition: fs_basictypes.h:223
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::RGB
uint32 RGB
RGB 颜色类型，24 位，((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:212
foxit::int32
FX_INT32 int32
有符号 32 位整数。
Definition: fs_basictypes.h:194
foxit::common::Range::Filter
Filter
范围过滤器枚举。
Definition: fs_common.h:1371
foxit::RectF
CFX_FloatRect RectF
矩形，浮点型。
Definition: fs_basictypes.h:473