TZoomFactor Class Reference

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.

Inherits from

Constructor & Destructor Documentation

TZoomFactor()

IMPORT_CTZoomFactor()

Constructs a default zoom factor object.

Note that a TZoomFactor object cannot be used until a CGraphicsDevice to which it is associated is specified (by SetGraphicsDeviceMap()). Therefore the other constructor is normally used for constructing TZoomFactors. The default constructor function is provided for use in TZoomFactor-derived classes.

TZoomFactor(const MGraphicsDeviceMap *)

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.

Parameters

const MGraphicsDeviceMap * aDeviceThe graphics device map with which the zoom factor is associated.

TZoomFactor(const TZoomFactor *)

TZoomFactor(const TZoomFactor *aDevice)[inline]

Parameters

const TZoomFactor * aDevice

~TZoomFactor()

IMPORT_C~TZoomFactor()

Destructor.

Frees resources owned by the object, prior to its destruction.

Member Functions Documentation

GetNearestFontInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Parameters

CFont *& aFont
const TFontSpec & aFontSpec

GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontToDesignHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.

GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)

IMPORT_C TIntGetNearestFontToMaxHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)[virtual]

Gets the font which is the nearest to the given font specification. Matching to maximum height returns a font that will fit within the height specified.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.
TInt aMaxHeightThe maximum height within which the font must fit. This overrides the height specified in aFontSpec. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel.

GraphicsDeviceMap()

const MGraphicsDeviceMap *GraphicsDeviceMap()const [inline]

Gets the graphics device map of this zoom factor object.

HorizontalPixelsToTwips(TInt)

IMPORT_C TIntHorizontalPixelsToTwips(TIntaPixelWidth)const [virtual]

Converts a horizontal dimension from pixels to twips on the graphics device.

This function implements the pure virtual function defined in MGraphicsDeviceMap::HorizontalPixelsToTwips()

Parameters

TInt aPixelWidth

HorizontalTwipsToPixels(TInt)

IMPORT_C TIntHorizontalTwipsToPixels(TIntaTwipWidth)const [virtual]

Converts a horizontal dimension from twips to pixels on the graphics device.

This function implements the pure virtual function defined in MGraphicsDeviceMap::HorizontalTwipsToPixels()

Parameters

TInt aTwipWidth

ReleaseFont(CFont *)

IMPORT_C voidReleaseFont(CFont *aFont)[virtual]

Releases the specified font.

This function implements the pure virtual function defined in MGraphicsDeviceMap::ReleaseFont()

Parameters

CFont * aFontA pointer to the font to be released.

SetGraphicsDeviceMap(const MGraphicsDeviceMap *)

voidSetGraphicsDeviceMap(const MGraphicsDeviceMap *aDevice)[inline]

Sets the graphics device map for this zoom factor object.

Parameters

const MGraphicsDeviceMap * aDeviceThe graphics device map for this TZoomFactor.

SetTwipToPixelMapping(const TSize &, const TSize &)

IMPORT_C voidSetTwipToPixelMapping(const TSize &aSizeInPixels,
const TSize &aSizeInTwips
)

Sets the twips to pixels mapping for the graphics device with which the zoom factor is associated.

This setting is used by all the twips to pixels and pixels to twips conversion functions.

Parameters

const TSize & aSizeInPixelsThe size of the graphics device area in pixels.
const TSize & aSizeInTwipsThe size of the graphics device area in twips.

SetZoomFactor(TInt)

IMPORT_C voidSetZoomFactor(TIntaZoomFactor)

Sets the zoom factor.

Parameters

TInt aZoomFactorThe desired zoom factor.

VerticalPixelsToTwips(TInt)

IMPORT_C TIntVerticalPixelsToTwips(TIntaPixelHeight)const [virtual]

Converts a vertical dimension from pixels to twips on the graphics device.

This function implements the pure virtual function defined in MGraphicsDeviceMap::VerticalPixelsToTwips()

Parameters

TInt aPixelHeight

VerticalTwipsToPixels(TInt)

IMPORT_C TIntVerticalTwipsToPixels(TIntaTwipHeight)const [virtual]

Converts a vertical dimension from twips to pixels on the graphics device.

This function implements the pure virtual function defined in MGraphicsDeviceMap::VerticalTwipsToPixels()

Parameters

TInt aTwipHeight

ZoomFactor()

IMPORT_C TIntZoomFactor()const

Gets the zoom factor.

Member Data Documentation

const MGraphicsDeviceMap * iDevice

const MGraphicsDeviceMap *iDevice[private]

TInt iZoomFactor

TInt iZoomFactor[private]