Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CGraphicsDevice Class Referenceabstract

Specifies the interface for concrete device classes. More...

#include <gdi.h>

Inheritance diagram for CGraphicsDevice:
CBase MGraphicsDeviceMap CBitmapDevice CPrinterDevice CWsScreenDevice

Public Member Functions

virtual TDisplayMode DisplayMode () const =0
 Gets the display mode of the device.
 
virtual TSize SizeInPixels () const =0
 Gets the size of the device area in pixels.
 
virtual TSize SizeInTwips () const =0
 Gets the size of the device area in twips.
 
virtual TInt CreateContext (CGraphicsContext *&aGC)=0
 Creates a graphics context for the device.
 
virtual TInt NumTypefaces () const =0
 Gets the number of typefaces supported by the graphics device.
 
virtual void TypefaceSupport (TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const =0
 Gets typeface information for a specified typeface.
 
virtual TInt FontHeightInTwips (TInt aTypefaceIndex, TInt aHeightIndex) const =0
 Get the height of a font in twips.
 
virtual void PaletteAttributes (TBool &aModifiable, TInt &aNumEntries) const =0
 Gets the palette attributes of the device.
 
virtual void SetPalette (CPalette *aPalette)=0
 Sets the device's palette.
 
virtual TInt GetPalette (CPalette *&aPalette) const =0
 Gets the device's current palette.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
- Public Member Functions inherited from MGraphicsDeviceMap
IMPORT_C MGraphicsDeviceMap ()
 Default constructor.
 
virtual IMPORT_C ~MGraphicsDeviceMap ()
 Destructor.
 
IMPORT_C TPoint TwipsToPixels (const TPoint &aTwipPoint) const
 Converts a point in twips to a point in pixels.
 
IMPORT_C TRect TwipsToPixels (const TRect &aTwipRect) const
 Converts a rectangle in twips to a rectangle in pixels.
 
IMPORT_C TPoint PixelsToTwips (const TPoint &aPixelPoint) const
 Converts a point in pixels to a point in twips.
 
IMPORT_C TRect PixelsToTwips (const TRect &aPixelRect) const
 Converts a rectangle in pixels to a rectangle in twips.
 
virtual TInt HorizontalTwipsToPixels (TInt aTwips) const =0
 Converts a horizontal dimension from twips to pixels.
 
virtual TInt VerticalTwipsToPixels (TInt aTwips) const =0
 Converts a vertical dimension from twips to pixels.
 
virtual TInt HorizontalPixelsToTwips (TInt aPixels) const =0
 Converts a horizontal dimension from pixels to twips.
 
virtual TInt VerticalPixelsToTwips (TInt aPixels) const =0
 Converts a vertical dimension from pixels to twips.
 
virtual TInt GetNearestFontInTwips (CFont *&aFont, const TFontSpec &aFontSpec)=0
 
virtual TInt GetNearestFontToDesignHeightInTwips (CFont *&, const TFontSpec &)
 
virtual TInt GetNearestFontToMaxHeightInTwips (CFont *&, const TFontSpec &, TInt)
 
virtual void ReleaseFont (CFont *aFont)=0
 Releases the specified font.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

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
API status
Published to all clients. Released API.

Definition at line 1204 of file gdi.h.

Member Function Documentation

◆ CreateContext()

virtual TInt CGraphicsDevice::CreateContext ( CGraphicsContext *&  aGC)
pure virtual

Creates a graphics context for the device.

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

Implemented in CWsScreenDevice.

◆ DisplayMode()

virtual TDisplayMode CGraphicsDevice::DisplayMode ( ) const
pure virtual

Gets the display mode of the device.

Returns
The display mode of the device.

Implemented in CWsScreenDevice.

◆ FontHeightInTwips()

virtual TInt CGraphicsDevice::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
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().
Returns
The height of the font, in twips.

Implemented in CWsScreenDevice.

◆ GetPalette()

virtual TInt CGraphicsDevice::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.
Returns
KErrNone, if successful; otherwise, another of the system-wide error codes.

Implemented in CWsScreenDevice.

◆ NumTypefaces()

virtual TInt CGraphicsDevice::NumTypefaces ( ) const
pure virtual

Gets the number of typefaces supported by the graphics device.

Returns
The number of typefaces supported.

Implemented in CWsScreenDevice.

◆ PaletteAttributes()

virtual void CGraphicsDevice::PaletteAttributes ( 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.

Implemented in CWsScreenDevice.

◆ SetPalette()

virtual void CGraphicsDevice::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
aPaletteThe new palette for the device.

Implemented in CWsScreenDevice.

◆ SizeInPixels()

virtual TSize CGraphicsDevice::SizeInPixels ( ) const
pure virtual

Gets the size of the device area in pixels.

Returns
The width and height of the device area, in pixels

Implemented in CWsScreenDevice.

◆ SizeInTwips()

virtual TSize CGraphicsDevice::SizeInTwips ( ) const
pure virtual

Gets the size of the device area in twips.

Returns
The width and height of the device area, in twips

Implemented in CWsScreenDevice.

◆ TypefaceSupport()

virtual void CGraphicsDevice::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

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

Implemented in CWsScreenDevice.


The documentation for this class was generated from the following file: