Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: gdi.h
Link against: gdi.lib

Class CPrinterDevice

CPrinterDevice

Support

Supported from 5.0

Description

Printer graphics device interface.

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

This class is used to:

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

CBaseBase class for all classes to be instantiated on the heap
CGraphicsDeviceSpecifies the interface for concrete device classes
CPrinterDevicePrinter graphics device interface
MGraphicsDeviceMapInterface class for mapping between twips and device-specific units (pixels)

Defined in CPrinterDevice:
CreateControlL(), CurrentPageSpecInTwips(), DeleteControl(), ExternalizePropertiesL(), InternalizePropertiesL(), Model(), PrintablePageInPixels(), RestorePropertiesL(), SelectPageSpecInTwips(), SetModel(), StorePropertiesL(), iControl, ~CPrinterDevice()

Inherited from CBase:
operator new()

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

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

See also:


Destruction


~CPrinterDevice()

~CPrinterDevice();

Description

Destructor.

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

[Top]


Page specification


CurrentPageSpecInTwips()

TPageSpec CurrentPageSpecInTwips() const;

Description

Gets the current page specification in twips.

Return value

TPageSpec

The current page specification, in twips.


SelectPageSpecInTwips()

virtual void SelectPageSpecInTwips(const TPageSpec& aPageSpec);

Description

Sets the page specification in twips.

Parameters

const TPageSpec& aPageSpec

The page specification in twips.


PrintablePageInPixels()

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

[Top]


Printer model


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.

[Top]


Printer control and context


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 void DeleteControl();

Description

Deletes the printer control owned by this object.

The function sets the iControl member to NULL.

[Top]


Storing/restoring and externalising/internalising


ExternalizePropertiesL()

virtual void ExternalizePropertiesL(RWriteStream& aStream) const;

Description

Externalizes printer properties to the store.

The default implementation is empty.

Parameters

RWriteStream& aStream

The write stream.


InternalizePropertiesL()

virtual void InternalizePropertiesL(RReadStream& aStream);

Description

Internalizes printer properties from the store

The default implementation is empty.

Parameters

RReadStream& aStream

The read stream.


RestorePropertiesL()

void RestorePropertiesL();

Description

Restores printer properties.


StorePropertiesL()

void StorePropertiesL() const;

Description

Stores the printer properties.

[Top]


Public data members


iControl

CPrinterControl* iControl

Description

The printer control.

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