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

Interface class for mapping between twips and device-specific units (pixels). More...

#include <gdi.h>

Inheritance diagram for MGraphicsDeviceMap:
CGraphicsDevice TZoomFactor CBitmapDevice CPrinterDevice CWsScreenDevice

Public Member Functions

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.
 

Detailed Description

Interface class for mapping between twips and device-specific units (pixels).

TZoomFactor is derived from MGraphicsDeviceMap.

See also
CGraphicsDevice
TZoomFactor
API status
Published to all clients. Released API.

Definition at line 1064 of file gdi.h.

Constructor & Destructor Documentation

◆ MGraphicsDeviceMap()

IMPORT_C MGraphicsDeviceMap::MGraphicsDeviceMap ( )

Default constructor.

(generated from Symbian Developer Library)

◆ ~MGraphicsDeviceMap()

IMPORT_C MGraphicsDeviceMap::~MGraphicsDeviceMap ( )
virtual

Destructor.

(generated from Symbian Developer Library)

Member Function Documentation

◆ GetNearestFontInTwips()

TInt MGraphicsDeviceMap::GetNearestFontInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec 
)
pure virtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

Note that this deprecated function is replaced by the new @c GetNearestFontToDesignHeightInTwips() 
yielding (virtually) the same result. However clients are strongly encouraged to use the new
@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
character within any given text string will fit within the given amount of twips, whereas the design 
height is an aesthetic unit decided by the font designer without strict physical meaning, which 
may result in cropped characters.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
@deprecated Use GetNearestFontToDesignHeightInTwips
API status
Published to all clients.
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.

(generated from Symbian Developer Library)

Implemented in TZoomFactor, and CWsScreenDevice.

◆ GetNearestFontToDesignHeightInTwips()

virtual TInt MGraphicsDeviceMap::GetNearestFontToDesignHeightInTwips ( CFont *&  ,
const TFontSpec &   
)
inlinevirtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

This new function replaces the deprecated @c GetNearestFontInTwips() yielding (virtually) the 
same result. However clients are strongly encouraged to use the new
@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
character within any given text string will fit within the given amount of twips, whereas the design 
height is an aesthetic unit decided by the font designer without strict physical meaning, which 
may result in cropped characters.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.

Reimplemented in TZoomFactor, and CWsScreenDevice.

Definition at line 1148 of file gdi.h.

◆ GetNearestFontToMaxHeightInTwips()

virtual TInt MGraphicsDeviceMap::GetNearestFontToMaxHeightInTwips ( CFont *&  ,
const TFontSpec &  ,
TInt   
)
inlinevirtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

The font and bitmap server returns a pointer to the nearest matching font 
from those available. Matches to max height of font - this does its best 
to return a font that will fit within the maximum height specified (but 
note that variations due to hinting algorithms may rarely result in this 
height being exceeded by up to one pixel). Problems can also be 
encountered with bitmap fonts where the typeface exists but doesn't have 
a font small enough.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@param aMaxHeight The maximum height within which the font must fit.
This overrides the height specified in aFontSpec.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.

Reimplemented in TZoomFactor, and CWsScreenDevice.

Definition at line 1174 of file gdi.h.

◆ HorizontalPixelsToTwips()

virtual TInt MGraphicsDeviceMap::HorizontalPixelsToTwips ( TInt  aPixels) const
pure virtual

Converts a horizontal dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters
aPixelsA horizontal dimension of a device in pixels.
Returns
A horizontal dimension of a device in twips.

Implemented in CWsScreenDevice, and TZoomFactor.

◆ HorizontalTwipsToPixels()

virtual TInt MGraphicsDeviceMap::HorizontalTwipsToPixels ( TInt  aTwips) const
pure virtual

Converts a horizontal dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters
aTwipsA horizontal dimension of a device in twips.
Returns
A horizontal dimension of a device in pixels.

Implemented in CWsScreenDevice, and TZoomFactor.

◆ PixelsToTwips() [1/2]

IMPORT_C TPoint MGraphicsDeviceMap::PixelsToTwips ( const TPoint &  aPixelPoint) const

Converts a point in pixels to a point in twips.

Parameters
aPixelPointA point on the graphics device in pixels.

(generated from Symbian Developer Library)

◆ PixelsToTwips() [2/2]

IMPORT_C TRect MGraphicsDeviceMap::PixelsToTwips ( const TRect &  aPixelRect) const

Converts a rectangle in pixels to a rectangle in twips.

Parameters
aPixelRectA rectangle on the graphics device in pixels.

(generated from Symbian Developer Library)

◆ ReleaseFont()

virtual void MGraphicsDeviceMap::ReleaseFont ( CFont *  aFont)
pure virtual

Releases the specified font.

It is used to indicate that the specified font is no longer needed for use by the device map. As fonts can be shared between applications, this function does not delete the copy of the font from RAM unless the font was only being used by this particular device map.

An implementation is supplied by a derived class.

Parameters
aFontA pointer to the font to be released.

Implemented in TZoomFactor, and CWsScreenDevice.

◆ TwipsToPixels() [1/2]

IMPORT_C TPoint MGraphicsDeviceMap::TwipsToPixels ( const TPoint &  aTwipPoint) const

Converts a point in twips to a point in pixels.

Parameters
aTwipPointA point on the graphics device in twips.

(generated from Symbian Developer Library)

◆ TwipsToPixels() [2/2]

IMPORT_C TRect MGraphicsDeviceMap::TwipsToPixels ( const TRect &  aTwipRect) const

Converts a rectangle in twips to a rectangle in pixels.

Parameters
aTwipRectA rectangle on the graphics device in twips

(generated from Symbian Developer Library)

◆ VerticalPixelsToTwips()

virtual TInt MGraphicsDeviceMap::VerticalPixelsToTwips ( TInt  aPixels) const
pure virtual

Converts a vertical dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters
aPixelsA vertical dimension of a device in pixels.
Returns
A vertical dimension of a device in twips.

Implemented in TZoomFactor, and CWsScreenDevice.

◆ VerticalTwipsToPixels()

virtual TInt MGraphicsDeviceMap::VerticalTwipsToPixels ( TInt  aTwips) const
pure virtual

Converts a vertical dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters
aTwipsA vertical dimension of a device in twips.
Returns
A vertical dimension of a device in pixels.

Implemented in TZoomFactor, and CWsScreenDevice.


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