MCoeLayoutManager Class Reference

#include <mw/coelayoutman.h>

Link against: cone.lib

class MCoeLayoutManager
Public Member Functions
pure virtual voidAttachL(CCoeControl &)
pure virtual TSize CalcMinimumSize(const CCoeControl &)
pure virtual TInt CalcTextBaselineOffset(const CCoeControl &, const TSize &)
pure virtual TBool CanAttach()
pure virtual voidDetach(CCoeControl &)
pure virtual voidHandleAddedControlL(const CCoeControl &, const CCoeControl &)
pure virtual TInt HandleControlReplaced(const CCoeControl &, const CCoeControl &)
pure virtual voidHandleRemovedControl(const CCoeControl &, const CCoeControl &)
pure virtual voidPerformLayout()
pure virtual voidSetTextBaselineSpacing(TInt)
pure virtual TInt TextBaselineSpacing()
Protected Member Functions
MCoeLayoutManager()

Detailed Description

Base class for layout managers.

A layout manager can be attached to one, or many (depending on the concrete layout manager), compound controls. The layout manager handles the layout of the components of the attached compound controls, and calculates the attached compound controls' minimum size.

Constructor & Destructor Documentation

MCoeLayoutManager ( )

IMPORT_CMCoeLayoutManager()[protected]

Member Function Documentation

AttachL ( CCoeControl & )

voidAttachL(CCoeControl &aCompoundControl)[pure virtual]

Attaches aCompoundControl to the layout manager. Is normally not called manually since CCoeControl::SetLayoutManagerL() calls this function. Once a compound control is attached to a layout manager, the layout manager owns itself.

See also: Detach() CCoeControl::SetLayoutManagerL()

ParameterDescription
aCompoundControlThe compound control.

CalcMinimumSize ( const CCoeControl & )

TSize CalcMinimumSize(const CCoeControl &aCompoundControl)const [pure virtual]

Calculates the minimum size of aCompoundControl Is normally not called manually since CCoeControl::MinimumSize() calls this function in the default implementation on controls with layout managers.

To calculate the minimum size is almost as time consuming as performing an actual layout and should be used with caution. The minimum size depends on aCompoundControl's maximum width.

See also: CCoeControl::MaximumWidth()

ParameterDescription
aCompoundControlThe compound control

Returns: The minimum size

CalcTextBaselineOffset ( const CCoeControl &, const TSize & )

TInt CalcTextBaselineOffset(const CCoeControl &aCompoundControl,
const TSize &aSize
)const [pure virtual]

Gets the offset to the first text baseline relative to the top of the control.

See also: CCoeControl::TextBaselineOffset()

ParameterDescription
aCompoundControlThe control
aSizeThe size of the control

Returns: The baseline

CanAttach ( )

TBool CanAttach()const [pure virtual]

Determines if it is possible to attach another control to the layout manager.

Returns: ETrue if possible, otherwise EFalse

Detach ( CCoeControl & )

voidDetach(CCoeControl &aCompoundControl)[pure virtual]

Detaches aCompoundControl from the layout manager. Is normally not called manually since CCoeControl::SetLayoutManagerL() calls this function when you switch layout managers on a control. It is also called from CCoeControl::~CCoeControl When the last attached compound control detaches, the layout manager deletes itself.

See also: CCoeControl::SetLayoutManagerL()

ParameterDescription
aCompoundControlThe compound control.

HandleAddedControlL ( const CCoeControl &, const CCoeControl & )

voidHandleAddedControlL(const CCoeControl &aCompoundControl,
const CCoeControl &aAddedControl
)[pure virtual]

Handles when a component control is added to an attached compound control Is normally not called manually since CCoeControlArray::InsertLC() calls this function for controls with layout managers. Is used by layout managers to prepare to layout one more component control.

See also: CCoeControlArray::InsertLC()

ParameterDescription
aCompoundControlThe compound control.
aAddedControlThe added control

HandleControlReplaced ( const CCoeControl &, const CCoeControl & )

TInt HandleControlReplaced(const CCoeControl &aOldControl,
const CCoeControl &aNewControl
)[pure virtual]

Handles when a component control is replaced by another component control in an attached compound control

Is not called by CCoeControl. Is used by layout managers to move settings and similar that are specified for aOldControl to aNewControl If this function is called, neither HandleAddedControlL nor HandleRemovedControl is allowed to be called.

ParameterDescription
aOldControlThe old component control
aNewControlThe new component control

Returns: KErrNone if no error. KErrNotFound if the layout manager cannot find aOldControl

HandleRemovedControl ( const CCoeControl &, const CCoeControl & )

voidHandleRemovedControl(const CCoeControl &aCompoundControl,
const CCoeControl &aRemovedControl
)[pure virtual]

Handles when a component control is removed from an attached compound control Is normally not called manually since CCoeControlArray::Remove() calls this function for controls with layout managers. Is used by layout managers to remove all settings and similar that are specific for aRemovedControl.

See also: CCoeControlArray::Remove()

ParameterDescription
aCompoundControlThe compound control.
aRemovedControlThe removed control

PerformLayout ( )

voidPerformLayout()[pure virtual]

Performs the layout of the attached controls Is normally not called manually since CCoeControl::SizeChanged() calls this function in the default implementation on controls with layout managers.

The layout is generally performed by calling the component controls' SetMaximumWidth(), followed by MinimumSize(), and then the layout manager tries to place the component controls according to their minimum sizes and the settings.

See also: CCoeControl::SetMaximumWidth() CCoeControl::MinimumSize()

SetTextBaselineSpacing ( TInt )

voidSetTextBaselineSpacing(TIntaBaselineSpacing)[pure virtual]

Sets the spacing between text baselines.

See also: CCoeControl::SetTextBaseLineSpacing()

ParameterDescription
aBaselineSpacingThe new value for the baseline

TextBaselineSpacing ( )

TInt TextBaselineSpacing()const [pure virtual]

Returns the baseline spacing.

Returns: The baseline value.