|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
The interface for mapping between twips and device-specific units enriched with facilities to allow zooming. More...
#include <gdi.h>
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. | |
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.
| anonymous enum |
| 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)
| IMPORT_C TZoomFactor::~TZoomFactor | ( | ) |
Destructor.
Frees resources owned by the object, prior to its destruction.
(generated from Symbian Developer Library)
|
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.
| aDevice | The graphics device map with which the zoom factor is associated. |
(generated from Symbian Developer Library)
|
inline |
|
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
| aFont | On return, contains a pointer to the nearest font. |
| aFontSpec | The specification of the font to be matched. |
(generated from Symbian Developer Library)
Implements MGraphicsDeviceMap.
|
virtual |
| aFont | On return, contains a pointer to the nearest font. |
| aFontSpec | The specification of the font to be matched. |
(generated from Symbian Developer Library)
Reimplemented from MGraphicsDeviceMap.
|
virtual |
| 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. |
(generated from Symbian Developer Library)
Reimplemented from MGraphicsDeviceMap.
|
inline |
Gets the graphics device map of this zoom factor object.
(generated from Symbian Developer Library)
|
virtual |
Converts a horizontal dimension from pixels to twips.
An implementation is supplied by a derived class.
| aPixels | A horizontal dimension of a device in pixels. |
Implements MGraphicsDeviceMap.
|
virtual |
Converts a horizontal dimension from twips to pixels.
An implementation is supplied by a derived class.
| aTwips | A horizontal dimension of a device in twips. |
Implements MGraphicsDeviceMap.
|
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.
| aFont | A pointer to the font to be released. |
Implements MGraphicsDeviceMap.
|
inline |
Sets the graphics device map for this zoom factor object.
| aDevice | The graphics device map for this TZoomFactor. |
(generated from Symbian Developer Library)
| 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.
| aSizeInPixels | The size of the graphics device area in pixels. |
| aSizeInTwips | The size of the graphics device area in twips. |
(generated from Symbian Developer Library)
| IMPORT_C void TZoomFactor::SetZoomFactor | ( | TInt | aZoomFactor | ) |
Sets the zoom factor.
| aZoomFactor | The desired zoom factor. |
(generated from Symbian Developer Library)
|
virtual |
Converts a vertical dimension from pixels to twips.
An implementation is supplied by a derived class.
| aPixels | A vertical dimension of a device in pixels. |
Implements MGraphicsDeviceMap.
|
virtual |
Converts a vertical dimension from twips to pixels.
An implementation is supplied by a derived class.
| aTwips | A vertical dimension of a device in twips. |
Implements MGraphicsDeviceMap.
| IMPORT_C TInt TZoomFactor::ZoomFactor | ( | ) | const |
Gets the zoom factor.
(generated from Symbian Developer Library)