CHuiLayout Class Reference

class CHuiLayout : public CHuiVisual

Layouts are visuals that manage the placement of a set of child visuals (or other layouts).

Layouts are responsible for setting the positions and sizes of their child visuals. Each layout can define a position, a size, or both (or neither) for their children.

Layouts use the children's ordinal numbers to determine where each of them should be placed. For example, a grid layout could define that the top row contains children with ordinals 0..3, from left to right. The second row could then contain the children 4..7. When the order of the child visuals changes within their parent layout, the parent layout will recalculate the positions and sizes of the affected children.

When the size of a layout changes, it will immediately recalculate the layout of its children. The transition time that is specified in the size transition of the layout is used when setting the targets of the children's new positions and sizes.

Layouts are able to notify their controls when their size is changed. These notifications are needed because the size of a layout is not known until the display is refreshed. This means that the size of a layout is not available when your controls ConstructL is executed, unless it is explicitly set. The notifications are also handy because they allow the controls to respond to dynamic screen size changes. So unless if the whole screen is not used for the layout, the notifications are the only way to do calculations based on the layout size.

To make the control receive layout update notifications call:

layout->SetFlags(EHuiVisualFlagLayoutUpdateNotification);

.. and override VisualLayoutUpdated() method in your control.

SetSize() SetFlags() CHuiControl::VisualLayoutUpdated()Each layout defines its own local coordinate system used for interpreting the positions and sizes of its child visuals. The base unit of the coordinate system is defined with the SetBaseUnit() method, which sets a THuiXYMetric to use as the basis for all coordinate calculations. The default metric is [1px, 1px] which corresponds to pixels on the display.

The local coordinate system of a layout can be mirrored horizontally and/or vertically by using a negative magnitude in the relevant THuiMetric of the base unit. Note that this will only affect the local coordinate system of the layout: the contents of the child visuals or child layouts will not be mirrored. Visual mirroring should be done with a CHuiTransformation, and child layouts can be mirrored by further application of the negative base unit metrics. In order to enable a layout to automatically mirror the horizontal component of the base unit based on locale mirroring, set the visual flag EHuiVisualFlagAutomaticLocaleMirroringEnabled, note that it is necessary to set this flag for each layout for which this feature is required.

To create to a fully scalable UI, the appropriate base unit metrics and layout visuals must be used. For example, the EHuiUnitS60 metric unit is dependent on the platform-specified measurement units for layout. CHuiGridLayout and CHuiAnchorLayout provide support for pixel-independent placement of their children.

CHuiAnchorLayout CHuiGridLayoutApplications that need more complex layouts should derive their own CHuiLayout based classes that implement the necessary layout calculations. In many cases, however, a combination of some of the built-in layout classes such as anchor and grid layouts will be sufficient.

Inherits from

Nested Classes and Structures

Public Member Functions
CHuiLayout(MHuiVisualOwner &)
~CHuiLayout()
IMPORT_C CHuiLayout *AddNewL(CHuiControl &, CHuiLayout *)
IMPORT_C voidAppendL(CHuiVisual *, TInt)
IMPORT_C THuiXYMetricBaseUnit()
THuiRealRectBoundingRect()
IMPORT_C TReal32BrushOpacity()
IMPORT_C THuiRealRectBrushRect()
IMPORT_C CHuiSkin &BrushSkin()
IMPORT_C TBoolChanged()
IMPORT_C TIntChildOrdinal(TInt)
IMPORT_C TBoolChildPos(TInt, TPoint &)
IMPORT_C TIntChildRect(TInt, THuiRealRect &)
IMPORT_C TBoolChildSize(TInt, TSize &)
IMPORT_C voidClearChanged()
IMPORT_C voidConstructL()
IMPORT_C TIntCount()
IMPORT_C voidDraw(CHuiGc &)
IMPORT_C voidDumpTree()
IMPORT_C TIntEffectiveLayoutOrdinal(const CHuiVisual &)
IMPORT_C voidEnableScrollingL(TBool)
IMPORT_C CHuiVisual *FindTag(const TDesC8 &)
IMPORT_C TIntFindVisual(const CHuiVisual *)
IMPORT_C voidGetClassName(TDes &)
IMPORT_C voidGetInstanceName(TDes &)
IMPORT_C TIntHorizontalInnerPadding()
IMPORT_C const THuiXYMetric &InnerPadding()
IMPORT_C THuiRealPointInnerPaddingInBaseUnits()
IMPORT_C THuiRealSizeInnerSize()
IMPORT_C THuiRealPointInnerTopLeft()
IMPORT_C voidInsertL(CHuiVisual *, TInt, TInt)
IMPORT_C voidMoveVisualToBack(CHuiVisual &, TInt)
IMPORT_C voidMoveVisualToFront(CHuiVisual &, TInt)
IMPORT_C voidNotifySkinChangedL()
IMPORT_C TBoolPrepareDrawL()
IMPORT_C voidRemove(CHuiVisual *, TInt)
IMPORT_C voidRemoveAndDestroyAllD()
IMPORT_C voidReorder(CHuiVisual &, TInt, TInt)
IMPORT_C voidReportChanged()
IMPORT_C THuiTimedPoint &ScrollOffset()
IMPORT_C const THuiTimedPoint &ScrollOffset()
IMPORT_C TBoolScrolling()
IMPORT_C TIntSessionId()
IMPORT_C voidSetBaseUnit(const THuiMetric &)
IMPORT_C voidSetBaseUnit(const THuiXYMetric &)
IMPORT_C voidSetInnerPadding(const TPoint &)
IMPORT_C voidSetInnerPadding(const THuiXYMetric &)
IMPORT_C voidSetPos(const THuiRealPoint &, TInt)
IMPORT_C voidSetScrollOffsetInBaseUnits(const THuiRealPoint &, TInt)
IMPORT_C voidSetSessionId(TInt)
IMPORT_C voidSetSize(const THuiRealSize &, TInt)
IMPORT_C voidSetTransitionTime(TInt)
IMPORT_C TIntTransitionTime()
IMPORT_C TTypeType()
IMPORT_C voidUpdateChildLayout(TInt, TInt)
IMPORT_C voidUpdateChildrenLayout(TInt)
IMPORT_C TIntVerticalInnerPadding()
IMPORT_C TSizeVirtualSize()
IMPORT_C CHuiVisual &Visual(TInt)
Protected Member Functions
IMPORT_C voidDrawSelf(CHuiGc &, const TRect &)
TBool EffectIsAppliedToChildren()
IMPORT_C voidExpandRectWithContent(TRect &)
IMPORT_C THuiRealPointMetricReferenceForLayoutInPixels(const CHuiLayout *, const THuiXYMetric &)
IMPORT_C THuiRealPointMetricReferenceForLayoutInPixels(const THuiXYMetric &)
IMPORT_C voidVisualExtension(const TUid &, TAny **)
Private Member Functions
voidDrawStoredBitmap(CHuiGc &)
TBool HasActiveChilderen()
Inherited Functions
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()
CHuiVisual::AlignByOrigin(THuiRealPoint &,TBool)const
CHuiVisual::ApplyMirroring(THuiRealPoint &,THuiReferenceState)const
CHuiVisual::BoxMetricToPixelRect(const THuiBoxMetric &,THuiRealRect &)const
CHuiVisual::BoxMetricToPixelRect(const THuiBoxMetric &,THuiRealRect &,THuiReferenceState)const
CHuiVisual::Brushes()
CHuiVisual::Brushes()const
CHuiVisual::CHuiVisual(MHuiVisualOwner &)
CHuiVisual::CachedDisplayRect()const
CHuiVisual::ClearFlag(THuiVisualFlags)
CHuiVisual::ClearFlags(TInt)
CHuiVisual::Clipping()const
CHuiVisual::ConvertMetricLengthToPixels(TReal32 &,const THuiMetric &,TReal32)
CHuiVisual::ConvertPixelsToMetricLength(THuiMetric &,TReal32,TReal32)
CHuiVisual::Display()const
CHuiVisual::DisplayRect()const
CHuiVisual::DisplayRectTarget()const
CHuiVisual::DisplayToLocal(const THuiRealPoint &)const
CHuiVisual::DisplayToLocal(const TPoint &)const
CHuiVisual::DrawBrushes(CHuiGc &,THuiBrushLayer)const
CHuiVisual::DropShadowHandler()const
CHuiVisual::Effect()const
CHuiVisual::Effectable()const
CHuiVisual::EffectiveOpacity()const
CHuiVisual::EnableBrushesL(TBool)
CHuiVisual::EnableDropShadowL(TBool)
CHuiVisual::EnableTransformationL(TBool)
CHuiVisual::EnterLocalProjection(CHuiGc &,TBool,TReal32,const THuiRealRect *)const
CHuiVisual::Env()const
CHuiVisual::FindTacticon(TInt)const
CHuiVisual::Flags()const
CHuiVisual::Freezed()const
CHuiVisual::GetDualAlpha(TReal32,TReal32,TInt &,TInt &)
CHuiVisual::HasTactileFeedback(TInt)const
CHuiVisual::HorizontalOrigin()const
CHuiVisual::IsDelayedEffectSource()const
CHuiVisual::IsTagged()const
CHuiVisual::Layout()const
CHuiVisual::LoadingEffect()const
CHuiVisual::LocalBaseUnit()const
CHuiVisual::LocalPointInPixels(const THuiRealPoint &)const
CHuiVisual::LocalPointInPixels(const THuiRealPoint &,THuiReferenceState)const
CHuiVisual::LocalToDisplay(const THuiRealPoint &)const
CHuiVisual::LocalToDisplay(const TPoint &)const
CHuiVisual::MaxSize()const
CHuiVisual::MaxSizeInBaseUnits()const
CHuiVisual::MetricReferenceInPixels(const THuiXYMetric &)const
CHuiVisual::MetricReferenceInPixels(const THuiXYMetric &,THuiReferenceState)const
CHuiVisual::MetricToPixels(const THuiXYMetric &)const
CHuiVisual::MetricToPixels(const THuiXYMetric &,THuiReferenceState)const
CHuiVisual::Mimic(const CHuiVisual &,TInt)
CHuiVisual::MinSize()const
CHuiVisual::MinSizeInBaseUnits()const
CHuiVisual::Move(const THuiRealPoint &,TInt)
CHuiVisual::Move(const TPoint &,TInt)
CHuiVisual::MoveToFront(TInt)
CHuiVisual::Owner()const
CHuiVisual::Padding()const
CHuiVisual::PaddingInPixels()const
CHuiVisual::PaddingInPixels(THuiReferenceState)const
CHuiVisual::PixelPointInLocal(const THuiRealPoint &)const
CHuiVisual::PixelPointInLocal(const THuiRealPoint &,THuiReferenceState)const
CHuiVisual::PixelPointInUnits(const THuiRealPoint &,const THuiXYMetric &,THuiReferenceState)const
CHuiVisual::PixelsToMetric(const THuiRealPoint &,THuiXYMetric &)const
CHuiVisual::PixelsToMetric(const THuiRealPoint &,THuiXYMetric &,THuiReferenceState)const
CHuiVisual::Pos()
CHuiVisual::Pos()const
CHuiVisual::QueryCanvasFlags()
CHuiVisual::QueryExternalContentDrawingEnabled()
CHuiVisual::QueryHasDrawableContent()
CHuiVisual::RemoveTactileFeedback(TInt)
CHuiVisual::ReportLayoutUpdate()
CHuiVisual::SetCenteredPosAndSize(const THuiRealPoint &,const THuiRealSize &,TInt)
CHuiVisual::SetCenteredPosAndSize(const TPoint &,const TSize &,TInt)
CHuiVisual::SetChanged()
CHuiVisual::SetClipping(TBool)
CHuiVisual::SetDisplay(CHuiDisplay *)
CHuiVisual::SetEffect(CHuiFxEffect *)
CHuiVisual::SetEffectParser(CHuiFxEffectParser *)
CHuiVisual::SetFlag(THuiVisualFlags)
CHuiVisual::SetFlags(TInt)
CHuiVisual::SetFreezeState(TBool)
CHuiVisual::SetLayout(CHuiLayout *)
CHuiVisual::SetLoadingEffect(TBool)
CHuiVisual::SetMaxSize(const THuiRealSize &)
CHuiVisual::SetMaxSize(const TSize &)
CHuiVisual::SetMinSize(const THuiRealSize &)
CHuiVisual::SetMinSize(const TSize &)
CHuiVisual::SetOrigin(THuiVisualHOrigin,THuiVisualVOrigin)
CHuiVisual::SetOwner(MHuiVisualOwner &)
CHuiVisual::SetPadding(TInt)
CHuiVisual::SetPadding(const THuiBoxMetric &)
CHuiVisual::SetPadding(const TPoint &)
CHuiVisual::SetRect(const THuiRealRect &,TInt)
CHuiVisual::SetStoredRenderBuffer(CHuiCanvasRenderBuffer *)
CHuiVisual::SetStoredRenderBufferModificationsEnabled(TBool)
CHuiVisual::SetTactileFeedbackL(TInt,TInt)
CHuiVisual::SetTagL(const TDesC8 &)
CHuiVisual::SetTracking(TBool)
CHuiVisual::Size()
CHuiVisual::Size()const
CHuiVisual::Skin()const
CHuiVisual::StoredRenderBuffer()const
CHuiVisual::TactileFeedback(TInt)const
CHuiVisual::Tag()const
CHuiVisual::Tracking()const
CHuiVisual::Transform(CHuiGc &,TBool,const THuiRealRect *)const
CHuiVisual::Transformation()
CHuiVisual::UpdateSiblingLayout(TInt)
CHuiVisual::VerticalOrigin()const
CHuiVisual::~CHuiVisual()
Public Member Enumerations
enumEHuiLayoutChildRect { THuiLayoutChildRectNotImplemented = -1, THuiLayoutChildRectUpdateNotNeeded = 0, THuiLayoutChildRectPosUpdateNeeded = 1, THuiLayoutChildRectSizeUpdateNeeded = 2, THuiLayoutChildRectLayoutUpdateNeeded = THuiLayoutChildRectPosUpdateNeeded | THuiLayoutChildRectSizeUpdateNeeded }
enumTExpansionFlags { EExpandNone = 0, EExpandHorizontally = 1, EExpandVertically = 2 }
Protected Attributes
THuiLayoutPrivateData *iHuiLayoutPrivateData
Inherited Attributes
CHuiVisual::iDepthOffset
CHuiVisual::iOpacity
CHuiVisual::iOwner
CHuiVisual::iPreviousDrawn
CHuiVisual::iSessionId
CHuiVisual::iTrackVisual

Constructor & Destructor Documentation

CHuiLayout(MHuiVisualOwner &)

IMPORT_CCHuiLayout(MHuiVisualOwner &aOwner)

Constructor.

Parameters

MHuiVisualOwner & aOwner

~CHuiLayout()

IMPORT_C~CHuiLayout()

Destructor.

Member Functions Documentation

AddNewL(CHuiControl &, CHuiLayout *)

IMPORT_C CHuiLayout *AddNewL(CHuiControl &aOwnerControl,
CHuiLayout *aParentLayout = 0
)[static]

Construct a new basic layout and give its ownership to a control. Note that CHuiLayout has no real layout functionality: its children must be laid out manually.

Parameters

CHuiControl & aOwnerControlOwner control.
CHuiLayout * aParentLayout = 0Parent layout for the new layout.

AppendL(CHuiVisual *, TInt)

IMPORT_C voidAppendL(CHuiVisual *aVisual,
TIntaLayoutTransitionTime = 0
)

Append a new visual to the layout. If the visual is already a member of some other layout, it will be removed from the old layout first.

TodoAdd a method for appending multiple visuals in one set, so that they only cause a single layout update.

Parameters

CHuiVisual * aVisualVisual to append.
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

BaseUnit()

IMPORT_C THuiXYMetricBaseUnit()const [virtual]

Returns the layout's base measurement unit. The positions and sizes of the children of this layout are interpreted as multiples of this base unit. For example, the actual X position of a child is determined by aBaseUnit.iX * childX.

The effect of the base unit is limited to the children of this layout -- the grandchildren use the base units of their parents, not this base unit.

Note:

that if the visual flag EHuiVisualFlagAutomaticLocaleMirroringEnabled is set, the value returned by this method will change based on the current platform locale mirroring in the X-axis. So for example if the current layout is mirrored, then the value returned by this method will have the X magnitude set to the negative of the value that was set using SetBaseUnit.

BoundingRect()

THuiRealRectBoundingRect()const

Calculate the bounding rectangle for the layout. The rectangle is calculated in the base units of the layout, i.e. it is calculated using unconverted the child coordinates and sizes.

BrushOpacity()

IMPORT_C TReal32BrushOpacity()const

BrushRect()

IMPORT_C THuiRealRectBrushRect()const

BrushSkin()

IMPORT_C CHuiSkin &BrushSkin()const

Changed()

IMPORT_C TBoolChanged()const [virtual]

From CHuiVisual

ChildOrdinal(TInt)

IMPORT_C TIntChildOrdinal(TIntaIndex)[virtual]

Determines the layout ordinal for a child visual. The child's placement depends on the ordinal number.

Parameters

TInt aIndexIndex of the child visual.

ChildPos(TInt, TPoint &)

IMPORT_C TBoolChildPos(TIntaOrdinal,
TPoint &aPos
)[virtual]

New virtual method. Determines the position of a child visual according to the layout. The child position is determined using the base units of the layout. Derived layout classes should refer to InnerSize() and InnerTopLeft() to determine the area suitable for placing children into.

Parameters

TInt aOrdinalLayout ordinal of the child visual.
TPoint & aPosNew position for the child. This goes to CHuiVisual::SetPos() with no conversions.

ChildRect(TInt, THuiRealRect &)

IMPORT_C TIntChildRect(TIntaOrdinal,
THuiRealRect &aRect
)[virtual]

New virtual method. Determines the position and size of a child visual according to the layout. The child position is determined using the base units of the layout. Derived layout classes should refer to InnerSize() and InnerTopLeft() to determine the area suitable for placing children into.

Parameters

TInt aOrdinalLayout ordinal of the child visual.
THuiRealRect & aRectNew position for the child. This is used to set the child size and position with no conversions.

ChildSize(TInt, TSize &)

IMPORT_C TBoolChildSize(TIntaOrdinal,
TSize &aSize
)[virtual]

New virtual method. Determines the size of a child visual according to the layout. The child size is determined using the base units of the layout. Derived layout classes should refer to InnerSize() and InnerTopLeft() to determine the area suitable for placing children into.

Parameters

TInt aOrdinalLayout ordinal of the child visual.
TSize & aSizeNew target size for the child. This goes to CHuiVisual::SetSize() with no conversions.

ClearChanged()

IMPORT_C voidClearChanged()[virtual]

From CHuiVisual

ConstructL()

IMPORT_C voidConstructL()[virtual]

Second-phase constructor from CHuiVisual, must be called in deriving class

Count()

IMPORT_C TIntCount()const [virtual]

From CHuiVisual. Returns the number of child visuals in the layout.

Draw(CHuiGc &)

IMPORT_C voidDraw(CHuiGc &aGc)const [virtual]

From CHuiVisual. Draws (renders) this layout.

The default implementataion applies transformations (affects the positions of the layout), draws brushes and of course children.

Layout clipping is not affected by transformation.

TodoClipping doesn't work if there is a transformation? No need to draw children that won't be visible.

Parameters

CHuiGc & aGc

DrawSelf(CHuiGc &, const TRect &)

IMPORT_C voidDrawSelf(CHuiGc &aGc,
const TRect &aDisplayRect
)const [protected, virtual]

From CHuiVisual. Overridden by subclasses to draw the content of the visual. By default DrawSelf does not draw anything.

Parameters

CHuiGc & aGc
const TRect & aDisplayRect

DrawStoredBitmap(CHuiGc &)

voidDrawStoredBitmap(CHuiGc &aGc)const [private]

Parameters

CHuiGc & aGc

DumpTree()

IMPORT_C voidDumpTree()const [virtual]

From CHuiVisual

EffectIsAppliedToChildren()

TBool EffectIsAppliedToChildren()const [protected]

EffectiveLayoutOrdinal(const CHuiVisual &)

IMPORT_C TIntEffectiveLayoutOrdinal(const CHuiVisual &aVisual)const

Layout is calculated according the ordinals. The effective ordinal may not be the same as the real child ordinal, because some visuals are laid out manually.

panic
THuiPanic::ELayoutChildVisualNotFound aVisual is not a child of this layout.

Parameters

const CHuiVisual & aVisual

EnableScrollingL(TBool)

IMPORT_C voidEnableScrollingL(TBoolaScrolling = ETrue)

Enables or disables scrolling in the layout. An offset for the origin of the layout can be defined using ScrollOffset() - method and manipulating the THuiTimedPoint returned by that method.

Scroll offset, unlike other layout parameters, is not directly applied to layout children when UpdateChildrenLayout() is called. Instead, the scroll offset is taken into consideration when individual child visual display rectangles are calculated. This way the scroll offset is directly applied to dirty rectangle calculations as well as to visual content rectangle calculations when visuals are drawn.

Parameters

TBool aScrolling = ETrueETrue to enable scrolling, EFalse to disable.

ExpandRectWithContent(TRect &)

IMPORT_C voidExpandRectWithContent(TRect &aRect)const [protected, virtual]

Expands the dirty region of the visual depending on the content of the visual. This includes any brushes attached to the visual. Used during dirty region reporting.

Parameters

TRect & aRectDirty region.

FindTag(const TDesC8 &)

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

From CHuiVisual. Finds a visual whose tag descriptor contains a specific tag. Checks self first, then looks through the child visuals.

CHuiLayout::FindTag() extends upon the basic implementation in CHuiVisual::FindTag() by adding recursive visual hierarchy searching.

CHuiVisual::Tag() CHuiVisual::SetTagL() CHuiVisual::IsTagged() CHuiVisual::FindTag()

Parameters

const TDesC8 & aTagTag 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 (:).

FindVisual(const CHuiVisual *)

IMPORT_C TIntFindVisual(const CHuiVisual *aVisual)const

Finds a visual's index.

Parameters

const CHuiVisual * aVisualVisual to look for.

GetClassName(TDes &)

IMPORT_C voidGetClassName(TDes &aName)const [virtual]

Returns the name of the class.

Parameters

TDes & aNameName of the visual class.

GetInstanceName(TDes &)

IMPORT_C voidGetInstanceName(TDes &aName)const [virtual]

Parameters

TDes & aName

HasActiveChilderen()

TBool HasActiveChilderen()const [private]

HorizontalInnerPadding()

IMPORT_C TIntHorizontalInnerPadding()const

Returns the inner horizontal padding. This is useless, use InnerPaddingInBaseUnits() instead.

InnerPadding()

IMPORT_C const THuiXYMetric &InnerPadding()const

Returns the current inner padding.

InnerPaddingInBaseUnits()

IMPORT_C THuiRealPointInnerPaddingInBaseUnits()const

Returns the inner padding converted to the base units of this layout. These can be summed with the positions and sizes of the layout's children.

InnerSize()

IMPORT_C THuiRealSizeInnerSize()const

Calculate the size of the inner area (bounds without outer padding). The size is calculated in the base units of this layout, so that children can be positioned within the layout based on this size.

InnerTopLeft()

IMPORT_C THuiRealPointInnerTopLeft()const

Calculates the top left corner of the inner area (bounds without outer padding). The point is calculated in the base units of this layout, so that the children can be positioned within the layout based on this point.

InsertL(CHuiVisual *, TInt, TInt)

IMPORT_C voidInsertL(CHuiVisual *aVisual,
TIntaPosition,
TIntaLayoutTransitionTime = 0
)

Insert a new visual to the layout, at specified position (position 0 is the first, Count() -1 is the last). If the visual is already a member of some other layout, it will be removed from the old layout first.

Parameters

CHuiVisual * aVisualVisual to append.
TInt aPosition
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

MetricReferenceForLayoutInPixels(const CHuiLayout *, const THuiXYMetric &)

IMPORT_C THuiRealPointMetricReferenceForLayoutInPixels(const CHuiLayout *aLayout,
const THuiXYMetric &aMetric
)const [protected]

Calculate the metric reference for this layout, relative to this layout's base units.

Parameters

const CHuiLayout * aLayoutthis parameter is no longer used, an alternative method is provided that does not take this parameter
const THuiXYMetric & aMetricthe metric for which we need a reference value

MetricReferenceForLayoutInPixels(const THuiXYMetric &)

IMPORT_C THuiRealPointMetricReferenceForLayoutInPixels(const THuiXYMetric &aMetric)const [protected]

Parameters

const THuiXYMetric & aMetric

MoveVisualToBack(CHuiVisual &, TInt)

IMPORT_C voidMoveVisualToBack(CHuiVisual &aVisual,
TIntaLayoutTransitionTime = 0
)

Moves a child visual behind the other children (in drawing order). In other words the visual is drawn first (the other child visuals will be drawn on top of this visual).

In practise this affects the order of the visuals whithin this layout so that the visual is moved at the beginning of the list (ordinal 0).

MoveVisualToFront() Reorder()

Parameters

CHuiVisual & aVisualChild visual to move.
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

MoveVisualToFront(CHuiVisual &, TInt)

IMPORT_C voidMoveVisualToFront(CHuiVisual &aVisual,
TIntaLayoutTransitionTime = 0
)

Moves a child visual to the front of the other children. In other words the visual is drawn last (on top of the other child visuals). In practise this affects the order of the visuals whithin this layout so that the visual is moved at the end of the list.

Causes layout recalculation.

MoveVisualToBack() Reorder() MoveVisualToFront() - Use this instead!

Parameters

CHuiVisual & aVisualChild visual to move.
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

NotifySkinChangedL()

IMPORT_C voidNotifySkinChangedL()[virtual]

Notifies children of the change in the environment's skin.

PrepareDrawL()

IMPORT_C TBoolPrepareDrawL()[virtual]

From CHuiVisual. Prepares all children of this layout for drawing. The preparation is done in drawing order.

Actually this default implementation is not leaving, since it traps the prepare errors inside and handles the errors by calling the visual owners "prepare draw failed" -callback.

MHuiVisualOwner::VisualPrepareDrawFailed()

Remove(CHuiVisual *, TInt)

IMPORT_C voidRemove(CHuiVisual *aVisual,
TIntaLayoutTransitionTime = 0
)

Parameters

CHuiVisual * aVisualVisual to remove.
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

RemoveAndDestroyAllD()

IMPORT_C voidRemoveAndDestroyAllD()[virtual]

From CHuiVisual. Removes this layout from its owner and and destroys the layout. Also removes the entire hierarchy of child visuals and destroys all of them.

Reorder(CHuiVisual &, TInt, TInt)

IMPORT_C voidReorder(CHuiVisual &aVisual,
TIntaPosition,
TIntaLayoutTransitionTime = 0
)

Moves the given child visual to specific position in the layout's list of child visuals. Affects the drawing order (last child is drawn last), and possibly the final laid out position and size of the visual. This is due to that many layout implementations calculate the positioning of their children based on child's order number in the list.

Causes layout recalculation.

MoveVisualToBack() MoveVisualToFront()

Parameters

CHuiVisual & aVisualChild visual to move.
TInt aPositionNew position (and ordinal number) in the child list (0 = first, Count()-1 = last).
TInt aLayoutTransitionTime = 0How long the transition should take visually, in milliseconds.

ReportChanged()

IMPORT_C voidReportChanged()[virtual]

From CHuiVisual. Called to inform the display that a dirty region has to be defined.

Forward the notification request to all the child visuals. Scrolling causes changed reports from the layout itself.

ScrollOffset()

IMPORT_C THuiTimedPoint &ScrollOffset()
Returns the scroll offset of the layout. The scroll offset is in layout's base units. The scroll offset has to be enabled before this method is called. EnableScrollingL()
panic
THuiPanic::ELayoutNotScrolling Scrolling is not enabled.

ScrollOffset()

IMPORT_C const THuiTimedPoint &ScrollOffset()const

Scrolling()

IMPORT_C TBoolScrolling()const

Indicates whether scrolling is enabled in this layout. EnableScrolling()

SessionId()

IMPORT_C TIntSessionId()const

Gets the session id for object.

SetBaseUnit(const THuiMetric &)

IMPORT_C voidSetBaseUnit(const THuiMetric &aBaseUnit)

Defines the base unit used for positioning and sizing children within this layout. For example, the actual X position of a child is determined by aBaseUnit.iX * childX. The effect of the base unit is limited to the children of this layout -- the grandchildren use the base units of their parents, not this base unit.

Note:

It is recommended to use EHuiUnitNormalized if proportional base units are required. For example, EHuiUnitRelativeToMySize would not make sense as a base unit.

Parameters

const THuiMetric & aBaseUnit

SetBaseUnit(const THuiXYMetric &)

IMPORT_C voidSetBaseUnit(const THuiXYMetric &aBaseUnit)

Defines the base unit used for positioning and sizing children within this layout. For example, the actual X position of a child is determined by aBaseUnit.iX * childX. The effect of the base unit is limited to the children of this layout -- the grandchildren use the base units of their parents, not this base unit.

Parameters

const THuiXYMetric & aBaseUnit

SetInnerPadding(const TPoint &)

IMPORT_C voidSetInnerPadding(const TPoint &aInnerPadding)

Sets the inner padding of the layout. This is typically the amount of empty space between child visuals in the layout.

Parameters

const TPoint & aInnerPaddingInner padding (e.g., column, row separation).

SetInnerPadding(const THuiXYMetric &)

IMPORT_C voidSetInnerPadding(const THuiXYMetric &aInnerPadding)

Sets the inner padding of the layout. This is typically the amount of empty space between child visuals in the layout.

Note:

as paddings are relative to the layout visual, if relative units are required, it is advisable to use EHuiUnitRelativeToMySize so that the paddings are relative to the size of this layout visual

Parameters

const THuiXYMetric & aInnerPaddingInner padding, using metrics.

SetPos(const THuiRealPoint &, TInt)

IMPORT_C voidSetPos(const THuiRealPoint &aPos,
TIntaTransitionTime = 0
)[virtual]

From CHuiVisual. Sets the position of the layout.

Parameters

const THuiRealPoint & aPosTarget position, in the local coordinate system as defined by the parent layout (or the display, if there is no parent).
TInt aTransitionTime = 0Transition time in milliseconds.

SetScrollOffsetInBaseUnits(const THuiRealPoint &, TInt)

IMPORT_C voidSetScrollOffsetInBaseUnits(const THuiRealPoint &aOffset,
TIntaTransitionTime = 0
)

Specifies the scroll offset of this layout. The scroll offset is defined in layout's base units. The scroll offset has to be enabled before this method is called. BaseUnit() EnableScrollingL()

Parameters

const THuiRealPoint & aOffsetOffset in layout's base units.
TInt aTransitionTime = 0Time when the offset is to be reached in milliseconds.

SetSessionId(TInt)

IMPORT_C voidSetSessionId(TIntaSessionId)

Sets the session id for object.

Parameters

TInt aSessionId

SetSize(const THuiRealSize &, TInt)

IMPORT_C voidSetSize(const THuiRealSize &aSize,
TIntaTransitionTime = 0
)[virtual]

From CHuiVisual. Change the size of the layout. Children's positions and sizes are updated accordingly. Each layout class is responsible for determining how to update children's layout.

Parameters

const THuiRealSize & aSizeSize to set the layout to.
TInt aTransitionTime = 0

SetTransitionTime(TInt)

IMPORT_C voidSetTransitionTime(TIntaTransitionTime)

Sets the transition time for the recalculation of this layout's contents. This is used when a visual is added or removed or when the order of the children is changed.

You need to set the EHuiVisualFlagManualTransitionTime flag of this visual before this setting has any effect. This flag overrides the layout transition time hierarchy and uses a local value instead.

CHuiLayout::SetTransitionTime() CHuiVisual::SetFlag() EHuiVisualFlagManualTransitionTime

Parameters

TInt aTransitionTimeTransition time in milliseconds.

TransitionTime()

IMPORT_C TIntTransitionTime()const

Type()

IMPORT_C TTypeType()const

Gets the object type.

UpdateChildLayout(TInt, TInt)

IMPORT_C voidUpdateChildLayout(TIntaIndex,
TIntaTransitionTime = 0
)[virtual]

New virtual method. Update the layout of one child visual.

Parameters

TInt aIndexChild visual index.
TInt aTransitionTime = 0Time for layout transition.

UpdateChildrenLayout(TInt)

IMPORT_C voidUpdateChildrenLayout(TIntaTransitionTime = 0)[virtual]

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

Parameters

TInt aTransitionTime = 0Time for layout transition.

VerticalInnerPadding()

IMPORT_C TIntVerticalInnerPadding()const

Returns the inner vertical padding. This is useless, use InnerPaddingInBaseUnits() instead.

VirtualSize()

IMPORT_C TSizeVirtualSize()const

Determines the virtual size of the layout. The virtual size may be larger than the actual size. The virtual size is updated automatically when the layout's children are positioned.

panic
THuiPanic::ELayoutNotScrolling Scrolling is not enabled.

Visual(TInt)

IMPORT_C CHuiVisual &Visual(TIntaIndex)const [virtual]

From CHuiVisual. Returns a child visual.

Parameters

TInt aIndexIndex of the child visual.

VisualExtension(const TUid &, TAny **)

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

! From HuiVisual

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

Member Enumerations Documentation

Enum EHuiLayoutChildRect

Enumerators

THuiLayoutChildRectNotImplemented = -1
THuiLayoutChildRectUpdateNotNeeded = 0
THuiLayoutChildRectPosUpdateNeeded = 1
THuiLayoutChildRectSizeUpdateNeeded = 2
THuiLayoutChildRectLayoutUpdateNeeded = THuiLayoutChildRectPosUpdateNeeded | THuiLayoutChildRectSizeUpdateNeeded

Enum TExpansionFlags

Enumerators

EExpandNone = 0

Not expanding in any direction.

EExpandHorizontally = 1

Expands horizontally.

EExpandVertically = 2

Expands vertically.

Member Data Documentation

THuiLayoutPrivateData * iHuiLayoutPrivateData

THuiLayoutPrivateData *iHuiLayoutPrivateData[protected]