Version: 3.2.7
wxRichTextHeaderFooterData Class Reference

#include <wx/richtext/richtextprint.h>

+ Inheritance diagram for wxRichTextHeaderFooterData:

Detailed Description

This class represents header and footer data to be passed to the wxRichTextPrinting and wxRichTextPrintout classes.

Headers and footers can be specified independently for odd, even or both page sides. Different text can be specified for left, centre and right locations on the page, and the font and text colour can also be specified.

You can specify the following keywords in header and footer text, which will be substituted for the actual values during printing and preview.

  • @DATE@: the current date.
  • @PAGESCNT@: the total number of pages.
  • @PAGENUM@: the current page number.
  • @TIME@: the current time.
  • @TITLE@: the title of the document, as passed to the wxRichTextPrinting or wxRichTextLayout constructor.

Library:  wxRichText
Category:  Rich Text

Public Member Functions

 wxRichTextHeaderFooterData ()
 Constructors. More...
 
 wxRichTextHeaderFooterData (const wxRichTextHeaderFooterData &data)
 
void Clear ()
 Clears all text. More...
 
void Copy (const wxRichTextHeaderFooterData &data)
 Copies the data. More...
 
const wxFontGetFont () const
 Returns the font specified for printing the header and footer. More...
 
int GetFooterMargin () const
 Returns the margin between the text and the footer. More...
 
wxString GetFooterText (wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE) const
 Returns the footer text on odd or even pages, and at a given position on the page (left, centre or right). More...
 
int GetHeaderMargin () const
 Returns the margin between the text and the header. More...
 
wxString GetHeaderText (wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE) const
 Returns the header text on odd or even pages, and at a given position on the page (left, centre or right). More...
 
bool GetShowOnFirstPage () const
 Returns true if the header and footer will be shown on the first page. More...
 
wxString GetText (int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) const
 Helper function for getting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right). More...
 
const wxColourGetTextColour () const
 Returns the text colour for drawing the header and footer. More...
 
void Init ()
 Initialises the object. More...
 
void SetFont (const wxFont &font)
 Sets the font for drawing the header and footer. More...
 
void SetFooterText (const wxString &text, wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE)
 Sets the footer text on odd or even pages, and at a given position on the page (left, centre or right). More...
 
void SetHeaderText (const wxString &text, wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE)
 Sets the header text on odd or even pages, and at a given position on the page (left, centre or right). More...
 
void SetMargins (int headerMargin, int footerMargin)
 Sets the margins between text and header or footer, in tenths of a millimeter. More...
 
void SetShowOnFirstPage (bool showOnFirstPage)
 Pass true to show the header or footer on first page (the default). More...
 
void SetText (const wxString &text, int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location)
 Helper function for setting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right). More...
 
void SetTextColour (const wxColour &col)
 Sets the text colour for drawing the header and footer. More...
 
void operator= (const wxRichTextHeaderFooterData &data)
 Assignment operator. More...
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data. More...
 
 wxObject (const wxObject &other)
 Copy ctor. More...
 
virtual ~wxObject ()
 Destructor. More...
 
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class. More...
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj. More...
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone. More...
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer. More...
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public. More...
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined. More...
 
void * operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined. More...
 

Additional Inherited Members

- Protected Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object. More...
 
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
 
virtual wxObjectRefDataCloneRefData (const wxObjectRefData *data) const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
 
- Protected Attributes inherited from wxObject
wxObjectRefDatam_refData
 Pointer to an object which is the object's reference-counted data. More...
 

Constructor & Destructor Documentation

◆ wxRichTextHeaderFooterData() [1/2]

wxRichTextHeaderFooterData::wxRichTextHeaderFooterData ( )

Constructors.

◆ wxRichTextHeaderFooterData() [2/2]

wxRichTextHeaderFooterData::wxRichTextHeaderFooterData ( const wxRichTextHeaderFooterData data)

Member Function Documentation

◆ Clear()

void wxRichTextHeaderFooterData::Clear ( )

Clears all text.

◆ Copy()

void wxRichTextHeaderFooterData::Copy ( const wxRichTextHeaderFooterData data)

Copies the data.

◆ GetFont()

const wxFont& wxRichTextHeaderFooterData::GetFont ( ) const

Returns the font specified for printing the header and footer.

◆ GetFooterMargin()

int wxRichTextHeaderFooterData::GetFooterMargin ( ) const

Returns the margin between the text and the footer.

◆ GetFooterText()

wxString wxRichTextHeaderFooterData::GetFooterText ( wxRichTextOddEvenPage  page = wxRICHTEXT_PAGE_EVEN,
wxRichTextPageLocation  location = wxRICHTEXT_PAGE_CENTRE 
) const

Returns the footer text on odd or even pages, and at a given position on the page (left, centre or right).

◆ GetHeaderMargin()

int wxRichTextHeaderFooterData::GetHeaderMargin ( ) const

Returns the margin between the text and the header.

◆ GetHeaderText()

wxString wxRichTextHeaderFooterData::GetHeaderText ( wxRichTextOddEvenPage  page = wxRICHTEXT_PAGE_EVEN,
wxRichTextPageLocation  location = wxRICHTEXT_PAGE_CENTRE 
) const

Returns the header text on odd or even pages, and at a given position on the page (left, centre or right).

◆ GetShowOnFirstPage()

bool wxRichTextHeaderFooterData::GetShowOnFirstPage ( ) const

Returns true if the header and footer will be shown on the first page.

◆ GetText()

wxString wxRichTextHeaderFooterData::GetText ( int  headerFooter,
wxRichTextOddEvenPage  page,
wxRichTextPageLocation  location 
) const

Helper function for getting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right).

◆ GetTextColour()

const wxColour& wxRichTextHeaderFooterData::GetTextColour ( ) const

Returns the text colour for drawing the header and footer.

◆ Init()

void wxRichTextHeaderFooterData::Init ( )

Initialises the object.

◆ operator=()

void wxRichTextHeaderFooterData::operator= ( const wxRichTextHeaderFooterData data)

Assignment operator.

◆ SetFont()

void wxRichTextHeaderFooterData::SetFont ( const wxFont font)

Sets the font for drawing the header and footer.

◆ SetFooterText()

void wxRichTextHeaderFooterData::SetFooterText ( const wxString text,
wxRichTextOddEvenPage  page = wxRICHTEXT_PAGE_ALL,
wxRichTextPageLocation  location = wxRICHTEXT_PAGE_CENTRE 
)

Sets the footer text on odd or even pages, and at a given position on the page (left, centre or right).

◆ SetHeaderText()

void wxRichTextHeaderFooterData::SetHeaderText ( const wxString text,
wxRichTextOddEvenPage  page = wxRICHTEXT_PAGE_ALL,
wxRichTextPageLocation  location = wxRICHTEXT_PAGE_CENTRE 
)

Sets the header text on odd or even pages, and at a given position on the page (left, centre or right).

◆ SetMargins()

void wxRichTextHeaderFooterData::SetMargins ( int  headerMargin,
int  footerMargin 
)

Sets the margins between text and header or footer, in tenths of a millimeter.

◆ SetShowOnFirstPage()

void wxRichTextHeaderFooterData::SetShowOnFirstPage ( bool  showOnFirstPage)

Pass true to show the header or footer on first page (the default).

◆ SetText()

void wxRichTextHeaderFooterData::SetText ( const wxString text,
int  headerFooter,
wxRichTextOddEvenPage  page,
wxRichTextPageLocation  location 
)

Helper function for setting the header or footer text, odd or even pages, and at a given position on the page (left, centre or right).

◆ SetTextColour()

void wxRichTextHeaderFooterData::SetTextColour ( const wxColour col)

Sets the text colour for drawing the header and footer.