Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::HeaderFooterContentGenerator Class Reference
Inheritance diagram for foxit::pdf::HeaderFooterContentGenerator:

## Public Types
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 }
| Enumeration for date format type. More...
enum | PageNumberFormat { e_PageNumberFormatDefault = 0, e_PageNumberFormatNumberOfCount = 1, e_PageNumberFormatNumberSlashCount = 2, e_PageNumberFormatPageNumber = 3, e_PageNumberFormatPageNumberOfCount = 4 }
| Enumeration for page number format type. More...

## Public Member Functions
| HeaderFooterContentGenerator ()
| Constructor.
| HeaderFooterContentGenerator (const HeaderFooterContentGenerator &other)
| Constructor, with another header-footer content generator object. More...
| ~HeaderFooterContentGenerator ()
| Destructor.
void | AddDate (DateFormatType format_type)
| Add a format string for a specified date format type. More...
void | AddPageNumber (PageNumberFormat format_type)
| Add a format string for a specified page number format type. More...
void | AddString (const WString &new_string)
| Add a string. More...
void | Clear ()
| Clear strings (including format strings) which have been added to current content generator. More...
WString | GenerateContent ()
| Generate a final string which can be used as header-footer content. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const HeaderFooterContentGenerator &other) const
| Not equal operator. More...
HeaderFooterContentGenerator & | operator= (const HeaderFooterContentGenerator &other)
| Assign operator. More...
bool | operator== (const HeaderFooterContentGenerator &other) const
| Equal operator. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

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.

## Member Enumeration Documentation

## ◆ DateFormatType

enum foxit::pdf::HeaderFooterContentGenerator::DateFormatType

Enumeration for date format type.

Values of this enumeration can be used alone.

Enumerator
e_DateFormatMSlashD | If this is used, "m/d" would be used as the date format string.
e_DateFormatMSlashDSlashYY | If this is used, "m/d/yy" would be used as the date format string.
e_DateFormatMSlashDSlashYYYY | If this is used, "m/d/yyyy" would be used as the date format string.
e_DateFormatMMSlashDDSlashYY | If this is used, "mm/dd/yy" would be used as the date format string.
e_DateFormatMMSlashDDSlashYYYY | If this is used, "mm/dd/yyyy" would be used as the date format string.
e_DateFormatDSlashMSlashYY | If this is used, "d/m/yy" would be used as the date format string.
e_DateFormatDSlashMSlashYYYY | If this is used, "d/m/yyyy" would be used as the date format string.
e_DateFormatDDSlashMMSlashYY | If this is used, "dd/mm/yy" would be used as the date format string.
e_DateFormatDDSlashMMSlashYYYY | If this is used, "dd/mm/yyyy" would be used as the date format string.
e_DateFormatMMSlashYY | If this is used, "mm/yy" would be used as the date format string.
e_DateFormatMMSlashYYYY | If this is used, "mm/yyyy" would be used as the date format string.
e_DateFormatMDotDDotYY | If this is used, "m.d.yy" would be used as the date format string.
e_DateFormatMDotDDotYYYY | If this is used, "m.d.yyyy" would be used as the date format string.
e_DateFormatMMDotDDDotYY | If this is used, "mm.dd.yy" would be used as the date format string.
e_DateFormatMMDotDDDotYYYY | If this is used, "mm.dd.yyyy" would be used as the date format string.
e_DateFormatMMDotYY | If this is used, "mm.yy" would be used as the date format string.
e_DateFormatDDotMDotYYYY | If this is used, "d.m.yyyy" would be used as the date format string.
e_DateFormatDDDotMMDotYY | If this is used, "dd.mm.yy" would be used as the date format string.
e_DateFormatDDDotMMDotYYYY | If this is used, "dd.mm.yyyy" would be used as the date format string.
e_DateFormatYYHyphenMMHyphenDD | If this is used, "yy-mm-dd" would be used as the date format string.
e_DateFormatYYYYHyphenMMHyphenDD | If this is used, "yyyy-mm-dd" would be used as the date format string.

## ◆ PageNumberFormat

enum foxit::pdf::HeaderFooterContentGenerator::PageNumberFormat

Enumeration for page number format type.

Values of this enumeration can be used alone.

Enumerator
e_PageNumberFormatDefault | If this is used, "1" would be used as the page number format string.
e_PageNumberFormatNumberOfCount | If this is used, "1 of n" would be used as the page number format string.
e_PageNumberFormatNumberSlashCount | If this is used, "1/n" would be used as the page number format string.
e_PageNumberFormatPageNumber | If this is used, "Page 1" would be used as the page number format string.
e_PageNumberFormatPageNumberOfCount | If this is used, "Page 1 of n" would be used as the page number format string.

## Constructor & Destructor Documentation

## ◆ HeaderFooterContentGenerator()

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

Constructor, with another header-footer content generator object.

Parameters

  [in] | other | Another header-footer content generator object.

## Member Function Documentation

## ◆ 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.

Parameters

  [in] | format_type | Date format type. Please refer to values starting from HeaderFooterContentGenerator::e_DateFormatMSlashD and this should be one of these values.

Returns
  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.

Parameters

  [in] | format_type | Page number format type. Please refer to values starting from HeaderFooterContentGenerator::e_PageNumberFormatDefault and this should be one of these values.

Returns
  None.

## ◆ AddString()

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

Add a string.

Parameters

  [in] | new_string | A string.

Returns
  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.

Returns
  None.

## ◆ GenerateContent()

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

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

Returns
  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.

Returns
  true means current object is empty, while false means not.

## ◆ operator!=()

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

Not equal operator.

Parameters

  [in] | other | Another header-footer content generator object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

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

Assign operator.

Parameters

  [in] | other | Another header-footer content generator object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

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

Equal operator.

Parameters

  [in] | other | Another header-footer content generator object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.