xlnt
Public Types | Public Member Functions | List of all members
xlnt::header_footer Class Reference

Represents the header and footer of a sheet in a workbook. More...

#include <header_footer.hpp>

Public Types

enum  location { left, center, right }
 Enumerates the three possible locations of a header or footer. More...
 

Public Member Functions

bool has_header () const
 True if any text has been added for a header at any location on any page. More...
 
bool has_footer () const
 True if any text has been added for a footer at any location on any page. More...
 
bool align_with_margins () const
 True if headers and footers should align to the page margins. More...
 
header_footeralign_with_margins (bool align)
 Set to true if headers and footers should align to the page margins. Set to false if headers and footers should align to the edge of the page. More...
 
bool different_odd_even () const
 True if headers and footers differ based on page number. More...
 
bool different_first () const
 True if headers and footers are different on the first page. More...
 
bool scale_with_doc () const
 True if headers and footers should scale to match the worksheet. More...
 
header_footerscale_with_doc (bool scale)
 Set to true if headers and footers should scale to match the worksheet. More...
 
bool has_header (location where) const
 True if any text has been added at the given location on any page. More...
 
void clear_header ()
 Remove all headers from all pages. More...
 
void clear_header (location where)
 Remove header at the given location on any page. More...
 
header_footerheader (location where, const std::string &text)
 Add a header at the given location with the given text. More...
 
header_footerheader (location where, const rich_text &text)
 Add a header at the given location with the given text. More...
 
rich_text header (location where) const
 Get the text of the header at the given location. If headers are different on odd and even pages, the odd header will be returned. More...
 
bool has_first_page_header () const
 True if a header has been set for the first page at any location. More...
 
bool has_first_page_header (location where) const
 True if a header has been set for the first page at the given location. More...
 
void clear_first_page_header ()
 Remove all headers from the first page. More...
 
void clear_first_page_header (location where)
 Remove header from the first page at the given location. More...
 
header_footerfirst_page_header (location where, const rich_text &text)
 Add a header on the first page at the given location with the given text. More...
 
rich_text first_page_header (location where) const
 Get the text of the first page header at the given location. If no first page header has been set, the general header for that location will be returned. More...
 
bool has_odd_even_header () const
 True if different headers have been set for odd and even pages. More...
 
bool has_odd_even_header (location where) const
 True if different headers have been set for odd and even pages at the given location. More...
 
void clear_odd_even_header ()
 Remove odd/even headers at all locations. More...
 
void clear_odd_even_header (location where)
 Remove odd/even headers at the given location. More...
 
header_footerodd_even_header (location where, const rich_text &odd, const rich_text &even)
 Add a header for odd pages at the given location with the given text. More...
 
rich_text odd_header (location where) const
 Get the text of the odd page header at the given location. If no odd page header has been set, the general header for that location will be returned. More...
 
rich_text even_header (location where) const
 Get the text of the even page header at the given location. If no even page header has been set, the general header for that location will be returned. More...
 
bool has_footer (location where) const
 True if any text has been added at the given location on any page. More...
 
void clear_footer ()
 Remove all footers from all pages. More...
 
void clear_footer (location where)
 Remove footer at the given location on any page. More...
 
header_footerfooter (location where, const std::string &text)
 Add a footer at the given location with the given text. More...
 
header_footerfooter (location where, const rich_text &text)
 Add a footer at the given location with the given text. More...
 
rich_text footer (location where) const
 Get the text of the footer at the given location. If footers are different on odd and even pages, the odd footer will be returned. More...
 
bool has_first_page_footer () const
 True if a footer has been set for the first page at any location. More...
 
bool has_first_page_footer (location where) const
 True if a footer has been set for the first page at the given location. More...
 
void clear_first_page_footer ()
 Remove all footers from the first page. More...
 
void clear_first_page_footer (location where)
 Remove footer from the first page at the given location. More...
 
header_footerfirst_page_footer (location where, const rich_text &text)
 Add a footer on the first page at the given location with the given text. More...
 
rich_text first_page_footer (location where) const
 Get the text of the first page footer at the given location. If no first page footer has been set, the general footer for that location will be returned. More...
 
bool has_odd_even_footer () const
 True if different footers have been set for odd and even pages. More...
 
bool has_odd_even_footer (location where) const
 True if different footers have been set for odd and even pages at the given location. More...
 
void clear_odd_even_footer ()
 Remove odd/even footers at all locations. More...
 
void clear_odd_even_footer (location where)
 Remove odd/even footers at the given location. More...
 
header_footerodd_even_footer (location where, const rich_text &odd, const rich_text &even)
 Add a footer for odd pages at the given location with the given text. More...
 
rich_text odd_footer (location where) const
 Get the text of the odd page footer at the given location. If no odd page footer has been set, the general footer for that location will be returned. More...
 
rich_text even_footer (location where) const
 Get the text of the even page footer at the given location. If no even page footer has been set, the general footer for that location will be returned. More...
 
bool operator== (const header_footer &rhs) const
 

Detailed Description

Represents the header and footer of a sheet in a workbook.

Member Enumeration Documentation

◆ location

Enumerates the three possible locations of a header or footer.

Member Function Documentation

◆ align_with_margins() [1/2]

bool xlnt::header_footer::align_with_margins ( ) const

True if headers and footers should align to the page margins.

◆ align_with_margins() [2/2]

header_footer& xlnt::header_footer::align_with_margins ( bool  align)

Set to true if headers and footers should align to the page margins. Set to false if headers and footers should align to the edge of the page.

◆ clear_first_page_footer() [1/2]

void xlnt::header_footer::clear_first_page_footer ( )

Remove all footers from the first page.

◆ clear_first_page_footer() [2/2]

void xlnt::header_footer::clear_first_page_footer ( location  where)

Remove footer from the first page at the given location.

◆ clear_first_page_header() [1/2]

void xlnt::header_footer::clear_first_page_header ( )

Remove all headers from the first page.

◆ clear_first_page_header() [2/2]

void xlnt::header_footer::clear_first_page_header ( location  where)

Remove header from the first page at the given location.

◆ clear_footer() [1/2]

void xlnt::header_footer::clear_footer ( )

Remove all footers from all pages.

◆ clear_footer() [2/2]

void xlnt::header_footer::clear_footer ( location  where)

Remove footer at the given location on any page.

◆ clear_header() [1/2]

void xlnt::header_footer::clear_header ( )

Remove all headers from all pages.

◆ clear_header() [2/2]

void xlnt::header_footer::clear_header ( location  where)

Remove header at the given location on any page.

◆ clear_odd_even_footer() [1/2]

void xlnt::header_footer::clear_odd_even_footer ( )

Remove odd/even footers at all locations.

◆ clear_odd_even_footer() [2/2]

void xlnt::header_footer::clear_odd_even_footer ( location  where)

Remove odd/even footers at the given location.

◆ clear_odd_even_header() [1/2]

void xlnt::header_footer::clear_odd_even_header ( )

Remove odd/even headers at all locations.

◆ clear_odd_even_header() [2/2]

void xlnt::header_footer::clear_odd_even_header ( location  where)

Remove odd/even headers at the given location.

◆ different_first()

bool xlnt::header_footer::different_first ( ) const

True if headers and footers are different on the first page.

◆ different_odd_even()

bool xlnt::header_footer::different_odd_even ( ) const

True if headers and footers differ based on page number.

◆ even_footer()

rich_text xlnt::header_footer::even_footer ( location  where) const

Get the text of the even page footer at the given location. If no even page footer has been set, the general footer for that location will be returned.

◆ even_header()

rich_text xlnt::header_footer::even_header ( location  where) const

Get the text of the even page header at the given location. If no even page header has been set, the general header for that location will be returned.

◆ first_page_footer() [1/2]

header_footer& xlnt::header_footer::first_page_footer ( location  where,
const rich_text text 
)

Add a footer on the first page at the given location with the given text.

◆ first_page_footer() [2/2]

rich_text xlnt::header_footer::first_page_footer ( location  where) const

Get the text of the first page footer at the given location. If no first page footer has been set, the general footer for that location will be returned.

◆ first_page_header() [1/2]

header_footer& xlnt::header_footer::first_page_header ( location  where,
const rich_text text 
)

Add a header on the first page at the given location with the given text.

◆ first_page_header() [2/2]

rich_text xlnt::header_footer::first_page_header ( location  where) const

Get the text of the first page header at the given location. If no first page header has been set, the general header for that location will be returned.

◆ footer() [1/3]

header_footer& xlnt::header_footer::footer ( location  where,
const std::string &  text 
)

Add a footer at the given location with the given text.

◆ footer() [2/3]

header_footer& xlnt::header_footer::footer ( location  where,
const rich_text text 
)

Add a footer at the given location with the given text.

◆ footer() [3/3]

rich_text xlnt::header_footer::footer ( location  where) const

Get the text of the footer at the given location. If footers are different on odd and even pages, the odd footer will be returned.

◆ has_first_page_footer() [1/2]

bool xlnt::header_footer::has_first_page_footer ( ) const

True if a footer has been set for the first page at any location.

◆ has_first_page_footer() [2/2]

bool xlnt::header_footer::has_first_page_footer ( location  where) const

True if a footer has been set for the first page at the given location.

◆ has_first_page_header() [1/2]

bool xlnt::header_footer::has_first_page_header ( ) const

True if a header has been set for the first page at any location.

◆ has_first_page_header() [2/2]

bool xlnt::header_footer::has_first_page_header ( location  where) const

True if a header has been set for the first page at the given location.

◆ has_footer() [1/2]

bool xlnt::header_footer::has_footer ( ) const

True if any text has been added for a footer at any location on any page.

◆ has_footer() [2/2]

bool xlnt::header_footer::has_footer ( location  where) const

True if any text has been added at the given location on any page.

◆ has_header() [1/2]

bool xlnt::header_footer::has_header ( ) const

True if any text has been added for a header at any location on any page.

◆ has_header() [2/2]

bool xlnt::header_footer::has_header ( location  where) const

True if any text has been added at the given location on any page.

◆ has_odd_even_footer() [1/2]

bool xlnt::header_footer::has_odd_even_footer ( ) const

True if different footers have been set for odd and even pages.

◆ has_odd_even_footer() [2/2]

bool xlnt::header_footer::has_odd_even_footer ( location  where) const

True if different footers have been set for odd and even pages at the given location.

◆ has_odd_even_header() [1/2]

bool xlnt::header_footer::has_odd_even_header ( ) const

True if different headers have been set for odd and even pages.

◆ has_odd_even_header() [2/2]

bool xlnt::header_footer::has_odd_even_header ( location  where) const

True if different headers have been set for odd and even pages at the given location.

◆ header() [1/3]

header_footer& xlnt::header_footer::header ( location  where,
const std::string &  text 
)

Add a header at the given location with the given text.

◆ header() [2/3]

header_footer& xlnt::header_footer::header ( location  where,
const rich_text text 
)

Add a header at the given location with the given text.

◆ header() [3/3]

rich_text xlnt::header_footer::header ( location  where) const

Get the text of the header at the given location. If headers are different on odd and even pages, the odd header will be returned.

◆ odd_even_footer()

header_footer& xlnt::header_footer::odd_even_footer ( location  where,
const rich_text odd,
const rich_text even 
)

Add a footer for odd pages at the given location with the given text.

◆ odd_even_header()

header_footer& xlnt::header_footer::odd_even_header ( location  where,
const rich_text odd,
const rich_text even 
)

Add a header for odd pages at the given location with the given text.

◆ odd_footer()

rich_text xlnt::header_footer::odd_footer ( location  where) const

Get the text of the odd page footer at the given location. If no odd page footer has been set, the general footer for that location will be returned.

◆ odd_header()

rich_text xlnt::header_footer::odd_header ( location  where) const

Get the text of the odd page header at the given location. If no odd page header has been set, the general header for that location will be returned.

◆ scale_with_doc() [1/2]

bool xlnt::header_footer::scale_with_doc ( ) const

True if headers and footers should scale to match the worksheet.

◆ scale_with_doc() [2/2]

header_footer& xlnt::header_footer::scale_with_doc ( bool  scale)

Set to true if headers and footers should scale to match the worksheet.


The documentation for this class was generated from the following file: