CGraphicsDevice Class Reference

class CGraphicsDevice : public CBase

Specifies the interface for concrete device classes.

It holds information on the capabilities and attributes of a graphics device. The CBitmapDevice and CPrinterDevice classes are derived from CGraphicsDevice .

CGraphicsDevice CPrinterDevice

Inherits from

Member Functions Documentation

CreateContext(CGraphicsContext *&)

TInt CreateContext ( CGraphicsContext *& aGC ) [pure virtual]

Creates a graphics context for the device.

Parameters

CGraphicsContext *& aGC On return, contains a pointer to the created graphics context.

DisplayMode()

TDisplayMode DisplayMode ( ) const [pure virtual]

Gets the display mode of the device.

FontHeightInTwips(TInt, TInt)

TInt FontHeightInTwips ( TInt aTypefaceIndex,
TInt aHeightIndex
) const [pure virtual]

Get the height of a font in twips.

The font is identified by typeface and height.

The value returned is rounded up or down to the nearest font height in twips.

Parameters

TInt aTypefaceIndex An index identifying the typeface, in the range: 0 to (NumTypefaces() - 1).
TInt aHeightIndex An index identifying the font height, in the range: 0 to (iNumHeights - 1). Note that iNumHeights is in the TTypefaceSupport object returned by TypefaceSupport().

GetPalette(CPalette *&)

TInt GetPalette ( CPalette *& aPalette ) const [pure virtual]

Gets the device's current palette.

This function is only supported if the device has a modifiable palette, which can be determined by calling PaletteAttributes() .

Parameters

CPalette *& aPalette On return, holds the device's current palette.

NumTypefaces()

TInt NumTypefaces ( ) const [pure virtual]

Gets the number of typefaces supported by the graphics device.

PaletteAttributes(TBool &, TInt &)

void PaletteAttributes ( TBool & aModifiable,
TInt & aNumEntries
) const [pure virtual]

Gets the palette attributes of the device.

Parameters

TBool & aModifiable On return, holds information on whether or not the device's palette is modifiable (ETrue) or fixed (EFalse).
TInt & aNumEntries On return, holds the number of entries in the device's palette.

SetPalette(CPalette *)

void SetPalette ( CPalette * aPalette ) [pure virtual]

Sets the device's palette.

Setting the palette is only possible if the device has a modifiable palette, which can be determined by calling PaletteAttributes() .

Parameters

CPalette * aPalette The new palette for the device.

SizeInPixels()

TSize SizeInPixels ( ) const [pure virtual]

Gets the size of the device area in pixels.

SizeInTwips()

TSize SizeInTwips ( ) const [pure virtual]

Gets the size of the device area in twips.

TypefaceSupport(TTypefaceSupport &, TInt)

void TypefaceSupport ( TTypefaceSupport & aTypefaceSupport,
TInt aTypefaceIndex
) const [pure virtual]

Gets typeface information for a specified typeface.

This information is returned in aTypefaceSupport, and includes:

the typeface name and typeface attributes

the number of font heights

the maximum and minimum font heights

whether it is a scalable typeface

NumTypefaces()

Parameters

TTypefaceSupport & aTypefaceSupport On return, contains the typeface information.
TInt aTypefaceIndex A typeface index number, in the range: zero to (NumTypefaces() - 1).