class PPrintCanvas: public PCanvas

A canvas that will go to a printer.

Inheritance:


Public Fields

[more]PString jobName
Arbitrary name to identify to print job on some platforms, eg an identifier in the print queue for MS-Windows

Public Methods

[more] PPrintCanvas ( const PString & job )
Create a canvas that will go to the default printer device using its default printer setup.
[more] PPrintCanvas ( const PString & job, const PString & printer, const PString & device )
Create a canvas that will go to the specified printer device using its default printer setup.
[more] PPrintCanvas ( const PString & job, const PPrintInfo & info )
Create a canvas that will go to the specified printer device using the specified printer setup.
[more]virtual ~PPrintCanvas ()
Destroy the printer canvas, freing all resource used.
[more]BOOL NewPage ()
Begin output to a new page.
[more]void SetDrawingBounds ( const PRect & bounds )
Set the drawable area of the printer page.
[more]const PPrintInfo& GetPrintInfo () const
Get the current printer setup information for the print canvas.
[more]void ChangePrintInfo ( const PPrintInfo & info )
This allows the print parameters to be changed in mid job.

Public

[more] New functions for class

Protected Fields

[more]PPrintInfo printInfo
Printer specification describing all optional information on the selected printer.

Protected

[more] Member fields


Inherited from PCanvas:

Public Classes

oenum DrawStringOptions

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
ovirtual PCanvasState& operator=( const PCanvasState & state )
oconst PRealFont& GetFont() const
ovirtual PFontFamilyList GetAvailableFonts() const
ovirtual void Save()
ovirtual void Restore()
ovirtual void SetCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( const PPoint & pos )
ovirtual PPoint GetCurrentPosition() const
ovirtual void DrawLine( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( const PPoint & pt )
ovirtual void DrawLineRelative( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( PORDINATE x1, PORDINATE y1, PORDINATE x2, PORDINATE y2 )
ovoid DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovoid FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void DrawFocusRect( const PRect & rect )
ovirtual void DrawBevelledRect( const PRect & rect, BOOL raised, BOOL deep )
ovirtual void DrawRoundRect( const PRect & rect, PDIMENSION cornerWidth, PDIMENSION cornerHeight )
ovirtual void DrawEllipse( const PRect & rect )
ovirtual void DrawArc( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPie( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawChord( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPolyLine( const PPointArray & ptArray )
ovirtual void DrawPolygon( const PPointArray & ptArray )
ovirtual void DrawImgIcon( PORDINATE x, PORDINATE y, const PImgIcon & icn )
ovirtual void DrawIcon( PORDINATE x, PORDINATE y, const PIcon & icn )
ovirtual void DrawPixels( PORDINATE x, PORDINATE y, const PPixelImage & pix )
ovirtual void DrawPixels( const PRect & rect, const PPixelImage & pix )
ovirtual void DrawPict( PORDINATE x, PORDINATE y, const PPictImage & pic )
ovirtual void DrawPict( const PRect & rect, const PPictImage & pic )
ovirtual void DrawString( PORDINATE x, PORDINATE y, const PString & str, int options = LeftAlign )
ovirtual PDIMENSION DrawString( const PRect & rect, const PString & str, int options = LeftAlign )
ovirtual PDim MeasureString( const PString & str )
ovirtual PDIMENSION MeasureString(const PString & str, PDIMENSION width)
ovirtual void DrawTextLine( PORDINATE x, PORDINATE y, const char * textChars, const PDIMENSION * charWidths, PINDEX len )
ovirtual PRect GetDrawingBounds() const
ovirtual PRect GetPhysicalBounds(BOOL inPixels = FALSE) const
ovirtual void SetClipRegion( const PRegion & rgn )
ovirtual PRegion GetClipRegion() const
ovirtual void SetClipRect( const PRect & rect )
ovirtual PRect GetClipRect() const
oBOOL IsInClipRegion( const PPoint & pt ) const
oPDIMENSION FromPixelsDX( PDIMENSION dx ) const
oPDIMENSION ToPixelsDX( PDIMENSION dx ) const
oPDIMENSION FromPointsX( PDIMENSION dx )
oPDIMENSION ToPointsX( PDIMENSION dx )

Protected Classes

oclass State: public PObject, public PCanvasState

Protected Fields

oPRealFont realFont

Protected Methods

ovirtual void _DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void _FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )

Protected

PORDINATE Member variables


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Inherited from PCanvasState:

Public Classes

oenum PenStyles
oenum DrawingModes
oenum PolyFillMode

Public Methods

ovirtual BOOL SetPenStyle( PenStyles style )
oPenStyles GetPenStyle() const
ovirtual BOOL SetPenWidth( int width )
oint GetPenWidth() const
ovirtual BOOL SetPenMode( DrawingModes mode )
oDrawingModes GetPenMode() const
ovirtual BOOL SetPenFgColour( const PColour & colour )
oconst PColour& GetPenFgColour() const
ovirtual BOOL SetPenBkColour( const PColour & colour )
oconst PColour& GetPenBkColour() const
ovirtual BOOL SetFillPattern( const PPattern & pattern )
oPPattern GetFillPattern() const
ovirtual BOOL SetPatternOrigin( const PPoint & pt )
oPPoint GetPatternOrigin() const
ovirtual BOOL SetFillMode(DrawingModes style)
oDrawingModes GetFillMode() const
ovirtual BOOL SetFillFgColour( const PColour & colour )
oconst PColour& GetFillFgColour() const
ovirtual BOOL SetFillBkColour( const PColour & colour )
oconst PColour& GetFillBkColour() const
ovirtual BOOL SetFont(const PFont & newFont)
ovirtual BOOL SetTextFgColour( const PColour & colour )
oconst PColour& GetTextFgColour() const
ovirtual BOOL SetTextBkColour( const PColour & colour )
oconst PColour& GetTextBkColour() const
ovirtual BOOL SetPolyFillMode( PolyFillMode newMode )
oPolyFillMode GetPolyFillMode() const
ovirtual BOOL SetPalette( const PPalette & newPal )
oPPalette GetPalette() const
ovirtual BOOL SetMappingRect( const PRect & rect )
oPRect GetMappingRect() const
ovirtual BOOL SetViewportRect( const PRect & rect )
oPRect GetViewportRect() const
ovoid SetOrigin(const PPoint & pt)
oPPoint GetOrigin() const


Documentation

A canvas that will go to a printer. Outputing to a printer consists of drawing to an area that represents a printed page. The application then completes each page and creates a new blank page to be drawn to.

NOTE *********************************** On Some platforms, canvases are a limited resource. Do NOT create and leave them around for long periods. As soon as it is not required till the next user event, destroy it!

o PPrintCanvas( const PString & job )
Create a canvas that will go to the default printer device using its default printer setup.
Parameters:
job - Arbitrary name to identify to print job on some platforms, eg an identifier in the print queue for MS-Windows.

o PPrintCanvas( const PString & job, const PString & printer, const PString & device )
Create a canvas that will go to the specified printer device using its default printer setup.
Parameters:
job - Arbitrary name to identify to print job on some platforms, eg an identifier in the print queue for MS-Windows.
printer - Printer type name for printing to, eg "Postscript". The possible values for this parameter are platform dependent and would rarely be set explicitly by the application.
device - Output device or queue for printer, eg "LPT1" for MS-Windows or "PS_LASER" for Unix. The possible values for this parameter are platform dependent and would rarely be set explicitly by the application.

o PPrintCanvas( const PString & job, const PPrintInfo & info )
Create a canvas that will go to the specified printer device using the specified printer setup.
Parameters:
job - Arbitrary name to identify to print job on some platforms, eg an identifier in the print queue for MS-Windows.
info - Printer specification describing all optional information on the selected printer. This would typically be obtained via the PPrintJobDialog class.

ovirtual ~PPrintCanvas()
Destroy the printer canvas, freing all resource used.

o New functions for class

oBOOL NewPage()
Begin output to a new page. This will close and queue the current page and provide a clean new page for further drawing operations.

Returns:
TRUE if previous page was successfully queued and the new page is ready to be drawn to.

ovoid SetDrawingBounds( const PRect & bounds )
Set the drawable area of the printer page. This can limit the amount of the page specified in the printer setup that is actually used for the printing. This can be usefull for output code that scales to the GetDrawingBounds() function, but it is not desired that it scale to the full page size.
Parameters:
bounds - New bounds for canvas.

oconst PPrintInfo& GetPrintInfo() const
Get the current printer setup information for the print canvas.

Returns:
reference to the current print info.

ovoid ChangePrintInfo( const PPrintInfo & info )
This allows the print parameters to be changed in mid job. Note that this can only occur between pages, so there is an implicit NewPage() call in this function.

Not all items in the PPrintInfo can be changed in the middle of the print job, eg changing the printer type from "Postscript" to "HPPCL". These changes are ignored by the ChangePrintInfo() function.

Parameters:
info - New print information.

o Member fields

oPString jobName
Arbitrary name to identify to print job on some platforms, eg an identifier in the print queue for MS-Windows

oPPrintInfo printInfo
Printer specification describing all optional information on the selected printer. This would typically be obtained via the PPrintJobDialog class.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.