CHuiGridLayout Class Reference

class CHuiGridLayout : public CHuiLayout

CHuiGridLayout is a layout that allows visuals to be positioned within a grid.

To use this class, a grid layout is created of a desired width and height. Then, when visuals are added to grid layout, they will populate the grid. By default, all slots in a grid layout are of a uniform size, but the weighting of individual rows and columns can be modified, and can be specified using metric units. Slots will resize automatically as the grid layout size changes.

The standard application grid is one example of a grid layout.

Inherits from

Nested Classes and Structures

Public Member Functions
CHuiGridLayout(MHuiVisualOwner &)
~CHuiGridLayout()
IMPORT_C CHuiGridLayout *AddNewL(CHuiControl &, TInt, TInt, CHuiLayout *)
IMPORT_C voidAppendWeightL(THuiGridDimension, const THuiMetric &)
IMPORT_C THuiXYMetricBaseUnit()
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 voidClearLayoutModeFlags(THuiGridDimension, TUint)
IMPORT_C TIntColumnCount()
IMPORT_C voidConstructL()
IMPORT_C TIntCount()
IMPORT_C TIntDimensionCount(THuiGridDimension)
IMPORT_C voidDraw(CHuiGc &)
IMPORT_C voidDrawSelf(CHuiGc &, const TRect &)
IMPORT_C voidDumpTree()
IMPORT_C voidExpandRectWithContent(TRect &)
IMPORT_C voidFillWeightsL(THuiGridDimension, TInt, const THuiMetric &)
IMPORT_C CHuiVisual *FindTag(const TDesC8 &)
IMPORT_C voidGetClassName(TDes &)
IMPORT_C voidGetInstanceName(TDes &)
IMPORT_C voidInsertWeightL(THuiGridDimension, const THuiMetric &, TInt)
IMPORT_C TUintLayoutModeFlags(THuiGridDimension)
IMPORT_C voidNotifySkinChangedL()
IMPORT_C TPointOrdinalToBlock(TInt)
IMPORT_C TBoolPrepareDrawL()
IMPORT_C voidRemoveAndDestroyAllD()
IMPORT_C voidRemoveWeightL(THuiGridDimension, TInt)
IMPORT_C voidReplaceWeightL(THuiGridDimension, const THuiMetric &, TInt)
IMPORT_C voidReportChanged()
IMPORT_C TIntRowCount()
IMPORT_C TIntSessionId()
IMPORT_C voidSetColumnsL(TInt)
IMPORT_C voidSetColumnsL(const RArray< TInt > &)
IMPORT_C voidSetExpanding(TInt)
IMPORT_C voidSetLayoutModeFlags(THuiGridDimension, TUint)
IMPORT_C voidSetPos(const THuiRealPoint &, TInt)
IMPORT_C voidSetRowsL(TInt)
IMPORT_C voidSetRowsL(const RArray< TInt > &)
IMPORT_C voidSetSessionId(TInt)
IMPORT_C voidSetSize(const THuiRealSize &, TInt)
IMPORT_C TTypeType()
IMPORT_C voidUpdateChildrenLayout(TInt)
IMPORT_C CHuiVisual &Visual(TInt)
IMPORT_C voidVisualExtension(const TUid &, TAny **)
IMPORT_C THuiMetricWeight(THuiGridDimension, TInt)
Private Member Functions
voidCalculateCellInPixels(THuiGridDimension, TInt, TReal32, TInt &, TInt &)
voidCalculateCellInPixelsReal(THuiGridDimension, TInt, TReal32, TReal32 &, TReal32 &, TInt &, TInt &)
TReal32 ProportionalInnerOuterPadding(THuiGridDimension, TReal32, TReal32)
TBool UseRightToLeftFillingOrder()
voidWeightFromMetric(THuiGridDimension, THuiMetric &, TReal32 &, TInt &)
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()
CHuiLayout::AddNewL(CHuiControl &,CHuiLayout *)
CHuiLayout::AppendL(CHuiVisual *,TInt)
CHuiLayout::BoundingRect()const
CHuiLayout::BrushOpacity()const
CHuiLayout::BrushRect()const
CHuiLayout::BrushSkin()const
CHuiLayout::CHuiLayout(MHuiVisualOwner &)
CHuiLayout::EffectIsAppliedToChildren()const
CHuiLayout::EffectiveLayoutOrdinal(const CHuiVisual &)const
CHuiLayout::EnableScrollingL(TBool)
CHuiLayout::FindVisual(const CHuiVisual *)const
CHuiLayout::HorizontalInnerPadding()const
CHuiLayout::InnerPadding()const
CHuiLayout::InnerPaddingInBaseUnits()const
CHuiLayout::InnerSize()const
CHuiLayout::InnerTopLeft()const
CHuiLayout::InsertL(CHuiVisual *,TInt,TInt)
CHuiLayout::MetricReferenceForLayoutInPixels(const CHuiLayout *,const THuiXYMetric &)const
CHuiLayout::MetricReferenceForLayoutInPixels(const THuiXYMetric &)const
CHuiLayout::MoveVisualToBack(CHuiVisual &,TInt)
CHuiLayout::MoveVisualToFront(CHuiVisual &,TInt)
CHuiLayout::Remove(CHuiVisual *,TInt)
CHuiLayout::Reorder(CHuiVisual &,TInt,TInt)
CHuiLayout::ScrollOffset()
CHuiLayout::ScrollOffset()const
CHuiLayout::Scrolling()const
CHuiLayout::SetBaseUnit(const THuiMetric &)
CHuiLayout::SetBaseUnit(const THuiXYMetric &)
CHuiLayout::SetInnerPadding(const THuiXYMetric &)
CHuiLayout::SetInnerPadding(const TPoint &)
CHuiLayout::SetScrollOffsetInBaseUnits(const THuiRealPoint &,TInt)
CHuiLayout::SetTransitionTime(TInt)
CHuiLayout::TransitionTime()const
CHuiLayout::UpdateChildLayout(TInt,TInt)
CHuiLayout::VerticalInnerPadding()const
CHuiLayout::VirtualSize()const
CHuiLayout::~CHuiLayout()
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()
Inherited Enumerations
CHuiLayout:EHuiLayoutChildRect
CHuiLayout:TExpansionFlags
Private Attributes
TGridLayoutPrivateData *iGridLayoutData
TAny *iSpare
Inherited Attributes
CHuiLayout::iHuiLayoutPrivateData
CHuiVisual::iDepthOffset
CHuiVisual::iOpacity
CHuiVisual::iOwner
CHuiVisual::iPreviousDrawn
CHuiVisual::iSessionId
CHuiVisual::iTrackVisual

Constructor & Destructor Documentation

CHuiGridLayout(MHuiVisualOwner &)

IMPORT_CCHuiGridLayout(MHuiVisualOwner &aOwner)

Parameters

MHuiVisualOwner & aOwner

~CHuiGridLayout()

IMPORT_C~CHuiGridLayout()

Member Functions Documentation

AddNewL(CHuiControl &, TInt, TInt, CHuiLayout *)

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

Construct a new grid layout and give its ownership to a control.

Note:

Default expansion direction is vertical. See SetExpanding() to changed the direction.

the columns and rows will be initialized with unit weights equal to 1, so that blocks will all share even proportions of the available area to start with.

in order to use a mixture of metric weights, or to set different weights, set rows and columns to zero when calling this method, then use e.g. AppendWeightL to subsequently populate the weights.

Parameters

CHuiControl & aOwnerControlOwner control.
TInt aColumnsNumber of columns in the grid.
TInt aRowsNumber of rows in the grid.
CHuiLayout * aParentLayout = 0Parent layout for the new grid layout.

AppendWeightL(THuiGridDimension, const THuiMetric &)

IMPORT_C voidAppendWeightL(THuiGridDimensionaDim,
const THuiMetric &aWeight
)

Add a new line of blocks to this grid layout at the last position in the direction of the specified dimension. It will have the supplied weight. Weights can be any metric value, hence different units can be used for each block. In particular, EHuiUnitWeight can be used to represent weight values in aribtrary proportional units.

In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight.

Since
S60 3.2
Note:

If non-relative coordinates are specified (e.g., real pixels), the combined blocks might not fill the entire layout area. However, weights will always stretch to fill all available space after the fixed units have been determined. Therefore, depending on circumstances it may be better to use EHuiUnitWeight

For example [2 weights, 1 weight, 2 weights] in a layout of 100 pixels would result in [40 pixels, 20 pixels, 40 pixels].

For example [10 pixels, 1 weight, 15 pixels] in a layout of 100 pixels would result in [10 pixels, 75 pixels, 15 pixels].

Parameters

THuiGridDimension aDimthe dimension to which the weight corresponds
const THuiMetric & aWeightthe weight to be used for the block in the specified dimension, replacing any previously existing weight for that block

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.

CalculateCellInPixels(THuiGridDimension, TInt, TReal32, TInt &, TInt &)

voidCalculateCellInPixels(THuiGridDimensionaDim,
TIntaIndex,
TReal32aAvailablePixels,
TInt &aPos,
TInt &aSize
)const [private]

Calculates the size and position along the specified axis according to the current weights. The non-weights are resolved into pixels and the remainder after subtracting from InnerSize is shared between the other cells that are specified using weight metrics. Returns integer pixel values, taking into account the TAlfGridLayoutModeFlags for error rounding.

CalculateCellInPixelsReal

Parameters

THuiGridDimension aDimthe dimension along which to calculate
TInt aIndexthe block being calculated
TReal32 aAvailablePixelsthe space available within the grid layout, after the paddings and inner paddings have already been subtracted
TInt & aPosthe resulting position in pixels of the block along the axis (replaces contents)
TInt & aSizethe resulting size in pixels of the block along the axis (replaces contents)

CalculateCellInPixelsReal(THuiGridDimension, TInt, TReal32, TReal32 &, TReal32 &, TInt &, TInt &)

voidCalculateCellInPixelsReal(THuiGridDimensionaDim,
TIntaIndex,
TReal32aAvailablePixels,
TReal32 &aPos,
TReal32 &aSize,
TInt &aFloorPixelPos,
TInt &aCeilingPixelPos
)const [private]

Calculates the size and position along the specified axis according to the current weights. The non-weights are resolved into pixels and the remainder after subtracting from InnerSize is shared between the other cells that are specified using weight metrics.

Note:

that this calculation assumes that the inner paddings have already been subtracted from the inner size, and that they will be added back in when calculating the actual position in base units.

when called repeatedly by UpdateChildrenLayout, all the cells will be calculated for each time UpdateChildLayout is called.

Parameters

THuiGridDimension aDimthe dimension along which to calculate
TInt aIndexthe block being calculated
TReal32 aAvailablePixelsthe space available within the grid layout, after the paddings and inner paddings have already been subtracted
TReal32 & aPosthe resulting position in pixels of the block along the axis (replaces contents)
TReal32 & aSizethe resulting size in pixels of the block along the axis (replaces contents)
TInt & aFloorPixelPosthe total width assuming every item width is floored.
TInt & aCeilingPixelPosthe total width assuming every item width is ceilinged.

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

ClearLayoutModeFlags(THuiGridDimension, TUint)

IMPORT_C voidClearLayoutModeFlags(THuiGridDimensionaDim,
TUintaGridLayoutModeFlags
)

Clears flag(s) which alter the children's pixel error distribution within the grid layout.

TAlfGridLayoutModeFlags, SetLayoutModeFlags

Parameters

THuiGridDimension aDimthe dimension to which the given flag(s) affect.
TUint aGridLayoutModeFlagsFlags to be cleared

ColumnCount()

IMPORT_C TIntColumnCount()const

Return the number of columns in this grid.

ConstructL()

IMPORT_C voidConstructL()[virtual]

From CHuiLayout, deriving class must implement base call

Count()

IMPORT_C TIntCount()const [virtual]

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

DimensionCount(THuiGridDimension)

IMPORT_C TIntDimensionCount(THuiGridDimensionaDim)const

Return the number of lines of blocks in this grid, along the specified dimension.

Since
S60 3.2

Parameters

THuiGridDimension aDimthe dimension along which to count

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 [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

DumpTree()

IMPORT_C voidDumpTree()const [virtual]

From CHuiVisual

ExpandRectWithContent(TRect &)

IMPORT_C voidExpandRectWithContent(TRect &aRect)const [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.

FillWeightsL(THuiGridDimension, TInt, const THuiMetric &)

IMPORT_C voidFillWeightsL(THuiGridDimensionaDim,
TIntaCount,
const THuiMetric &aWeight
)

Sets the number and weights of blocks in this grid layout in the direction of the specified dimension. Each block's weight will be set to equal the supplied value, the result of which is that all blocks will be equally spaced, whatever the units.

Since
S60 3.2
AppendWeightL for more information on how weights are used to calculate layout positions.
Note:

This API could be useful if then subsequent calls to ReplaceWeightL are made to change specific values, depending on how many of the values are different.

Calling this with aCount set to 0 will clear all of the existing weights in the direction of the specified dimension.

this is the same as using metrics with unit type EHuiUnitWeight.

Parameters

THuiGridDimension aDimthe dimension along which to fill
TInt aCountThe number of lines of blocks to fill
const THuiMetric & aWeightthe weights to be used for all blocks

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 (:).

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

InsertWeightL(THuiGridDimension, const THuiMetric &, TInt)

IMPORT_C voidInsertWeightL(THuiGridDimensionaDim,
const THuiMetric &aWeight,
TIntaPos
)

Add a new line of blocks to this grid layout at the specified position in the direciton of the specified dimension. It will have the supplied weight. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight. It will also mean that many child visuals will now occupy different blocks within the grid according to how the blocks wrap.

Since
S60 3.2
Note:

will leave if the specified position is greater than the number of objects currently in the array, so check first by calling Count

AppendWeightL for more information on how weights are used to calculate layout positions.

Parameters

THuiGridDimension aDimthe dimension to which the weight corresponds
const THuiMetric & aWeightthe weight to be used for the block in the specified dimension, replacing any previously existing weight for that block
TInt aPosthe index of the block

LayoutModeFlags(THuiGridDimension)

IMPORT_C TUintLayoutModeFlags(THuiGridDimensionaDim)

Return flag(s) which alter the children's pixel error distribution within the grid layout.

Parameters

THuiGridDimension aDimthe dimension to return the flags for.

NotifySkinChangedL()

IMPORT_C voidNotifySkinChangedL()[virtual]

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

OrdinalToBlock(TInt)

IMPORT_C TPointOrdinalToBlock(TIntaOrdinal)const

Calculates the (x,y) position of a child in the grid. Returns the block position, where block (0, 0) is in the top left corner (top right corner when the layout is mirrored).

Parameters

TInt aOrdinalOrdinal of a child.

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

ProportionalInnerOuterPadding(THuiGridDimension, TReal32, TReal32)

TReal32 ProportionalInnerOuterPadding(THuiGridDimensionaDim,
TReal32aInnerPadPos,
TReal32aOuterPadPos
)const [private]

Calculate inner/outer distribution of padding. Interpolates between the previously calculated positions for inner padding and outer padding of the child, according to the proportion between inner and outer padding size.

Parameters

THuiGridDimension aDimthe dimension along which to calculate
TReal32 aInnerPadPosthe calculated position if inner padding is applied
TReal32 aOuterPadPosthe calculated position if outer padding is applied

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.

RemoveWeightL(THuiGridDimension, TInt)

IMPORT_C voidRemoveWeightL(THuiGridDimensionaDim,
TIntaPos
)

Remove a line of blocks from this grid layout at the specified position in the specified dimension. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight. It will also mean that many child visuals will now occupy different blocks within the grid according to how the blocks wrap.

Since
S60 3.2
AppendWeightL for more information on how weights are used to calculate layout positions.

Parameters

THuiGridDimension aDimthe dimension to which the weight corresponds
TInt aPosthe index of the cell

ReplaceWeightL(THuiGridDimension, const THuiMetric &, TInt)

IMPORT_C voidReplaceWeightL(THuiGridDimensionaDim,
const THuiMetric &aWeight,
TIntaPos
)

Sets the weight of a specific line of blocks in this grid layout, in the direction of the supplied dimension. In the case of proportional weights, the effect of this will be to cause the other blocks to resize according to the new total weight.

Since
S60 3.2
AppendWeightL for more information on how weights are used to calculate layout positions.

Parameters

THuiGridDimension aDimthe dimension to which the weight corresponds
const THuiMetric & aWeightthe weight to be used for the block in the specified dimension, replacing any previously existing weight for that cell
TInt aPosthe index of the cell

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.

RowCount()

IMPORT_C TIntRowCount()const

Return the number of rows in this grid.

SessionId()

IMPORT_C TIntSessionId()const

Gets the session id for object.

SetColumnsL(TInt)

IMPORT_C voidSetColumnsL(TIntaColumnCount)

Sets the number of columns in this grid layout. All weights are set to 1 (ie. each column is of an equal width).

Parameters

TInt aColumnCountThe number of columns.

SetColumnsL(const RArray< TInt > &)

IMPORT_C voidSetColumnsL(const RArray< TInt > &aWeights)

Sets the number and weights of columns in this grid layout. The caller specifies an array of relative weights to use for each column. Weights can be any integer, ie a column of weight 30 would be twice the width of a column of weight 15.

Note:

this is equivalent to using metrics with unit type EHuiUnitWeight.

Parameters

const RArray< TInt > & aWeightsAn array containing weights for each column.

SetExpanding(TInt)

IMPORT_C voidSetExpanding(TIntaFlags)

Sets the expansion flags to the given bitfield, made up of bits from CHuiLayout::TExpansionFlags.

With EExpandVertically, the filling starts from top left corner (right if mirrored) and a row is filled full before moving to the next row. If there are more items than rows*colums, they are layouted accordingly below the grid content area.

With EExpandHorizontally, the filling starts from top left corner (right if mirrored) and a column is filled full before moving to the next column. If there are more items than rows*colums, they are layouted accordingly on the right side (left if mirrored) of the content area of the grid.

Parameters

TInt aFlagsDetermines the expansion direction.

SetLayoutModeFlags(THuiGridDimension, TUint)

IMPORT_C voidSetLayoutModeFlags(THuiGridDimensionaDim,
TUintaGridLayoutModeFlags
)

Sets flag(s) which alter the children's pixel error distribution within the grid layout.

This method allows the client to force all items in the grid layout to be the same pixel size. The floating point error that this introduces is distributed between the various paddings of the layout.

Example of use that allows outer paddings to be automatically adjusted:
 iGridLayout->SetLayoutModeFlags(EHuiGridRow, EHuiGridAdjustOuterPadding); 

Note that some flags are mutually exclusive, and will clear some existing flags if set.

TAlfGridLayoutModeFlags, ClearLayoutModeFlags

Parameters

THuiGridDimension aDimthe dimension to which the given flag(s) affect.
TUint aGridLayoutModeFlagsFlags to be set or cleared

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.

SetRowsL(TInt)

IMPORT_C voidSetRowsL(TIntaRowCount)

Sets the number of rows in this grid layout. All weights are set to 1 (ie. each column is of an equal height).

Parameters

TInt aRowCountThe number of rows.

SetRowsL(const RArray< TInt > &)

IMPORT_C voidSetRowsL(const RArray< TInt > &aWeights)

Sets the number and weights of rows in this grid layout. The caller specifies an array of relative weights to use for each row. Weights can be any integer, ie a row of weight 30 would be twice the height of a row of weight 15.

Note:

this is the same as using metrics with unit type EHuiUnitWeight.

Parameters

const RArray< TInt > & aWeightsAn array containing weights for each row.

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

Type()

IMPORT_C TTypeType()const

Gets the object type.

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.

UseRightToLeftFillingOrder()

TBool UseRightToLeftFillingOrder()const [private]

Checks if the grid filling order is from top right corner instead the top left (default)

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
)[virtual]

! From HuiVisual

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

Weight(THuiGridDimension, TInt)

IMPORT_C THuiMetricWeight(THuiGridDimensionaDim,
TIntaPos
)const

Returns the weight of a specific line of blocks in this grid layout, in the specified dimension.

Since
S60 3.2
AppendWeightL for more information on how weights are used to calculate layout positions.

Parameters

THuiGridDimension aDimthe dimension to which the weight corresponds
TInt aPosthe index of the cell

WeightFromMetric(THuiGridDimension, THuiMetric &, TReal32 &, TInt &)

voidWeightFromMetric(THuiGridDimensionaDim,
THuiMetric &aMetric,
TReal32 &aWeight,
TInt &aPix
)const [private]

Retrieve the weight and pixel size from a metric. Returns one or the other depending on what type the metric is. Zeroes unused params.

Parameters

THuiGridDimension aDimthe dimension along which to calculate
THuiMetric & aMetricThe metric to examine
TReal32 & aWeightContains weight from metric.
TInt & aPixContains pixel size from metric.

Member Data Documentation

TGridLayoutPrivateData * iGridLayoutData

TGridLayoutPrivateData *iGridLayoutData[private]

TAny * iSpare

TAny *iSpare[private]