CPrinterDevice Class Reference

#include <gdi.h>

Link against: gdi.lib

class CPrinterDevice : public CGraphicsDevice

Inherits from

Public Attributes
CPrinterControl *iControl
Protected Attributes
TPageSpec iCurrentPageSpecInTwips
Public Member Functions
~CPrinterDevice()
pure virtual voidCreateControlL(CPrinterPort *)
TPageSpec CurrentPageSpecInTwips()
virtual IMPORT_C voidDeleteControl()
virtual voidExternalizePropertiesL(RWriteStream &)
virtual voidInternalizePropertiesL(RReadStream &)
pure virtual TPrinterModelEntry Model()
virtual IMPORT_C TRectPrintablePageInPixels()
IMPORT_C voidRestorePropertiesL()
virtual IMPORT_C voidSelectPageSpecInTwips(const TPageSpec &)
pure virtual TInt SetModel(const TPrinterModelHeader &, CStreamStore &)
IMPORT_C voidStorePropertiesL()
Protected Member Functions
CPrinterDevice()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CGraphicsDevice::CreateContext(CGraphicsContext *&)
CGraphicsDevice::DisplayMode()const
CGraphicsDevice::FontHeightInTwips(TInt,TInt)const
CGraphicsDevice::GetPalette(CPalette *&)const
CGraphicsDevice::NumTypefaces()const
CGraphicsDevice::PaletteAttributes(TBool &,TInt &)const
CGraphicsDevice::SetPalette(CPalette *)
CGraphicsDevice::SizeInPixels()const
CGraphicsDevice::SizeInTwips()const
CGraphicsDevice::TypefaceSupport(TTypefaceSupport &,TInt)const
MGraphicsDeviceMap::GetNearestFontInTwips(CFont *&,const TFontSpec &)
MGraphicsDeviceMap::GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)
MGraphicsDeviceMap::GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)
MGraphicsDeviceMap::HorizontalPixelsToTwips(TInt)const
MGraphicsDeviceMap::HorizontalTwipsToPixels(TInt)const
MGraphicsDeviceMap::MGraphicsDeviceMap()
MGraphicsDeviceMap::PixelsToTwips(const TPoint &)const
MGraphicsDeviceMap::PixelsToTwips(const TRect &)const
MGraphicsDeviceMap::ReleaseFont(CFont *)
MGraphicsDeviceMap::TwipsToPixels(const TPoint &)const
MGraphicsDeviceMap::TwipsToPixels(const TRect &)const
MGraphicsDeviceMap::VerticalPixelsToTwips(TInt)const
MGraphicsDeviceMap::VerticalTwipsToPixels(TInt)const
MGraphicsDeviceMap::~MGraphicsDeviceMap()

Detailed 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.

See also: CPrinterControl

Member Attribute Documentation

iControl

CPrinterControl *iControl

The printer control.

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

iCurrentPageSpecInTwips

TPageSpec iCurrentPageSpecInTwips[protected]

Current page specification in twips.

Constructor & Destructor Documentation

CPrinterDevice ( )

IMPORT_CCPrinterDevice()[protected]

Standard constructor.

~CPrinterDevice ( )

IMPORT_C~CPrinterDevice()

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

Member Function Documentation

CreateControlL ( CPrinterPort * )

voidCreateControlL(CPrinterPort *aPrinterPort)[pure virtual]

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
aPrinterPortPointer to an instance of a printer port.

CurrentPageSpecInTwips ( )

TPageSpec CurrentPageSpecInTwips()const [inline]

Gets the current page specification in twips.

Return Value
The current page specification, in twips.

DeleteControl ( )

IMPORT_C voidDeleteControl()[virtual]

Deletes the printer control owned by this object.

The function sets the iControl member to NULL.

ExternalizePropertiesL ( RWriteStream & )

voidExternalizePropertiesL(RWriteStream &)const [inline, virtual]

Externalizes printer properties to the store.

The default implementation is empty.

InternalizePropertiesL ( RReadStream & )

voidInternalizePropertiesL(RReadStream &)[inline, virtual]

Externalizes printer properties to the store.

The default implementation is empty.

Model ( )

TPrinterModelEntry Model()const [pure virtual]

Gets the printer model entry.

Return Value
The printer model entry.

PrintablePageInPixels ( )

IMPORT_C TRectPrintablePageInPixels()const [virtual]

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
The dimensions of the printer device area in pixels, respecting the page orientation

RestorePropertiesL ( )

IMPORT_C voidRestorePropertiesL()

Restores printer properties.

SelectPageSpecInTwips ( const TPageSpec & )

IMPORT_C voidSelectPageSpecInTwips(const TPageSpec &aPageSpec)[virtual]

Sets the page specification in twips.

Parameters
aPageSpecThe page specification in twips.

SetModel ( const TPrinterModelHeader &, CStreamStore & )

TInt SetModel(const TPrinterModelHeader &aModel,
CStreamStore &aStore
)[pure virtual]

Sets the printer model header and the store.

Parameters
aModelThe printer model header.
aStoreThe store.
Return Value
KErrNone if successful; otherwise, another of the system-wide error codes.

StorePropertiesL ( )

IMPORT_C voidStorePropertiesL()const

Stores the printer properties.