Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GDI.H>
Link against: gdi.lib

Class CPrinterDevice

class CPrinterDevice : public CGraphicsDevice;

Description

Printer graphics device interface.

This abstract class represents a physical graphics device that is used for printing.

This class is used to:

set and get the page specification

map between the co-ordinates of the printed page (in twips) and the co-ordinates of the image device (in pixels)

get and set the printer model entry

create and delete a printer control.

A printer driver is defined in terms of a printer device and a printer control. A printer device can own either a single or no printer control. The control determines the progress and termination of the print job and is responsible for producing output.

Derivation

Members

Defined in CPrinterDevice:

Inherited from CBase:

Inherited from CGraphicsDevice:

Inherited from MGraphicsDeviceMap:

See also:

Related Topics


Construction and destruction


~CPrinterDevice()

IMPORT_C ~CPrinterDevice();

Description

Destructor. It frees all resources owned by the object, prior to its destruction.


CPrinterDevice()

protected: IMPORT_C CPrinterDevice();

Description

Standard constructor.

[Top]


Member functions


CurrentPageSpecInTwips()const

inline TPageSpec CurrentPageSpecInTwips() const;

Description

Gets the current page specification in twips.

Return value

TPageSpec

The current page specification, in twips.


SelectPageSpecInTwips(const TPageSpec &)

IMPORT_C virtual void SelectPageSpecInTwips(const TPageSpec &aPageSpec);

Description

Sets the page specification in twips.

Parameters

const TPageSpec &aPageSpec

The page specification in twips.


PrintablePageInPixels()const

IMPORT_C virtual TRect PrintablePageInPixels() const;

Description

Gets the dimensions of the area to which the printer device can print.

These dimensions are normally less than those returned by TPageSpec::OrientedPageSize()const because a margin exists between the boundary of the printable page and the absolute extent of the page.

Return value

TRect

The dimensions of the printer device area in pixels, respecting the page orientation


Model()const

virtual TPrinterModelEntry Model() const=0;

Description

Gets the printer model entry.

Return value

TPrinterModelEntry

The printer model entry.


SetModel(const TPrinterModelHeader &,CStreamStore &)

virtual TInt SetModel(const TPrinterModelHeader &aModel, CStreamStore &aStore)=0;

Description

Sets the printer model header and the store.

Parameters

const TPrinterModelHeader &aModel

The printer model header.

CStreamStore &aStore

The store.

Return value

TInt

KErrNone if successful; otherwise, another of the system-wide error codes.


CreateControlL(CPrinterPort *)

virtual void CreateControlL(CPrinterPort *aPrinterPort)=0;

Description

Creates a printer control.

The printer control is an instance of a CPrinterControl derived class; it is assigned to this printer device's iControl member.

Note that this function is called by CPrintSetup::StartPrintL().

Parameters

CPrinterPort *aPrinterPort

Pointer to an instance of a printer port.


DeleteControl()

IMPORT_C virtual void DeleteControl();

Description

Deletes the printer control owned by this object.

The function sets the iControl member to NULL.


InternalizePropertiesL(RReadStream &)

inline virtual void InternalizePropertiesL(RReadStream &);

Description

Externalizes printer properties to the store.

The default implementation is empty.

Parameters

RReadStream &


ExternalizePropertiesL(RWriteStream &)const

inline virtual void ExternalizePropertiesL(RWriteStream &) const;

Description

Externalizes printer properties to the store.

The default implementation is empty.

Parameters

RWriteStream &


RestorePropertiesL()

IMPORT_C void RestorePropertiesL();

Description

Restores printer properties.


StorePropertiesL()const

IMPORT_C void StorePropertiesL() const;

Description

Stores the printer properties.

[Top]


Member data


iControl

CPrinterControl * iControl;

Description

The printer control.

This may be NULL. If implemented, it provides control over the print operation.


iCurrentPageSpecInTwips

protected: TPageSpec iCurrentPageSpecInTwips;

Description

Current page specification in twips.