Foxit PDF SDK
foxit::pdf::HeaderFooterContentGenerator类 参考
类 foxit::pdf::HeaderFooterContentGenerator 继承关系图:
foxit::Base

Public 类型

enum  DateFormatType {
  e_DateFormatMSlashD = 0, e_DateFormatMSlashDSlashYY = 1, e_DateFormatMSlashDSlashYYYY = 2, e_DateFormatMMSlashDDSlashYY = 3,
  e_DateFormatMMSlashDDSlashYYYY = 4, e_DateFormatDSlashMSlashYY = 5, e_DateFormatDSlashMSlashYYYY = 6, e_DateFormatDDSlashMMSlashYY = 7,
  e_DateFormatDDSlashMMSlashYYYY = 8, e_DateFormatMMSlashYY = 9, e_DateFormatMMSlashYYYY = 10, e_DateFormatMDotDDotYY = 11,
  e_DateFormatMDotDDotYYYY = 12, e_DateFormatMMDotDDDotYY = 13, e_DateFormatMMDotDDDotYYYY = 14, e_DateFormatMMDotYY = 15,
  e_DateFormatDDotMDotYYYY = 16, e_DateFormatDDDotMMDotYY = 17, e_DateFormatDDDotMMDotYYYY = 18, e_DateFormatYYHyphenMMHyphenDD = 19,
  e_DateFormatYYYYHyphenMMHyphenDD = 20
}
 日期格式类型的枚举。 更多...
 
enum  PageNumberFormat {
  e_PageNumberFormatDefault = 0, e_PageNumberFormatNumberOfCount = 1, e_PageNumberFormatNumberSlashCount = 2, e_PageNumberFormatPageNumber = 3,
  e_PageNumberFormatPageNumberOfCount = 4
}
 页码格式类型的枚举。 更多...
 

Public 成员函数

 HeaderFooterContentGenerator ()
 Constructor.
 
 HeaderFooterContentGenerator (const HeaderFooterContentGenerator &other)
 Constructor, with another header-footer content generator object. 更多...
 
 ~HeaderFooterContentGenerator ()
 Destructor.
 
void AddDate (DateFormatType format_type)
 Add a format string for a specified date format type. 更多...
 
void AddPageNumber (PageNumberFormat format_type)
 Add a format string for a specified page number format type. 更多...
 
void AddString (const WString &new_string)
 Add a string. 更多...
 
void Clear ()
 Clear strings (including format strings) which have been added to current content generator. 更多...
 
WString GenerateContent ()
 Generate a final string which can be used as header-footer content. 更多...
 
bool IsEmpty () const
 Check whether current object is empty or not. 更多...
 
bool operator!= (const HeaderFooterContentGenerator &other) const
 Not equal operator. 更多...
 
HeaderFooterContentGenerator & operator= (const HeaderFooterContentGenerator &other)
 Assign operator. 更多...
 
bool operator== (const HeaderFooterContentGenerator &other) const
 Equal operator. 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

This class is the generator for header-footer content. It can help user to combine dates in specified format, page numbers in specified format and any customized text content to one string which can be used as header-footer content.

成员枚举类型说明

◆ DateFormatType

日期格式类型的枚举。

此枚举的值可以单独使用。

枚举值
e_DateFormatMSlashD 

如果使用此项,"m/d" 将被用作日期格式字符串。

e_DateFormatMSlashDSlashYY 

如果使用此项,"m/d/yy" 将被用作日期格式字符串。

e_DateFormatMSlashDSlashYYYY 

如果使用此项,"m/d/yyyy" 将被用作日期格式字符串。

e_DateFormatMMSlashDDSlashYY 

如果使用此项,"mm/dd/yy" 将被用作日期格式字符串。

e_DateFormatMMSlashDDSlashYYYY 

如果使用此项,"mm/dd/yyyy" 将被用作日期格式字符串。

e_DateFormatDSlashMSlashYY 

如果使用此项,"d/m/yy" 将被用作日期格式字符串。

e_DateFormatDSlashMSlashYYYY 

如果使用此项,"d/m/yyyy" 将被用作日期格式字符串。

e_DateFormatDDSlashMMSlashYY 

如果使用此项,"dd/mm/yy" 将被用作日期格式字符串。

e_DateFormatDDSlashMMSlashYYYY 

如果使用此项,"dd/mm/yyyy" 将被用作日期格式字符串。

e_DateFormatMMSlashYY 

如果使用此项,"mm/yy" 将被用作日期格式字符串。

e_DateFormatMMSlashYYYY 

如果使用此项,"mm/yyyy" 将被用作日期格式字符串。

e_DateFormatMDotDDotYY 

如果使用此项,"m.d.yy" 将被用作日期格式字符串。

e_DateFormatMDotDDotYYYY 

如果使用此项,"m.d.yyyy" 将被用作日期格式字符串。

e_DateFormatMMDotDDDotYY 

如果使用此项,"mm.dd.yy" 将被用作日期格式字符串。

e_DateFormatMMDotDDDotYYYY 

如果使用此项,"mm.dd.yyyy" 将被用作日期格式字符串。

e_DateFormatMMDotYY 

如果使用此项,"mm.yy" 将被用作日期格式字符串。

e_DateFormatDDotMDotYYYY 

如果使用此项,"d.m.yyyy" 将被用作日期格式字符串。

e_DateFormatDDDotMMDotYY 

如果使用此项,"dd.mm.yy" 将被用作日期格式字符串。

e_DateFormatDDDotMMDotYYYY 

如果使用此项,"dd.mm.yyyy" 将被用作日期格式字符串。

e_DateFormatYYHyphenMMHyphenDD 

如果使用此项,"yy-mm-dd" 将被用作日期格式字符串。

e_DateFormatYYYYHyphenMMHyphenDD 

如果使用此项,"yyyy-mm-dd" 将被用作日期格式字符串。

◆ PageNumberFormat

页码格式类型的枚举。

此枚举的值可以单独使用。

枚举值
e_PageNumberFormatDefault 

如果使用此项,"1" 将被用作页码格式字符串。

e_PageNumberFormatNumberOfCount 

如果使用此项,"1 of n" 将被用作页码格式字符串。

e_PageNumberFormatNumberSlashCount 

如果使用此项,"1/n" 将被用作页码格式字符串。

e_PageNumberFormatPageNumber 

如果使用此项,"Page 1" 将被用作页码格式字符串。

e_PageNumberFormatPageNumberOfCount 

如果使用此项,"Page 1 of n" 将被用作页码格式字符串。

构造及析构函数说明

◆ HeaderFooterContentGenerator()

foxit::pdf::HeaderFooterContentGenerator::HeaderFooterContentGenerator ( const HeaderFooterContentGenerator &  other)

Constructor, with another header-footer content generator object.

参数
[in]otherAnother header-footer content generator object.

成员函数说明

◆ AddDate()

void foxit::pdf::HeaderFooterContentGenerator::AddDate ( DateFormatType  format_type)

Add a format string for a specified date format type.

Header-footer content can contain format string for date. The date format string will be replaced by actual date time in specified format when the header-footer is used in PDF document.

参数
[in]format_typeDate format type. Please refer to values starting from HeaderFooterContentGenerator::e_DateFormatMSlashD and this should be one of these values.
返回
None.

◆ AddPageNumber()

void foxit::pdf::HeaderFooterContentGenerator::AddPageNumber ( PageNumberFormat  format_type)

Add a format string for a specified page number format type.

Header-footer content can contain format string for page number. The page number format string will be replaced by page number in specified format when the header-footer is used in PDF document.

参数
[in]format_typePage number format type. Please refer to values starting from HeaderFooterContentGenerator::e_PageNumberFormatDefault and this should be one of these values.
返回
None.

◆ AddString()

void foxit::pdf::HeaderFooterContentGenerator::AddString ( const WString &  new_string)

Add a string.

参数
[in]new_stringA string.
返回
None.

◆ Clear()

void foxit::pdf::HeaderFooterContentGenerator::Clear ( )

Clear strings (including format strings) which have been added to current content generator.

After this function is called, current content generator will be the same as a newly constructed object.

返回
None.

◆ GenerateContent()

WString foxit::pdf::HeaderFooterContentGenerator::GenerateContent ( )

Generate a final string which can be used as header-footer content.

返回
The final string which can be used as header-footer content.

◆ IsEmpty()

bool foxit::pdf::HeaderFooterContentGenerator::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

返回
true means current object is empty, while false means not.

◆ operator!=()

bool foxit::pdf::HeaderFooterContentGenerator::operator!= ( const HeaderFooterContentGenerator &  other) const

Not equal operator.

参数
[in]otherAnother header-footer content generator object. This function will check if current object is not equal to this one.
返回
true means not equal, while false means equal.

◆ operator=()

HeaderFooterContentGenerator& foxit::pdf::HeaderFooterContentGenerator::operator= ( const HeaderFooterContentGenerator &  other)

Assign operator.

参数
[in]otherAnother header-footer content generator object, whose value would be assigned to current object.
返回
Reference to current object itself.

◆ operator==()

bool foxit::pdf::HeaderFooterContentGenerator::operator== ( const HeaderFooterContentGenerator &  other) const

Equal operator.

参数
[in]otherAnother header-footer content generator object. This function will check if current object is equal to this one.
返回
true means equal, while false means not equal.