#include <gdi.h>
Link against: gdi.lib
class TZoomFactor : public MGraphicsDeviceMap |
Public Member Enumerations | |
---|---|
enum | anonymous { EZoomOneToOne } |
Public Member Functions | |
---|---|
TZoomFactor() | |
TZoomFactor(const MGraphicsDeviceMap *) | |
TZoomFactor(const TZoomFactor *) | |
~TZoomFactor() | |
virtual IMPORT_C TInt | GetNearestFontInTwips(CFont *&, const TFontSpec &) |
virtual IMPORT_C TInt | GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &) |
virtual IMPORT_C TInt | GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt) |
const MGraphicsDeviceMap * | GraphicsDeviceMap() |
virtual IMPORT_C TInt | HorizontalPixelsToTwips(TInt) |
virtual IMPORT_C TInt | HorizontalTwipsToPixels(TInt) |
virtual IMPORT_C void | ReleaseFont(CFont *) |
void | SetGraphicsDeviceMap(const MGraphicsDeviceMap *) |
IMPORT_C void | SetTwipToPixelMapping(const TSize &, const TSize &) |
IMPORT_C void | SetZoomFactor(TInt) |
virtual IMPORT_C TInt | VerticalPixelsToTwips(TInt) |
virtual IMPORT_C TInt | VerticalTwipsToPixels(TInt) |
IMPORT_C TInt | ZoomFactor() |
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.
IMPORT_C | 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.
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 | |
---|---|
aDevice | The graphics device map with which the zoom factor is associated. |
TZoomFactor | ( | const TZoomFactor * | aDevice | ) | [inline] |
IMPORT_C | ~TZoomFactor | ( | ) |
Destructor.
Frees resources owned by the object, prior to its destruction.
Reimplemented from MGraphicsDeviceMap::GetNearestFontInTwips(CFont *&,const TFontSpec &)
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
Reimplemented from MGraphicsDeviceMap::GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)
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 | |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [virtual] |
Reimplemented from MGraphicsDeviceMap::GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)
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 | |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
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. |
const MGraphicsDeviceMap * | GraphicsDeviceMap | ( | ) | const [inline] |
Gets the graphics device map of this zoom factor object.
Reimplemented from MGraphicsDeviceMap::HorizontalPixelsToTwips(TInt)const
Converts a horizontal dimension from pixels to twips on the graphics device.
This function implements the pure virtual function defined in MGraphicsDeviceMap::HorizontalPixelsToTwips()
Reimplemented from MGraphicsDeviceMap::HorizontalTwipsToPixels(TInt)const
Converts a horizontal dimension from twips to pixels on the graphics device.
This function implements the pure virtual function defined in MGraphicsDeviceMap::HorizontalTwipsToPixels()
IMPORT_C void | ReleaseFont | ( | CFont * | aFont | ) | [virtual] |
Reimplemented from MGraphicsDeviceMap::ReleaseFont(CFont *)
Releases the specified font.
This function implements the pure virtual function defined in MGraphicsDeviceMap::ReleaseFont()
Parameters | |
---|---|
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.
Parameters | |
---|---|
aDevice | The graphics device map for this TZoomFactor. |
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 | |
---|---|
aSizeInPixels | The size of the graphics device area in pixels. |
aSizeInTwips | The size of the graphics device area in twips. |
IMPORT_C void | SetZoomFactor | ( | TInt | aZoomFactor | ) |
Sets the zoom factor.
Parameters | |
---|---|
aZoomFactor | The desired zoom factor. |
Reimplemented from MGraphicsDeviceMap::VerticalPixelsToTwips(TInt)const
Converts a vertical dimension from pixels to twips on the graphics device.
This function implements the pure virtual function defined in MGraphicsDeviceMap::VerticalPixelsToTwips()
Reimplemented from MGraphicsDeviceMap::VerticalTwipsToPixels(TInt)const
Converts a vertical dimension from twips to pixels on the graphics device.
This function implements the pure virtual function defined in MGraphicsDeviceMap::VerticalTwipsToPixels()