CAlfFlowLayout Class Reference

class CAlfFlowLayout : public CAlfLayout

Flow layout positions children next to each other either horizontally or vertically. The sizes of child visuals are not changed by default.

The layout inner padding is used to determine the gap between children.

Flow layout takes system wide layout mirroring into consideration by querying the mirroring state through AknLayoutUtils::LayoutMirrored() . In western locales the visuals are layed out from left to right whereas in arabic locale for instance the visuals are layed out from right to left. Mirroring is considered only when the flow is horizontal. Vertical flow layout will always lay visuals from top to bottom. Usage:
        //create flowlayout
  CAlfFlowLayout* flowLayout = CAlfFlowLayout::AddNewL( control );
  //Add two child text visuals to flow layout
  CAlfTextVisual* text1 = CAlfTextVisual::AddNewL( control, flowLayout );
  CAlfTextVisual* text2 = CAlfTextVisual::AddNewL( control, flowLayout );
  text1->SetTextL( _L"Text1" );
  text2->SetTextL( _L"Text2" );
 
  //set Flow direction
  flowLayout->SetFlowDirection( CAlfFlowLayout::EFlowHorizontal );
  flowLayout->UpdateChildrenLayout( 1 );
 
  // Set Centring
  flowLayout->SetCentering( ETrue );
  flowLayout->UpdateChildrenLayout(transitionTimeInMilliSeconds);
 
 //Set flow mode
  flowLayout->SetMode( CAlfFlowLayout::EModeFitPerpendicular );
  flowLayout->UpdateChildrenLayout( 1 );
       
alfclient.lib
Since
S60 v3.2

Nested Classes and Structures

Public Member Functions
CAlfFlowLayout ()
~CAlfFlowLayout ()
IMPORT_C CAlfFlowLayout * AddNewL ( CAlfControl &, CAlfLayout *)
IMPORT_C TAlfXYMetric BaseUnit ()
IMPORT_C void ConstructL ( CAlfControl &)
IMPORT_C CAlfVisual * FindTag (const TDesC8 &)
IMPORT_C TInt Mode ()
IMPORT_C void RemoveAndDestroyAllD ()
IMPORT_C void SetCentering ( TBool )
IMPORT_C void SetFlowDirection ( TFlowDirection )
IMPORT_C void SetMode ( TInt )
IMPORT_C void UpdateChildrenLayout ( TInt )
Protected Member Functions
IMPORT_C void DoRemoveAndDestroyAllD ()
IMPORT_C void PropertyOwnerExtension (const TUid &, TAny **)
Inherited Functions
CAlfLayout::Append(CAlfVisual *,TBool,TInt)
CAlfLayout::CAlfLayout()
CAlfLayout::ChildOrdinal(TInt)
CAlfLayout::ChildPos(TInt,TPoint &)
CAlfLayout::ChildSize(TInt,TSize &)
CAlfLayout::Count()const
CAlfLayout::EffectiveLayoutOrdinal(const CAlfVisual &)const
CAlfLayout::EnableScrollingL(TBool)
CAlfLayout::FindVisual(CAlfVisual *)const
CAlfLayout::HorizontalInnerPadding()const
CAlfLayout::InnerPadding()const
CAlfLayout::InnerPaddingAsMetric()const
CAlfLayout::InnerPaddingInBaseUnits()const
CAlfLayout::Insert(CAlfVisual *,TInt)
CAlfLayout::MoveVisualToBack(CAlfVisual &,TInt)
CAlfLayout::MoveVisualToFront(CAlfVisual &,TInt)
CAlfLayout::Remove(CAlfVisual *,TInt)
CAlfLayout::Reorder(CAlfVisual &,TInt,TInt)
CAlfLayout::ScrollOffset()const
CAlfLayout::Scrolling()const
CAlfLayout::SetBaseUnit(const TAlfMetric &)
CAlfLayout::SetBaseUnit(const TAlfXYMetric &)
CAlfLayout::SetInnerPadding(const TAlfXYMetric &)
CAlfLayout::SetInnerPadding(const TPoint &)
CAlfLayout::SetScrollOffset(const TAlfTimedPoint &)
CAlfLayout::SetTransitionTime(TInt)
CAlfLayout::TransitionTime()const
CAlfLayout::VerticalInnerPadding()const
CAlfLayout::VirtualSize()const
CAlfLayout::Visual(TInt)const
CAlfLayout::~CAlfLayout()
CAlfPropertyOwner::CAlfPropertyOwner()
CAlfPropertyOwner::CopyProperty(const CAlfPropertyOwner &,const TDesC8 &)
CAlfPropertyOwner::PropertyClear()
CAlfPropertyOwner::PropertyFindInteger(const TDesC8 &,TInt *)const
CAlfPropertyOwner::PropertyFindString(const TDesC8 &,TDesC **)const
CAlfPropertyOwner::PropertyRemove(const TDesC8 &)
CAlfPropertyOwner::PropertySetIntegerL(const TDesC8 &,TInt,TInt,TInt)
CAlfPropertyOwner::PropertySetStringL(const TDesC8 &,const TDesC &)
CAlfPropertyOwner::~CAlfPropertyOwner()
CAlfVisual::AlignByOrigin(TAlfRealRect &)const
CAlfVisual::Brushes()
CAlfVisual::CAlfVisual()
CAlfVisual::ClearFlag(TAlfVisualFlags)
CAlfVisual::ClearFlags(TUint)
CAlfVisual::Clipping()const
CAlfVisual::Comms()const
CAlfVisual::ConstructL(CAlfControl &,TInt,TInt,const TDesC8 &)
CAlfVisual::CopyValues(const CAlfVisual &,TInt,TInt)
CAlfVisual::DepthOffset()const
CAlfVisual::Display()const
CAlfVisual::DisplayRect()const
CAlfVisual::DisplayRectTarget()const
CAlfVisual::DisplayToLocal(const TAlfRealPoint &)const
CAlfVisual::DisplayToLocal(const TPoint &)const
CAlfVisual::DropShadowHandler()const
CAlfVisual::EffectiveOpacity()const
CAlfVisual::EnableBrushesL(TBool)
CAlfVisual::EnableDropShadowL(TBool)
CAlfVisual::EnableTransformationL(TBool)
CAlfVisual::Env()const
CAlfVisual::Flags()const
CAlfVisual::HasTactileFeedback(TInt)const
CAlfVisual::HorizontalOrigin()const
CAlfVisual::HorizontalPadding()const
CAlfVisual::Identifier()const
CAlfVisual::IsTagged()const
CAlfVisual::Layout()const
CAlfVisual::LocalToDisplay(const TAlfRealPoint &)const
CAlfVisual::LocalToDisplay(const TPoint &)const
CAlfVisual::MaxSize()const
CAlfVisual::MaxSizeInBaseUnits()const
CAlfVisual::Mimic(CAlfVisual &,TInt)
CAlfVisual::MinSize()const
CAlfVisual::MinSizeInBaseUnits()const
CAlfVisual::Move(const TAlfRealPoint &,TInt)
CAlfVisual::Move(const TPoint &,TInt)
CAlfVisual::MoveToFront(TInt)
CAlfVisual::Opacity()const
CAlfVisual::Owner()const
CAlfVisual::Padding()const
CAlfVisual::PaddingAsMetric()const
CAlfVisual::PaddingInPixels()const
CAlfVisual::Pause(TInt)
CAlfVisual::Pos()const
CAlfVisual::RemoveTactileFeedback(TInt)
CAlfVisual::Resume(TInt)
CAlfVisual::SetCenteredPosAndSize(const TAlfRealPoint &,const TAlfRealSize &,TInt)
CAlfVisual::SetCenteredPosAndSize(const TPoint &,const TSize &,TInt)
CAlfVisual::SetClipping(TBool)
CAlfVisual::SetDepthOffset(const TAlfTimedValue &)
CAlfVisual::SetDisplay(CAlfDisplay *)
CAlfVisual::SetEffectL(const TDesC &)
CAlfVisual::SetFlag(TAlfVisualFlags)
CAlfVisual::SetFlags(TUint)
CAlfVisual::SetGroupEffectL(const TDesC &,TInt)
CAlfVisual::SetLayout(CAlfLayout *)
CAlfVisual::SetMaxSize(const TAlfRealSize &)
CAlfVisual::SetMaxSize(const TSize &)
CAlfVisual::SetMinSize(const TAlfRealSize &)
CAlfVisual::SetMinSize(const TSize &)
CAlfVisual::SetOpacity(const TAlfTimedValue &)
CAlfVisual::SetOrigin(TAlfVisualHOrigin,TAlfVisualVOrigin)
CAlfVisual::SetOwner(CAlfControl &)
CAlfVisual::SetPadding(TInt)
CAlfVisual::SetPadding(const TAlfBoxMetric &)
CAlfVisual::SetPadding(const TPoint &)
CAlfVisual::SetPos(const TAlfRealPoint &,TInt)
CAlfVisual::SetPos(const TAlfTimedPoint &)
CAlfVisual::SetRect(const TAlfRealRect &,TInt)
CAlfVisual::SetSize(const TAlfRealSize &,TInt)
CAlfVisual::SetSize(const TAlfTimedPoint &)
CAlfVisual::SetTactileFeedbackL(TInt,TInt)
CAlfVisual::SetTagL(const TDesC8 &)
CAlfVisual::Size()const
CAlfVisual::Tag()const
CAlfVisual::TagMatches(const TDesC8 &)const
CAlfVisual::Transformation()
CAlfVisual::VerticalOrigin()const
CAlfVisual::VerticalPadding()const
CAlfVisual::~CAlfVisual()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TFlowDirection { EFlowHorizontal  = 0, EFlowVertical }
enum TMode { EModeCenterPerpendicular  = 0x1, EModeFitPerpendicular  = 0x2 }
Inherited Enumerations
CAlfLayout:TExpansionFlags
Private Attributes
TFlowLayoutPrivateData * iFlowLayoutData

Constructor & Destructor Documentation

CAlfFlowLayout()

IMPORT_C CAlfFlowLayout ( )

Constructor.

~CAlfFlowLayout()

IMPORT_C ~CAlfFlowLayout ( ) [virtual]

Destructor.

Member Functions Documentation

AddNewL(CAlfControl &, CAlfLayout *)

IMPORT_C CAlfFlowLayout * AddNewL ( CAlfControl & aOwnerControl,
CAlfLayout * aParentLayout = 0
) [static]

Two-phased constructor, which attach new object into the control.

Parameters

CAlfControl & aOwnerControl Control that owns this new obejct.
CAlfLayout * aParentLayout = 0 If given, the new object is set as child.

BaseUnit()

IMPORT_C TAlfXYMetric BaseUnit ( ) const [virtual]

ConstructL(CAlfControl &)

IMPORT_C void ConstructL ( CAlfControl & aOwner ) [virtual]

Second-phase constructor.

Parameters

CAlfControl & aOwner

DoRemoveAndDestroyAllD()

IMPORT_C void DoRemoveAndDestroyAllD ( ) [protected, virtual]

FindTag(const TDesC8 &)

IMPORT_C CAlfVisual * FindTag ( const TDesC8 & aTag ) [virtual]

CAlfVisual Finds a visual whose tag descriptor contains a specific tag.

CAlfLayout::FindTag() extends the search into child visuals, covering recursively entire visual hierarchies.

Todo: how should several visuals with matching tag to be handled ??

CAlfVisual::Tag() CAlfVisual::SetTagL() CAlfVisual::IsTagged() CAlfVisual::FindTag()

Parameters

const TDesC8 & aTag Tag to look for. If this tag is found as a part of a visual's colon-separated tag descriptor, it is treated as a match and the visual is returned. The tag to look for cannot contain separator characters (:).

Mode()

IMPORT_C TInt Mode ( ) const

Returns the mode flags of the flow.

CAlfFlowLayout::TMode

PropertyOwnerExtension(const TUid &, TAny **)

IMPORT_C void PropertyOwnerExtension ( const TUid & aExtensionUid,
TAny ** aExtensionParams
) [protected, virtual]

! future proofing

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

RemoveAndDestroyAllD()

IMPORT_C void RemoveAndDestroyAllD ( ) [virtual]

SetCentering(TBool)

IMPORT_C void SetCentering ( TBool aCentering )

Sets the centering mode of the flow. This sets/clears the EModeCenterPerpendicular flag. Calling this is equivalent to calling SetMode() with that flag included or missing from the mode.

Parameters

TBool aCentering ETrue to set the EModeCenterPerpendicular mode. EFalse to clear it.

SetFlowDirection(TFlowDirection)

IMPORT_C void SetFlowDirection ( TFlowDirection aDirection )

Sets the direction of the flow.

Parameters

TFlowDirection aDirection Flow direction.

SetMode(TInt)

IMPORT_C void SetMode ( TInt aMode )

Sets the mode of the flow. The mode flags determine how the flow layout behaves.

CAlfFlowLayout::TMode

Parameters

TInt aMode Mode flags (OR'd together).

UpdateChildrenLayout(TInt)

IMPORT_C void UpdateChildrenLayout ( TInt aTransitionTime = 0 ) [virtual]

CAlfVisual Update the layout of all children. Subclasses can call this to recalculate the layout of all children.

Parameters

TInt aTransitionTime = 0 Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime()

Member Enumerations Documentation

Enum TFlowDirection

Flow directions.

Enumerators

EFlowHorizontal = 0

Flow horizontally. System wide layout mirroring is considered to determine whether visuals are layed from left to right or from right to left. AknLayoutUtils::LayoutMirrored()

EFlowVertical

Flow vertically.

Enum TMode

Mode flags that specify how the flow is laid out.

Enumerators

EModeCenterPerpendicular = 0x1

Center the children perpendicular to the flow direction. For example, if the flow direction is horizontal (left->right) this flag will center the children vertically along the flow.

EModeFitPerpendicular = 0x2

Fit the children perpendicular to the flow direction. For example, if the flow direction is horizontal, the children will be vertically resized to fit the layout's rectangle.

Member Data Documentation

TFlowLayoutPrivateData * iFlowLayoutData

TFlowLayoutPrivateData * iFlowLayoutData [private]