Version: 3.1.0
wxRichTextPrintout Class Reference

#include <wx/richtext/richtextprint.h>

+ Inheritance diagram for wxRichTextPrintout:

Detailed Description

This class implements print layout for wxRichTextBuffer.

Instead of using it directly, you should normally use the wxRichTextPrinting class.

Library:  wxRichText
Category:  Rich Text

Public Member Functions

 wxRichTextPrintout (const wxString &title="Printout")
 Constructor.
 
void CalculateScaling (wxDC *dc, wxRect &textRect, wxRect &headerRect, wxRect &footerRect)
 Calculates scaling and text, header and footer rectangles.
 
const wxRichTextHeaderFooterDataGetHeaderFooterData () const
 Returns the header and footer data associated with the printout.
 
virtual void GetPageInfo (int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
 Gets the page information.
 
wxRichTextBufferGetRichTextBuffer () const
 Returns a pointer to the buffer being rendered.
 
virtual bool HasPage (int page)
 Returns true if the given page exists in the printout.
 
virtual void OnPreparePrinting ()
 Prepares for printing, laying out the buffer and calculating pagination.
 
virtual bool OnPrintPage (int page)
 Does the actual printing for this page.
 
void SetHeaderFooterData (const wxRichTextHeaderFooterData &data)
 Sets the header and footer data associated with the printout.
 
void SetMargins (int top=254, int bottom=254, int left=254, int right=254)
 Sets margins in 10ths of millimetre.
 
void SetRichTextBuffer (wxRichTextBuffer *buffer)
 Sets the buffer to print.
 
- Public Member Functions inherited from wxPrintout
 wxPrintout (const wxString &title="Printout")
 Constructor.
 
virtual ~wxPrintout ()
 Destructor.
 
void FitThisSizeToPage (const wxSize &imageSize)
 Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page rectangle and the origin is at the top left corner of the page rectangle.
 
void FitThisSizeToPageMargins (const wxSize &imageSize, const wxPageSetupDialogData &pageSetupData)
 Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page margins set in the given wxPageSetupDialogData object.
 
void FitThisSizeToPaper (const wxSize &imageSize)
 Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the paper and the origin is at the top left corner of the paper.
 
wxDCGetDC () const
 Returns the device context associated with the printout (given to the printout at start of printing or previewing).
 
wxRect GetLogicalPageMarginsRect (const wxPageSetupDialogData &pageSetupData) const
 Return the rectangle corresponding to the page margins specified by the given wxPageSetupDialogData object in the associated wxDC's logical coordinates for the current user scale and device origin.
 
wxRect GetLogicalPageRect () const
 Return the rectangle corresponding to the page in the associated wxDC 's logical coordinates for the current user scale and device origin.
 
wxRect GetLogicalPaperRect () const
 Return the rectangle corresponding to the paper in the associated wxDC 's logical coordinates for the current user scale and device origin.
 
void GetPPIPrinter (int *w, int *h) const
 Returns the number of pixels per logical inch of the printer device context.
 
void GetPPIScreen (int *w, int *h) const
 Returns the number of pixels per logical inch of the screen device context.
 
void GetPageSizeMM (int *w, int *h) const
 Returns the size of the printer page in millimetres.
 
void GetPageSizePixels (int *w, int *h) const
 Returns the size of the printer page in pixels, called the page rectangle.
 
wxRect GetPaperRectPixels () const
 Returns the rectangle that corresponds to the entire paper in pixels, called the paper rectangle.
 
virtual wxString GetTitle () const
 Returns the title of the printout.
 
virtual bool IsPreview () const
 Returns true if the printout is currently being used for previewing.
 
wxPrintPreviewGetPreview () const
 Returns the associated preview object if any.
 
void MapScreenSizeToDevice ()
 Set the user scale and device origin of the wxDC associated with this wxPrintout so that one screen pixel maps to one device pixel on the DC.
 
void MapScreenSizeToPage ()
 This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPaper() but sets the logical origin to the top left corner of the page rectangle.
 
void MapScreenSizeToPageMargins (const wxPageSetupDialogData &pageSetupData)
 This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPageMargins() but sets the logical origin to the top left corner of the page margins specified by the given wxPageSetupDialogData object.
 
void MapScreenSizeToPaper ()
 Set the user scale and device origin of the wxDC associated with this wxPrintout so that the printed page matches the screen size as closely as possible and the logical origin is in the top left corner of the paper rectangle.
 
void OffsetLogicalOrigin (wxCoord xoff, wxCoord yoff)
 Shift the device origin by an amount specified in logical coordinates.
 
virtual bool OnBeginDocument (int startPage, int endPage)
 Called by the framework at the start of document printing.
 
virtual void OnBeginPrinting ()
 Called by the framework at the start of printing.
 
virtual void OnEndDocument ()
 Called by the framework at the end of document printing.
 
virtual void OnEndPrinting ()
 Called by the framework at the end of printing.
 
void SetLogicalOrigin (wxCoord x, wxCoord y)
 Set the device origin of the associated wxDC so that the current logical point becomes the new logical origin.
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data.
 
 wxObject (const wxObject &other)
 Copy ctor.
 
virtual ~wxObject ()
 Destructor.
 
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).
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class.
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj.
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone.
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer.
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data.
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public.
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
 
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.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

wxRichTextPrintout::wxRichTextPrintout ( const wxString title = "Printout")

Constructor.

Member Function Documentation

void wxRichTextPrintout::CalculateScaling ( wxDC dc,
wxRect textRect,
wxRect headerRect,
wxRect footerRect 
)

Calculates scaling and text, header and footer rectangles.

const wxRichTextHeaderFooterData& wxRichTextPrintout::GetHeaderFooterData ( ) const

Returns the header and footer data associated with the printout.

virtual void wxRichTextPrintout::GetPageInfo ( int *  minPage,
int *  maxPage,
int *  selPageFrom,
int *  selPageTo 
)
virtual

Gets the page information.

Reimplemented from wxPrintout.

wxRichTextBuffer* wxRichTextPrintout::GetRichTextBuffer ( ) const

Returns a pointer to the buffer being rendered.

virtual bool wxRichTextPrintout::HasPage ( int  page)
virtual

Returns true if the given page exists in the printout.

Reimplemented from wxPrintout.

virtual void wxRichTextPrintout::OnPreparePrinting ( )
virtual

Prepares for printing, laying out the buffer and calculating pagination.

Reimplemented from wxPrintout.

virtual bool wxRichTextPrintout::OnPrintPage ( int  page)
virtual

Does the actual printing for this page.

Implements wxPrintout.

void wxRichTextPrintout::SetHeaderFooterData ( const wxRichTextHeaderFooterData data)

Sets the header and footer data associated with the printout.

void wxRichTextPrintout::SetMargins ( int  top = 254,
int  bottom = 254,
int  left = 254,
int  right = 254 
)

Sets margins in 10ths of millimetre.

Defaults to 1 inch for margins.

void wxRichTextPrintout::SetRichTextBuffer ( wxRichTextBuffer buffer)

Sets the buffer to print.

wxRichTextPrintout does not manage this pointer; it should be managed by the calling code, such as wxRichTextPrinting.