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

The interface for mapping between twips and device-specific units enriched with facilities to allow zooming. More...

#include <gdi.h>

Inheritance diagram for TZoomFactor:
MGraphicsDeviceMap

Public Types

enum  { EZoomOneToOne =1000 }
 One to one zoom factor. More...
 

Public Member Functions

IMPORT_C TZoomFactor ()
 Constructs a default zoom factor object.
 
IMPORT_C ~TZoomFactor ()
 Destructor.
 
 TZoomFactor (const MGraphicsDeviceMap *aDevice)
 Constructs a zoom factor object for a specific graphics device map.
 
 TZoomFactor (const TZoomFactor *aDevice)
 
IMPORT_C TInt ZoomFactor () const
 Gets the zoom factor.
 
IMPORT_C void SetZoomFactor (TInt aZoomFactor)
 Sets the zoom factor.
 
void SetGraphicsDeviceMap (const MGraphicsDeviceMap *aDevice)
 Sets the graphics device map for this zoom factor object.
 
const MGraphicsDeviceMap * GraphicsDeviceMap () const
 Gets the graphics device map of this zoom factor object.
 
IMPORT_C void SetTwipToPixelMapping (const TSize &aSizeInPixels, const TSize &aSizeInTwips)
 Sets the twips to pixels mapping for the graphics device with which the zoom factor is associated.
 
IMPORT_C TInt HorizontalTwipsToPixels (TInt aTwipWidth) const
 Converts a horizontal dimension from twips to pixels.
 
IMPORT_C TInt VerticalTwipsToPixels (TInt aTwipHeight) const
 Converts a vertical dimension from twips to pixels.
 
IMPORT_C TInt HorizontalPixelsToTwips (TInt aPixelWidth) const
 Converts a horizontal dimension from pixels to twips.
 
IMPORT_C TInt VerticalPixelsToTwips (TInt aPixelHeight) const
 Converts a vertical dimension from pixels to twips.
 
IMPORT_C TInt GetNearestFontInTwips (CFont *&aFont, const TFontSpec &aFontSpec)
 
IMPORT_C TInt GetNearestFontToDesignHeightInTwips (CFont *&aFont, const TFontSpec &aFontSpec)
 
IMPORT_C TInt GetNearestFontToMaxHeightInTwips (CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight)
 
IMPORT_C void ReleaseFont (CFont *aFont)
 Releases the specified font.
 
- 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.
 

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

API status
Published to all clients. Released API.

Definition at line 4307 of file gdi.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

One to one zoom factor.


Enumerator
EZoomOneToOne 

Definition at line 4330 of file gdi.h.

Constructor & Destructor Documentation

◆ TZoomFactor() [1/3]

IMPORT_C TZoomFactor::TZoomFactor ( )

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.

(generated from Symbian Developer Library)

◆ ~TZoomFactor()

IMPORT_C TZoomFactor::~TZoomFactor ( )

Destructor.

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

(generated from Symbian Developer Library)

◆ TZoomFactor() [2/3]

TZoomFactor::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
aDeviceThe graphics device map with which the zoom factor is associated.

(generated from Symbian Developer Library)

◆ TZoomFactor() [3/3]

TZoomFactor::TZoomFactor ( const TZoomFactor *  aDevice)
inline

Member Function Documentation

◆ GetNearestFontInTwips()

IMPORT_C TInt TZoomFactor::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 @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)

Implements MGraphicsDeviceMap.

◆ GetNearestFontToDesignHeightInTwips()

IMPORT_C TInt TZoomFactor::GetNearestFontToDesignHeightInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec 
)
virtual
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.

(generated from Symbian Developer Library)

Reimplemented from MGraphicsDeviceMap.

◆ GetNearestFontToMaxHeightInTwips()

IMPORT_C TInt TZoomFactor::GetNearestFontToMaxHeightInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec,
TInt  aMaxHeight 
)
virtual
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.
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.

(generated from Symbian Developer Library)

Reimplemented from MGraphicsDeviceMap.

◆ GraphicsDeviceMap()

const MGraphicsDeviceMap * TZoomFactor::GraphicsDeviceMap ( ) const
inline

Gets the graphics device map of this zoom factor object.

(generated from Symbian Developer Library)

◆ HorizontalPixelsToTwips()

IMPORT_C TInt TZoomFactor::HorizontalPixelsToTwips ( TInt  aPixels) const
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.

Implements MGraphicsDeviceMap.

◆ HorizontalTwipsToPixels()

IMPORT_C TInt TZoomFactor::HorizontalTwipsToPixels ( TInt  aTwips) const
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.

Implements MGraphicsDeviceMap.

◆ ReleaseFont()

IMPORT_C void TZoomFactor::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.

Parameters
aFontA pointer to the font to be released.

Implements MGraphicsDeviceMap.

◆ SetGraphicsDeviceMap()

void TZoomFactor::SetGraphicsDeviceMap ( const MGraphicsDeviceMap *  aDevice)
inline

Sets the graphics device map for this zoom factor object.

Parameters
aDeviceThe graphics device map for this TZoomFactor.

(generated from Symbian Developer Library)

◆ SetTwipToPixelMapping()

IMPORT_C void TZoomFactor::SetTwipToPixelMapping ( 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
aSizeInPixelsThe size of the graphics device area in pixels.
aSizeInTwipsThe size of the graphics device area in twips.

(generated from Symbian Developer Library)

◆ SetZoomFactor()

IMPORT_C void TZoomFactor::SetZoomFactor ( TInt  aZoomFactor)

Sets the zoom factor.

Parameters
aZoomFactorThe desired zoom factor.

(generated from Symbian Developer Library)

◆ VerticalPixelsToTwips()

IMPORT_C TInt TZoomFactor::VerticalPixelsToTwips ( TInt  aPixels) const
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.

Implements MGraphicsDeviceMap.

◆ VerticalTwipsToPixels()

IMPORT_C TInt TZoomFactor::VerticalTwipsToPixels ( TInt  aTwips) const
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.

Implements MGraphicsDeviceMap.

◆ ZoomFactor()

IMPORT_C TInt TZoomFactor::ZoomFactor ( ) const

Gets the zoom factor.

(generated from Symbian Developer Library)


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