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 *)

void childRemoved ( 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 * aControl control, which has been removed from the layout.

createLayout(CAlfWidgetControl &, CAlfLayout *, int)

void createLayout ( CAlfWidgetControl & aOwner,
CAlfLayout * aParentLayout,
int aLayoutIndex
) [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 & aOwner owner-control of the the created layout.
CAlfLayout * aParentLayout parent for the created layout
int aLayoutIndex index, 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 & aType The type id of the queried interface.

type()

const IfId & type ( ) [static, inline]

updateChildLayout(CAlfWidgetControl *)

void updateChildLayout ( 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 * aControl control, which size has changed.

updateChildrenLayout()

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

layout is not created.