Version: 2.9.4
Public Member Functions
wxHtmlEasyPrinting Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/html/htmprint.h>

Inheritance diagram for wxHtmlEasyPrinting:

Detailed Description

This class provides very simple interface to printing architecture.

It allows you to print HTML documents using only a few commands.

注:
Do not create this class on the stack only. You should create an instance on app startup and use this instance for all printing operations. The reason is that this class stores various settings in it.

Library:  wxHTML
Category:  HTML, Printing Framework

Public Member Functions

 wxHtmlEasyPrinting (const wxString &name="Printing", wxWindow *parentWindow=NULL)
 Constructor.
const wxStringGetName () const
 Returns the current name being used for preview frames and setup dialogs.
wxPageSetupDialogDataGetPageSetupData ()
 Returns a pointer to wxPageSetupDialogData instance used by this class.
wxWindowGetParentWindow () const
 Gets the parent window for dialogs.
wxPrintDataGetPrintData ()
 Returns pointer to wxPrintData instance used by this class.
void PageSetup ()
 Display page setup dialog and allows the user to modify settings.
bool PreviewFile (const wxString &htmlfile)
 Preview HTML file.
bool PreviewText (const wxString &htmltext, const wxString &basepath=wxEmptyString)
 Preview HTML text (not file!).
bool PrintFile (const wxString &htmlfile)
 Print HTML file.
bool PrintText (const wxString &htmltext, const wxString &basepath=wxEmptyString)
 Print HTML text (not file!).
void SetFonts (const wxString &normal_face, const wxString &fixed_face, const int *sizes=NULL)
 Sets fonts.
void SetName (const wxString &name)
 Sets the name used for preview frames and setup dialogs.
void SetStandardFonts (int size=-1, const wxString &normal_face=wxEmptyString, const wxString &fixed_face=wxEmptyString)
 Sets default font sizes and/or default font size.
void SetFooter (const wxString &footer, int pg=wxPAGE_ALL)
 Set page footer.
void SetHeader (const wxString &header, int pg=wxPAGE_ALL)
 Set page header.
void SetParentWindow (wxWindow *window)
 Sets the parent window for dialogs.

List of all members.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
nameName of the printing object. Used by preview frames and setup dialogs.
parentWindowpointer to the window that will own the preview frame and setup dialogs. May be NULL.

Member Function Documentation

const wxString& wxHtmlEasyPrinting::GetName ( ) const

Returns the current name being used for preview frames and setup dialogs.

Since:
2.8.11 / 2.9.1
wxPageSetupDialogData* wxHtmlEasyPrinting::GetPageSetupData ( )

Returns a pointer to wxPageSetupDialogData instance used by this class.

You can set its parameters (via SetXXXX methods).

wxWindow* wxHtmlEasyPrinting::GetParentWindow ( ) const

Gets the parent window for dialogs.

wxPrintData* wxHtmlEasyPrinting::GetPrintData ( )

Returns pointer to wxPrintData instance used by this class.

You can set its parameters (via SetXXXX methods).

void wxHtmlEasyPrinting::PageSetup ( )

Display page setup dialog and allows the user to modify settings.

bool wxHtmlEasyPrinting::PreviewFile ( const wxString htmlfile)

Preview HTML file.

Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.

bool wxHtmlEasyPrinting::PreviewText ( const wxString htmltext,
const wxString basepath = wxEmptyString 
)

Preview HTML text (not file!).

Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.

Parameters:
htmltextHTML text.
basepathbase directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
bool wxHtmlEasyPrinting::PrintFile ( const wxString htmlfile)

Print HTML file.

Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.

bool wxHtmlEasyPrinting::PrintText ( const wxString htmltext,
const wxString basepath = wxEmptyString 
)

Print HTML text (not file!).

Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.

Parameters:
htmltextHTML text.
basepathbase directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
void wxHtmlEasyPrinting::SetFonts ( const wxString normal_face,
const wxString fixed_face,
const int *  sizes = NULL 
)

Sets fonts.

See wxHtmlDCRenderer::SetFonts for detailed description.

void wxHtmlEasyPrinting::SetFooter ( const wxString footer,
int  pg = wxPAGE_ALL 
)

Set page footer.

The following macros can be used inside it: @DATE@ is replaced by the current date in default format @PAGENUM@ is replaced by page number @PAGESCNT@ is replaced by total number of pages @TIME@ is replaced by the current time in default format @TITLE@ is replaced with the title of the document

Parameters:
footerHTML text to be used as footer.
pgone of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
void wxHtmlEasyPrinting::SetHeader ( const wxString header,
int  pg = wxPAGE_ALL 
)

Set page header.

The following macros can be used inside it:

  • @DATE@ is replaced by the current date in default format
  • @PAGENUM@ is replaced by page number
  • @PAGESCNT@ is replaced by total number of pages
  • @TIME@ is replaced by the current time in default format
  • @TITLE@ is replaced with the title of the document
Parameters:
headerHTML text to be used as header.
pgone of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.
void wxHtmlEasyPrinting::SetName ( const wxString name)

Sets the name used for preview frames and setup dialogs.

Since:
2.8.11 / 2.9.1
void wxHtmlEasyPrinting::SetParentWindow ( wxWindow window)

Sets the parent window for dialogs.

void wxHtmlEasyPrinting::SetStandardFonts ( int  size = -1,
const wxString normal_face = wxEmptyString,
const wxString fixed_face = wxEmptyString 
)

Sets default font sizes and/or default font size.

See wxHtmlDCRenderer::SetStandardFonts for detailed description.

参照:
SetFonts()
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines