Alf::IAlfLayoutManager Class Reference

class Alf::IAlfLayoutManager : public Alf::IAlfInterfaceBase

The interface for layout managers

Layout manager handles the layouting of child widgets in the container widget. It uses IAlfLayoutPreferences-interface (IAlfLayoutPreferences) of child widgets as a guide for laying out the widgets. The layoutmanager is set to the IAlfHostApi- interface (IAlfHostApi::setBaseLayout) createLayout-method should be the first call after creating the layoutmanager.Layout manager may also provide information about the layout preferences of its children. If this is supported the layout manager will combine the layout preferences of its children taking into consideration the technique used to lay out the children using the layout manager. This will provide information about the whole display area occupied by the layout manager. For instance vertical flow layout manager will provide preferred size area of its children by summing their heights and providing the maximum width among the children.

 // Create layout manager interface.
 IAlfLayoutManager* layoutManager = IAlfInterfaceBase::makeInterface<IAlfLayoutManager>(control);

 // See if layout preferences is supported in the given layout manager.
 IAlfLayoutPreferences* layoutPreferences = IAlfInterfaceBase::makeInterface<IAlfLayoutPreferences>(layoutManager);

 if(layoutPreferences != 0)
     {
     TAlfXYMetric preferredSize;
     // This will report the preferred size of the layout by combining together preferred sizes of its children.
     bool result = layoutPreferences->getPreferredSize(preferredSize);
     }
alfwidgetmodel.lib
Since
S60 ?S60_version Draft

Inherits from

Constructor & Destructor Documentation

~IAlfLayoutManager()

~IAlfLayoutManager()[inline, virtual]

Member Functions Documentation

childRemoved(CAlfWidgetControl *)

voidchildRemoved(CAlfWidgetControl *aControl)[pure virtual]

Notifies the layout manager, that the control's has been removed from the layout.

Exceptions
AlfVisualException(EInvalidVisual)if

layout is not created.

Parameters

CAlfWidgetControl * aControlcontrol, which has been removed from the layout.

createLayout(CAlfWidgetControl &, CAlfLayout *, int)

voidcreateLayout(CAlfWidgetControl &aOwner,
CAlfLayout *aParentLayout,
intaLayoutIndex
)[pure virtual]

Creates the layout used by this layoutmanager.

Exceptions
AlfVisualException(EInvalidArrayIndex)if

aLayoutIndex is out of bounds AlfVisualException(ECanNotCreateVisual), if the layout creation failed.

Parameters

CAlfWidgetControl & aOwnerowner-control of the the created layout.
CAlfLayout * aParentLayoutparent for the created layout
int aLayoutIndexindex, where created visual should be placed in the parent layout.

getLayout()

CAlfLayout &getLayout()const [pure virtual]

Returns the layout used by this layoutmanager.

Exceptions
AlfVisualException(EInvalidVisual)if

layout is not created.

makeInterface(const IfId &)

IAlfInterfaceBase *makeInterface(const IfId &aType)[pure virtual]
Interface getter. IAlfInterfaceBase::MakeInterface
Since
S60 ?S60_version

Parameters

const IfId & aTypeThe type id of the queried interface.

type()

const IfId &type()[static, inline]

updateChildLayout(CAlfWidgetControl *)

voidupdateChildLayout(CAlfWidgetControl *aControl)[pure virtual]

Notifies the layout manager, that the child control's layout must be updated

Exceptions
AlfVisualException(EInvalidVisual)if

layout is not created.

Parameters

CAlfWidgetControl * aControlcontrol, which size has changed.

updateChildrenLayout()

voidupdateChildrenLayout()[pure virtual]
Notifies the layout manager, that all the child control's layouts must be updated.
Exceptions
AlfVisualException(EInvalidVisual)if

layout is not created.