Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: gdi.h
Link against: gdi.lib

Class CPrinterDriver

CPrinterDriver

Support

Supported from 5.0

Description

Provides access to a store containing printer specification data.

Printer specification data is held as a direct file store, and usually has a .pdr file type.

A printer driver is implemented as two files: a PDR file containing the printer specification data and a PDL file containing the code to link the printer with the graphics printing system.

The printer specification data is generated by compiling a text file (a .pd file type) using the pdrtran tool. Printer specification data defines:

Derivation

CBaseBase class for all classes to be instantiated on the heap
CPrinterDriverProvides access to a store containing printer specification data

Defined in CPrinterDriver:
Close(), CreatePrinterDeviceL(), CreatePrinterDriverUIL(), Model(), NewL(), NumModels(), OpenPdrL(), PrinterDevice(), ~CPrinterDriver()

Inherited from CBase:
operator new()

See also:


Construction and destruction


NewL()

static CPrinterDriver* NewL();

Description

Constructs, and returns a pointer to a new instance for accessing a printer specification data store.

Return value

CPrinterDriver*

Pointer to the object for accessing a printer specification data store.


~CPrinterDriver()

~CPrinterDriver();

Description

Destructor.

It frees all resources owned by the object, prior to its destruction. In particular, it closes the printer specification data store and any open session with the file server.

[Top]


Member functions


OpenPdrL()

void OpenPdrL(const TDesC& aName);

Description

Opens the specified printer specification data store.

Return value

const TDesC& aName

The name of the printer specification data store. This must be a valid printer specification data store, otherwise the function leaves with KErrNotSupported.


Close()

void Close();

Description

Closes the printer specification data store and frees resources.

An open session with the file server remains open.


NumModels()

TInt NumModels() const;

Description

Gets the number of printer models defined by the printer specification.

Return value

TInt

The number of printer models.


Model()

TPrinterModelEntry Model(TInt aNum) const;

Description

Gets the specified printer model.

Parameters

TInt aNum

An index into the list of printer models defined in the printer specification data.

Return value

TPrinterModelEntry

Model specific information.


PrinterDevice()

CPrinterDevice* PrinterDevice();

Description

Gets the associated graphics printer device.

Return value

CPrinterDevice*

The physical graphics device used for printing.


CreatePrinterDeviceL()

CPrinterDevice* CreatePrinterDeviceL(TUid aModelUid);

Description

Creates the physical graphics device to be used for printing.

Parameters

TUid aModelUid

The UID of a specific model which is defined in the printer specification data.

Return value

CPrinterDevice*

The physical graphics device to be used for printing.


CreatePrinterDriverUIL()

CPrinterDriverUI* CreatePrinterDriverUIL();

Description

Constructs a printer specific user interface.

The user interface object is optional, but if it exists, it is implemented as part of a UDL (i.e. a UI DLL).

Return value

CPrinterDriverUI*

A pointer to the printer specific user interface, or NULL if there is none.