Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GDI.H>
Link against: gdi.lib

Class TZoomFactor

class TZoomFactor : public MGraphicsDeviceMap;

Description

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.

Derivation

Members

Defined in TZoomFactor:

Inherited from MGraphicsDeviceMap:


Construction and destruction


TZoomFactor()

IMPORT_C TZoomFactor();

Description

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 TZoomFactor::SetGraphicsDeviceMap(const MGraphicsDeviceMap *)). Therefore the other constructor is normally used for constructing TZoomFactors. The default constructor function is provided for use in TZoomFactor-derived classes.


~TZoomFactor()

IMPORT_C ~TZoomFactor();

Description

Destructor.

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


TZoomFactor(const MGraphicsDeviceMap *)

inline TZoomFactor(const MGraphicsDeviceMap *aDevice);

Description

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 *aDevice

The graphics device map with which the zoom factor is associated.


TZoomFactor(const TZoomFactor *)

inline TZoomFactor(const TZoomFactor *aDevice);

Description

Parameters

const TZoomFactor *aDevice

[Top]


Member functions


ZoomFactor()const

IMPORT_C TInt ZoomFactor() const;

Description

Gets the zoom factor.

Return value

TInt

The zoom factor


SetZoomFactor(TInt)

IMPORT_C void SetZoomFactor(TInt aZoomFactor);

Description

Sets the zoom factor.

Parameters

TInt aZoomFactor

The desired zoom factor.


SetGraphicsDeviceMap(const MGraphicsDeviceMap *)

inline void SetGraphicsDeviceMap(const MGraphicsDeviceMap *aDevice);

Description

Sets the graphics device map for this zoom factor object.

Parameters

const MGraphicsDeviceMap *aDevice

The graphics device map for this TZoomFactor.


GraphicsDeviceMap()const

inline const MGraphicsDeviceMap* GraphicsDeviceMap() const;

Description

Gets the graphics device map of this zoom factor object.

Return value

const MGraphicsDeviceMap *

The graphics device map of the TZoomFactor.


SetTwipToPixelMapping(const TSize &,const TSize &)

IMPORT_C void SetTwipToPixelMapping(const TSize &aSizeInPixels, const TSize &aSizeInTwips);

Description

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 &aSizeInPixels

The size of the graphics device area in pixels.

const TSize &aSizeInTwips

The size of the graphics device area in twips.


HorizontalTwipsToPixels(TInt)const

IMPORT_C virtual TInt HorizontalTwipsToPixels(TInt aTwipWidth) const;

Description

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

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

Parameters

TInt aTwipWidth

Return value

TInt


VerticalTwipsToPixels(TInt)const

IMPORT_C virtual TInt VerticalTwipsToPixels(TInt aTwipHeight) const;

Description

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

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

Parameters

TInt aTwipHeight

Return value

TInt


HorizontalPixelsToTwips(TInt)const

IMPORT_C virtual TInt HorizontalPixelsToTwips(TInt aPixelWidth) const;

Description

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

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

Parameters

TInt aPixelWidth

Return value

TInt


VerticalPixelsToTwips(TInt)const

IMPORT_C virtual TInt VerticalPixelsToTwips(TInt aPixelHeight) const;

Description

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

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

Parameters

TInt aPixelHeight

Return value

TInt


GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)

IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec);

Description

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 *&aFont

On return, contains a pointer to the nearest font.

const TFontSpec &aFontSpec

The specification of the font to be matched.

Return value

TInt

KErrNone if successful; a system-wide error code otherwise.


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

IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);

Description

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 *&aFont

On return, contains a pointer to the nearest font.

const TFontSpec &aFontSpec

The specification of the font to be matched.

TInt aMaxHeight

The 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.

Return value

TInt

KErrNone if successful; a system-wide error code otherwise.


ReleaseFont(CFont *)

IMPORT_C virtual void ReleaseFont(CFont *aFont);

Description

Releases the specified font.

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

Parameters

CFont *aFont

A pointer to the font to be released.

[Top]


Member enumerations


Enum anonymous

n/a

Description

One to one zoom factor.

EZoomOneToOne