Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: 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:
CPrinterDevice(), CreateControlL(), CurrentPageSpecInTwips(), DeleteControl(), ExternalizePropertiesL(), InternalizePropertiesL(), Model(), PrintablePageInPixels(), RestorePropertiesL(), SelectPageSpecInTwips(), SetModel(), StorePropertiesL(), iControl, iCurrentPageSpecInTwips, ~CPrinterDevice()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CGraphicsDevice:
CreateContext(), DisplayMode(), FontHeightInTwips(), GetPalette(), NumTypefaces(), PaletteAttributes(), SetPalette(), SizeInPixels(), SizeInTwips(), TypefaceSupport()

Inherited from MGraphicsDeviceMap:
GetNearestFontInTwips(), GetNearestFontToDesignHeightInTwips(), GetNearestFontToMaxHeightInTwips(), HorizontalPixelsToTwips(), HorizontalTwipsToPixels(), PixelsToTwips(), ReleaseFont(), TwipsToPixels(), VerticalPixelsToTwips(), VerticalTwipsToPixels()

See also

See also:


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()

inline TPageSpec CurrentPageSpecInTwips() const;

Description

Gets the current page specification in twips.

Return value

TPageSpec

The current page specification, in twips.


SelectPageSpecInTwips()

virtual IMPORT_C void SelectPageSpecInTwips(const TPageSpec &aPageSpec);

Description

Sets the page specification in twips.

Parameters

const TPageSpec &aPageSpec

The page specification in twips.


PrintablePageInPixels()

virtual IMPORT_C 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() 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()

virtual TPrinterModelEntry Model() const=0;

Description

Gets the printer model entry.

Return value

TPrinterModelEntry

The printer model entry.


SetModel()

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()

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()

virtual IMPORT_C void DeleteControl();

Description

Deletes the printer control owned by this object.

The function sets the iControl member to NULL.


InternalizePropertiesL()

inline virtual void InternalizePropertiesL(RReadStream &);

Description

Externalizes printer properties to the store.

The default implementation is empty.

Parameters

RReadStream &


ExternalizePropertiesL()

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()

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.