class TZoomFactor : public MGraphicsDeviceMap |
The interface for mapping between twips and device-specific units enriched with facilities to allow zooming.
The class is recursive, because a TZoomFactor object can have a MGraphicsDeviceMap (which could itself be a TZoomFactor) in its member data. This allows a zoom factor object to contain another zoom factor object, and is used to allow objects with different zoom factors to be embedded in each other to an arbitrary depth by the application architecture.
Public Member Functions | |
---|---|
TZoomFactor() | |
TZoomFactor(const MGraphicsDeviceMap *) | |
TZoomFactor(const TZoomFactor *) | |
~TZoomFactor() | |
IMPORT_C TInt | GetNearestFontInTwips(CFont *&, const TFontSpec &) |
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &) |
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt) |
const MGraphicsDeviceMap * | GraphicsDeviceMap() |
IMPORT_C TInt | HorizontalPixelsToTwips(TInt) |
IMPORT_C TInt | HorizontalTwipsToPixels(TInt) |
IMPORT_C void | ReleaseFont(CFont *) |
void | SetGraphicsDeviceMap(const MGraphicsDeviceMap *) |
IMPORT_C void | SetTwipToPixelMapping(const TSize &, const TSize &) |
IMPORT_C void | SetZoomFactor(TInt) |
IMPORT_C TInt | VerticalPixelsToTwips(TInt) |
IMPORT_C TInt | VerticalTwipsToPixels(TInt) |
IMPORT_C TInt | ZoomFactor() |
Private Attributes | |
---|---|
const MGraphicsDeviceMap * | iDevice |
TInt | iZoomFactor |
TZoomFactor | ( | const MGraphicsDeviceMap * | aDevice | ) | [inline] |
Constructs a zoom factor object for a specific graphics device map.
The graphics map is either directly associated with a particular graphics device itself, or is associated with a hierarchy of device maps whose root map is associated with a particular graphics device.
const MGraphicsDeviceMap * aDevice | The graphics device map with which the zoom factor is associated. |
TZoomFactor | ( | const TZoomFactor * | aDevice | ) | [inline] |
const TZoomFactor * aDevice |
IMPORT_C TInt | GetNearestFontInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
When the font is no longer needed, call ReleaseFont().
Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new 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.
KErrNone if successful; a system-wide error code otherwise.
Use GetNearestFontToDesignHeightInTwips
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | , |
const TFontSpec & | ||||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
When the font is no longer needed, call ReleaseFont().
This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new 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.
KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | , |
const TFontSpec & | , | |||
TInt | ||||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
When the font is no longer needed, call 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.
KErrNone if successful; a system-wide error code otherwise.
const MGraphicsDeviceMap * | GraphicsDeviceMap | ( | ) | const [inline] |
Gets the graphics device map of this zoom factor object.
The graphics device map of the TZoomFactor.
IMPORT_C TInt | HorizontalPixelsToTwips | ( | TInt | aPixels | ) | const [virtual] |
Converts a horizontal dimension from pixels to twips.
An implementation is supplied by a derived class.
A horizontal dimension of a device in twips.
TInt aPixels | A horizontal dimension of a device in pixels. |
IMPORT_C TInt | HorizontalTwipsToPixels | ( | TInt | aTwips | ) | const [virtual] |
Converts a horizontal dimension from twips to pixels.
An implementation is supplied by a derived class.
A horizontal dimension of a device in pixels.
TInt aTwips | A horizontal dimension of a device in twips. |
IMPORT_C void | ReleaseFont | ( | CFont * | aFont | ) | [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.
CFont * aFont | A pointer to the font to be released. |
void | SetGraphicsDeviceMap | ( | const MGraphicsDeviceMap * | aDevice | ) | [inline] |
Sets the graphics device map for this zoom factor object.
const MGraphicsDeviceMap * aDevice | The graphics device map for this TZoomFactor. |
IMPORT_C void | SetTwipToPixelMapping | ( | const TSize & | aSizeInPixels, |
const TSize & | aSizeInTwips | |||
) |
IMPORT_C TInt | VerticalPixelsToTwips | ( | TInt | aPixels | ) | const [virtual] |
Converts a vertical dimension from pixels to twips.
An implementation is supplied by a derived class.
A vertical dimension of a device in twips.
TInt aPixels | A vertical dimension of a device in pixels. |
IMPORT_C TInt | VerticalTwipsToPixels | ( | TInt | aTwips | ) | const [virtual] |
Converts a vertical dimension from twips to pixels.
An implementation is supplied by a derived class.
A vertical dimension of a device in pixels.
TInt aTwips | A vertical dimension of a device in twips. |