CGraphicsDevice Class Reference

#include <gdi.h>

class CGraphicsDevice : public CBase, public MGraphicsDeviceMap

Inherits from

Public Member Functions
pure virtual TInt CreateContext(CGraphicsContext *&)
pure virtual TDisplayMode DisplayMode()
pure virtual TInt FontHeightInTwips(TInt, TInt)
pure virtual TInt GetPalette(CPalette *&)
pure virtual TInt NumTypefaces()
pure virtual voidPaletteAttributes(TBool &, TInt &)
pure virtual voidSetPalette(CPalette *)
pure virtual TSize SizeInPixels()
pure virtual TSize SizeInTwips()
pure virtual voidTypefaceSupport(TTypefaceSupport &, TInt)
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()
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

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.

See also: CGraphicsDevice CPrinterDevice

Member Function Documentation

CreateContext ( CGraphicsContext *& )

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

Creates a graphics context for the device.

Parameters
aGCOn return, contains a pointer to the created graphics context.
Return Value
KErrNone, if successful; otherwise, another of the system-wide error codes.

DisplayMode ( )

TDisplayMode DisplayMode()const [pure virtual]

Gets the display mode of the device.

Return Value
The display mode of the device.

FontHeightInTwips ( TInt, TInt )

TInt FontHeightInTwips(TIntaTypefaceIndex,
TIntaHeightIndex
)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
aTypefaceIndexAn index identifying the typeface, in the range: 0 to (NumTypefaces() - 1).
aHeightIndexAn index identifying the font height, in the range: 0 to (iNumHeights - 1). Note that iNumHeights is in the TTypefaceSupport object returned by TypefaceSupport().
Return Value
The height of the font, in twips.

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
aPaletteOn return, holds the device's current palette.
Return Value
KErrNone, if successful; otherwise, another of the system-wide error codes.

NumTypefaces ( )

TInt NumTypefaces()const [pure virtual]

Gets the number of typefaces supported by the graphics device.

Return Value
The number of typefaces supported.

PaletteAttributes ( TBool &, TInt & )

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

Gets the palette attributes of the device.

Parameters
aModifiableOn return, holds information on whether or not the device's palette is modifiable (ETrue) or fixed (EFalse).
aNumEntriesOn return, holds the number of entries in the device's palette.

SetPalette ( CPalette * )

voidSetPalette(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
aPaletteThe new palette for the device.

SizeInPixels ( )

TSize SizeInPixels()const [pure virtual]

Gets the size of the device area in pixels.

Return Value
The width and height of the device area, in pixels

SizeInTwips ( )

TSize SizeInTwips()const [pure virtual]

Gets the size of the device area in twips.

Return Value
The width and height of the device area, in twips

TypefaceSupport ( TTypefaceSupport &, TInt )

voidTypefaceSupport(TTypefaceSupport &aTypefaceSupport,
TIntaTypefaceIndex
)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

See also: NumTypefaces()

Parameters
aTypefaceSupportOn return, contains the typeface information.
aTypefaceIndexA typeface index number, in the range: zero to (NumTypefaces() - 1).