Alf::IAlfLayoutPreferences Class Reference

class Alf::IAlfLayoutPreferences : public Alf::IAlfInterfaceBase

The interface for finding the layout preferences for an Alf widget model presentation object.

This interface is called by layout managers (implementors of IAlfLayoutManager ) in order to find out information about their contained presentation objects.

It is implemented by presentation objects in order to report to the layout manager what sizes objects prefer.

The layout manager is responsible for finding out layout preferences for all the AlfElement instances in the next level down of containment - the "child" elements. It calls makeInterface<IAlfLayoutPreferences> on these elements. The layout manager uses its knowledge about how these child elements relate to each other geometrically to come up with a decision on how many child elements can be shown, where they are to be positioned, and how big they should be. IAlfLayoutManager AlfElements that represent contained sets of visuals - those that take up space within the visual containment - should implement IAlfLayoutPreferences , or defer its implementation to another presentation object which is capable of reporting layout preferences.

The following units are allowed to be used in the returned parameter values: EAlfUnitPixel - pixels EAlfUnitDisplaySize - units relative to the display EAlfS60Unit - S60 layout specification units

Other units do not make sense, since the metric is being passed to a different layout context. Furthermore, the reason for this API is for the implementing object to state its own, internal, preferences without recourse to its containment. This implies the use of the more absolute units.

The units used for the returned TAlfXYMetric objects are chosen independently by the implementations of each API. They do not have to be return the same units.

alfwidgetmodel.lib
Since
S60 ?S60_version Draft

Inherits from

Member Functions Documentation

getMaximumSize(TAlfXYMetric &)

bool getMaximumSize ( TAlfXYMetric & aMaxSize ) const [pure virtual]

Return the maximum size desired by a presentation object.

There may often be no preference as to maximum size. The implementation should then return false.

Parameters

TAlfXYMetric & aMaxSize The maximum size that the object would like to be laid out to

getMinimumSize(TAlfXYMetric &)

bool getMinimumSize ( TAlfXYMetric & aMinSize ) const [pure virtual]

Return the minimum desirable size of a presentation object.

Minimum size should mean the size at which the visual would start to become unreadable in the case of text, or too difficult to see with sufficient clarity in the case of graphics.

false is to be returned if the implementing presentation object does not care how small it is made.

Parameters

TAlfXYMetric & aMinSize The minimum size that the object would like to be laid out to

getPreferredSize(TAlfXYMetric &)

bool getPreferredSize ( TAlfXYMetric & aPreferredSize ) const [pure virtual]

Return the preferred size for a presentation object.

The preferred size is the optimum size of the object in the absence of external factors.

The value returned should greater than or equal in size to a value returned by getMinimumSize()

The value returned should less than or equal in size to a value returned by getMaximumSize()

Parameters

TAlfXYMetric & aPreferredSize The size that the object would like to be laid out to

setPreferredSize(const TAlfXYMetric &)

void setPreferredSize ( const TAlfXYMetric & aPreferredSize ) [pure virtual]

Set the preferred size into a presentation object.

The preferred size is being dictated by external code in this case. This new value should over-ride any internal preferred size.

Calling this API has several side-effects. Subsequent calls to getPreferredSize should return true and return the new preferred size.

Subsequent calls to getMinimumSize must return either false , or return true with a value less than or equal to the preferred size.

Subsequent calls to getMaximumSize must return either false , or return true with a value greater than or equal to the preferred size.

Parameters

const TAlfXYMetric & aPreferredSize The new preferred size for the laid-out object

type()

const IfId & type ( ) [static, inline]