Version: 3.2.5
wxRichTextPrinting Class Reference

#include <wx/richtext/richtextprint.h>

+ Inheritance diagram for wxRichTextPrinting:

Detailed Description

This class provides a simple interface for performing wxRichTextBuffer printing and previewing.

It uses wxRichTextPrintout for layout and rendering.

Library:  wxRichText
Category:  Rich Text

Public Member Functions

 wxRichTextPrinting (const wxString &name="Printing", wxWindow *parentWindow=NULL)
 Constructor. More...
 
wxString GetFooterText (wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE) const
 A convenience function to get the footer text. More...
 
const wxRichTextHeaderFooterDataGetHeaderFooterData () const
 Returns the internal wxRichTextHeaderFooterData object. More...
 
wxString GetHeaderText (wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE) const
 A convenience function to get the header text. More...
 
wxPageSetupDialogDataGetPageSetupData ()
 Returns a pointer to the internal page setup data. More...
 
wxWindowGetParentWindow () const
 Returns the parent window to be used for the preview window and printing wait dialog. More...
 
const wxRectGetPreviewRect () const
 Returns the dimensions to be used for the preview window. More...
 
wxPrintDataGetPrintData ()
 Returns a pointer to the internal print data. More...
 
const wxStringGetTitle () const
 Returns the title of the preview window or printing wait caption. More...
 
void PageSetup ()
 Shows the page setup dialog. More...
 
bool PreviewBuffer (const wxRichTextBuffer &buffer)
 Shows a preview window for the given buffer. More...
 
bool PreviewFile (const wxString &richTextFile)
 Shows a preview window for the given file. More...
 
bool PrintBuffer (const wxRichTextBuffer &buffer, bool showPrintDialog=true)
 Prints the given buffer. More...
 
bool PrintFile (const wxString &richTextFile, bool showPrintDialog=true)
 Prints the given file. More...
 
void SetFooterText (const wxString &text, wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE)
 A convenience function to set the footer text. More...
 
void SetHeaderFooterData (const wxRichTextHeaderFooterData &data)
 Sets the internal wxRichTextHeaderFooterData object. More...
 
void SetHeaderFooterFont (const wxFont &font)
 Sets the wxRichTextHeaderFooterData font. More...
 
void SetHeaderFooterTextColour (const wxColour &colour)
 Sets the wxRichTextHeaderFooterData text colour. More...
 
void SetHeaderText (const wxString &text, wxRichTextOddEvenPage page=wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location=wxRICHTEXT_PAGE_CENTRE)
 A convenience function to set the header text. More...
 
void SetPageSetupData (const wxPageSetupDialogData &pageSetupData)
 Sets the page setup data. More...
 
void SetParentWindow (wxWindow *parent)
 Sets the parent window to be used for the preview window and printing wait dialog. More...
 
void SetPreviewRect (const wxRect &rect)
 Sets the dimensions to be used for the preview window. More...
 
void SetPrintData (const wxPrintData &printData)
 Sets the print data. More...
 
void SetShowOnFirstPage (bool show)
 Pass true to show the header and footer on the first page. More...
 
void SetTitle (const wxString &title)
 Pass the title of the preview window or printing wait caption. 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

◆ wxRichTextPrinting()

wxRichTextPrinting::wxRichTextPrinting ( const wxString name = "Printing",
wxWindow parentWindow = NULL 
)

Constructor.

Optionally pass a title to be used in the preview frame and printing wait dialog, and also a parent window for these windows.

Member Function Documentation

◆ GetFooterText()

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

A convenience function to get the footer text.

See wxRichTextHeaderFooterData for details.

◆ GetHeaderFooterData()

const wxRichTextHeaderFooterData& wxRichTextPrinting::GetHeaderFooterData ( ) const

Returns the internal wxRichTextHeaderFooterData object.

◆ GetHeaderText()

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

A convenience function to get the header text.

See wxRichTextHeaderFooterData for details.

◆ GetPageSetupData()

wxPageSetupDialogData* wxRichTextPrinting::GetPageSetupData ( )

Returns a pointer to the internal page setup data.

◆ GetParentWindow()

wxWindow* wxRichTextPrinting::GetParentWindow ( ) const

Returns the parent window to be used for the preview window and printing wait dialog.

◆ GetPreviewRect()

const wxRect& wxRichTextPrinting::GetPreviewRect ( ) const

Returns the dimensions to be used for the preview window.

◆ GetPrintData()

wxPrintData* wxRichTextPrinting::GetPrintData ( )

Returns a pointer to the internal print data.

◆ GetTitle()

const wxString& wxRichTextPrinting::GetTitle ( ) const

Returns the title of the preview window or printing wait caption.

◆ PageSetup()

void wxRichTextPrinting::PageSetup ( )

Shows the page setup dialog.

◆ PreviewBuffer()

bool wxRichTextPrinting::PreviewBuffer ( const wxRichTextBuffer buffer)

Shows a preview window for the given buffer.

The function takes its own copy of buffer.

◆ PreviewFile()

bool wxRichTextPrinting::PreviewFile ( const wxString richTextFile)

Shows a preview window for the given file.

richTextFile can be a text file or XML file, or other file depending on the available file handlers.

◆ PrintBuffer()

bool wxRichTextPrinting::PrintBuffer ( const wxRichTextBuffer buffer,
bool  showPrintDialog = true 
)

Prints the given buffer.

The function takes its own copy of buffer. showPrintDialog can be true to show the print dialog, or false to print quietly.

◆ PrintFile()

bool wxRichTextPrinting::PrintFile ( const wxString richTextFile,
bool  showPrintDialog = true 
)

Prints the given file.

richTextFile can be a text file or XML file, or other file depending on the available file handlers. showPrintDialog can be true to show the print dialog, or false to print quietly.

◆ SetFooterText()

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

A convenience function to set the footer text.

See wxRichTextHeaderFooterData for details.

◆ SetHeaderFooterData()

void wxRichTextPrinting::SetHeaderFooterData ( const wxRichTextHeaderFooterData data)

Sets the internal wxRichTextHeaderFooterData object.

◆ SetHeaderFooterFont()

void wxRichTextPrinting::SetHeaderFooterFont ( const wxFont font)

◆ SetHeaderFooterTextColour()

void wxRichTextPrinting::SetHeaderFooterTextColour ( const wxColour colour)

Sets the wxRichTextHeaderFooterData text colour.

◆ SetHeaderText()

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

A convenience function to set the header text.

See wxRichTextHeaderFooterData for details.

◆ SetPageSetupData()

void wxRichTextPrinting::SetPageSetupData ( const wxPageSetupDialogData pageSetupData)

Sets the page setup data.

◆ SetParentWindow()

void wxRichTextPrinting::SetParentWindow ( wxWindow parent)

Sets the parent window to be used for the preview window and printing wait dialog.

◆ SetPreviewRect()

void wxRichTextPrinting::SetPreviewRect ( const wxRect rect)

Sets the dimensions to be used for the preview window.

◆ SetPrintData()

void wxRichTextPrinting::SetPrintData ( const wxPrintData printData)

Sets the print data.

◆ SetShowOnFirstPage()

void wxRichTextPrinting::SetShowOnFirstPage ( bool  show)

Pass true to show the header and footer on the first page.

◆ SetTitle()

void wxRichTextPrinting::SetTitle ( const wxString title)

Pass the title of the preview window or printing wait caption.