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 void AppendWeightL ( THuiGridDimension , const THuiMetric &)
IMPORT_C THuiXYMetric BaseUnit ()
IMPORT_C TBool Changed ()
IMPORT_C TInt ChildOrdinal ( TInt )
IMPORT_C TBool ChildPos ( TInt , TPoint &)
IMPORT_C TInt ChildRect ( TInt , THuiRealRect &)
IMPORT_C TBool ChildSize ( TInt , TSize &)
IMPORT_C void ClearChanged ()
IMPORT_C void ClearLayoutModeFlags ( THuiGridDimension , TUint )
IMPORT_C TInt ColumnCount ()
IMPORT_C void ConstructL ()
IMPORT_C TInt Count ()
IMPORT_C TInt DimensionCount ( THuiGridDimension )
IMPORT_C void Draw ( CHuiGc &)
IMPORT_C void DrawSelf ( CHuiGc &, const TRect &)
IMPORT_C void DumpTree ()
IMPORT_C void ExpandRectWithContent ( TRect &)
IMPORT_C void FillWeightsL ( THuiGridDimension , TInt , const THuiMetric &)
IMPORT_C CHuiVisual * FindTag (const TDesC8 &)
IMPORT_C void GetClassName ( TDes &)
IMPORT_C void GetInstanceName ( TDes &)
IMPORT_C void InsertWeightL ( THuiGridDimension , const THuiMetric &, TInt )
IMPORT_C TUint LayoutModeFlags ( THuiGridDimension )
IMPORT_C void NotifySkinChangedL ()
IMPORT_C TPoint OrdinalToBlock ( TInt )
IMPORT_C TBool PrepareDrawL ()
IMPORT_C void RemoveAndDestroyAllD ()
IMPORT_C void RemoveWeightL ( THuiGridDimension , TInt )
IMPORT_C void ReplaceWeightL ( THuiGridDimension , const THuiMetric &, TInt )
IMPORT_C void ReportChanged ()
IMPORT_C TInt RowCount ()
IMPORT_C TInt SessionId ()
IMPORT_C void SetColumnsL ( TInt )
IMPORT_C void SetColumnsL (const RArray < TInt > &)
IMPORT_C void SetExpanding ( TInt )
IMPORT_C void SetLayoutModeFlags ( THuiGridDimension , TUint )
IMPORT_C void SetPos (const THuiRealPoint &, TInt )
IMPORT_C void SetRowsL ( TInt )
IMPORT_C void SetRowsL (const RArray < TInt > &)
IMPORT_C void SetSessionId ( TInt )
IMPORT_C void SetSize (const THuiRealSize &, TInt )
IMPORT_C TType Type ()
IMPORT_C void UpdateChildrenLayout ( TInt )
IMPORT_C CHuiVisual & Visual ( TInt )
IMPORT_C void VisualExtension (const TUid &, TAny **)
IMPORT_C THuiMetric Weight ( THuiGridDimension , TInt )
Private Member Functions
void CalculateCellInPixels ( THuiGridDimension , TInt , TReal32 , TInt &, TInt &)
void CalculateCellInPixelsReal ( THuiGridDimension , TInt , TReal32 , TReal32 &, TReal32 &, TInt &, TInt &)
TReal32 ProportionalInnerOuterPadding ( THuiGridDimension , TReal32 , TReal32 )
TBool UseRightToLeftFillingOrder ()
void WeightFromMetric ( 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_C CHuiGridLayout ( MHuiVisualOwner & aOwner )

Parameters

MHuiVisualOwner & aOwner

~CHuiGridLayout()

IMPORT_C ~CHuiGridLayout ( )

Member Functions Documentation

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

IMPORT_C CHuiGridLayout * AddNewL ( CHuiControl & aOwnerControl,
TInt aColumns,
TInt aRows,
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 & aOwnerControl Owner control.
TInt aColumns Number of columns in the grid.
TInt aRows Number of rows in the grid.
CHuiLayout * aParentLayout = 0 Parent layout for the new grid layout.

AppendWeightL(THuiGridDimension, const THuiMetric &)

IMPORT_C void AppendWeightL ( THuiGridDimension aDim,
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 aDim the dimension to which the weight corresponds
const THuiMetric & aWeight the weight to be used for the block in the specified dimension, replacing any previously existing weight for that block

BaseUnit()

IMPORT_C THuiXYMetric BaseUnit ( ) 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 &)

void CalculateCellInPixels ( THuiGridDimension aDim,
TInt aIndex,
TReal32 aAvailablePixels,
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 aDim the dimension along which to calculate
TInt aIndex the block being calculated
TReal32 aAvailablePixels the space available within the grid layout, after the paddings and inner paddings have already been subtracted
TInt & aPos the resulting position in pixels of the block along the axis (replaces contents)
TInt & aSize the resulting size in pixels of the block along the axis (replaces contents)

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

void CalculateCellInPixelsReal ( THuiGridDimension aDim,
TInt aIndex,
TReal32 aAvailablePixels,
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 aDim the dimension along which to calculate
TInt aIndex the block being calculated
TReal32 aAvailablePixels the space available within the grid layout, after the paddings and inner paddings have already been subtracted
TReal32 & aPos the resulting position in pixels of the block along the axis (replaces contents)
TReal32 & aSize the resulting size in pixels of the block along the axis (replaces contents)
TInt & aFloorPixelPos the total width assuming every item width is floored.
TInt & aCeilingPixelPos the total width assuming every item width is ceilinged.

Changed()

IMPORT_C TBool Changed ( ) const [virtual]

ChildOrdinal(TInt)

IMPORT_C TInt ChildOrdinal ( TInt aIndex ) [virtual]

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

Parameters

TInt aIndex Index of the child visual.

ChildPos(TInt, TPoint &)

IMPORT_C TBool ChildPos ( TInt aOrdinal,
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 aOrdinal Layout ordinal of the child visual.
TPoint & aPos New position for the child. This goes to CHuiVisual::SetPos() with no conversions.

ChildRect(TInt, THuiRealRect &)

IMPORT_C TInt ChildRect ( TInt aOrdinal,
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 aOrdinal Layout ordinal of the child visual.
THuiRealRect & aRect New position for the child. This is used to set the child size and position with no conversions.

ChildSize(TInt, TSize &)

IMPORT_C TBool ChildSize ( TInt aOrdinal,
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 aOrdinal Layout ordinal of the child visual.
TSize & aSize New target size for the child. This goes to CHuiVisual::SetSize() with no conversions.

ClearChanged()

IMPORT_C void ClearChanged ( ) [virtual]

ClearLayoutModeFlags(THuiGridDimension, TUint)

IMPORT_C void ClearLayoutModeFlags ( THuiGridDimension aDim,
TUint aGridLayoutModeFlags
)

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

TAlfGridLayoutModeFlags , SetLayoutModeFlags

Parameters

THuiGridDimension aDim the dimension to which the given flag(s) affect.
TUint aGridLayoutModeFlags Flags to be cleared

ColumnCount()

IMPORT_C TInt ColumnCount ( ) const

Return the number of columns in this grid.

ConstructL()

IMPORT_C void ConstructL ( ) [virtual]

From CHuiLayout , deriving class must implement base call

Count()

IMPORT_C TInt Count ( ) const [virtual]

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

DimensionCount(THuiGridDimension)

IMPORT_C TInt DimensionCount ( THuiGridDimension aDim ) const

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

Since
S60 3.2

Parameters

THuiGridDimension aDim the dimension along which to count

Draw(CHuiGc &)

IMPORT_C void Draw ( 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 void DrawSelf ( 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 void DumpTree ( ) const [virtual]

ExpandRectWithContent(TRect &)

IMPORT_C void ExpandRectWithContent ( 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 & aRect Dirty region.

FillWeightsL(THuiGridDimension, TInt, const THuiMetric &)

IMPORT_C void FillWeightsL ( THuiGridDimension aDim,
TInt aCount,
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 aDim the dimension along which to fill
TInt aCount The number of lines of blocks to fill
const THuiMetric & aWeight the 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 & 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 (:).

GetClassName(TDes &)

IMPORT_C void GetClassName ( TDes & aName ) const [virtual]

Returns the name of the class.

Parameters

TDes & aName Name of the visual class.

GetInstanceName(TDes &)

IMPORT_C void GetInstanceName ( TDes & aName ) const [virtual]

Parameters

TDes & aName

InsertWeightL(THuiGridDimension, const THuiMetric &, TInt)

IMPORT_C void InsertWeightL ( THuiGridDimension aDim,
const THuiMetric & aWeight,
TInt aPos
)

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 aDim the dimension to which the weight corresponds
const THuiMetric & aWeight the weight to be used for the block in the specified dimension, replacing any previously existing weight for that block
TInt aPos the index of the block

LayoutModeFlags(THuiGridDimension)

IMPORT_C TUint LayoutModeFlags ( THuiGridDimension aDim )

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

Parameters

THuiGridDimension aDim the dimension to return the flags for.

NotifySkinChangedL()

IMPORT_C void NotifySkinChangedL ( ) [virtual]

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

OrdinalToBlock(TInt)

IMPORT_C TPoint OrdinalToBlock ( TInt aOrdinal ) 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 aOrdinal Ordinal of a child.

PrepareDrawL()

IMPORT_C TBool PrepareDrawL ( ) [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 ( THuiGridDimension aDim,
TReal32 aInnerPadPos,
TReal32 aOuterPadPos
) 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 aDim the dimension along which to calculate
TReal32 aInnerPadPos the calculated position if inner padding is applied
TReal32 aOuterPadPos the calculated position if outer padding is applied

RemoveAndDestroyAllD()

IMPORT_C void RemoveAndDestroyAllD ( ) [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 void RemoveWeightL ( THuiGridDimension aDim,
TInt aPos
)

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 aDim the dimension to which the weight corresponds
TInt aPos the index of the cell

ReplaceWeightL(THuiGridDimension, const THuiMetric &, TInt)

IMPORT_C void ReplaceWeightL ( THuiGridDimension aDim,
const THuiMetric & aWeight,
TInt aPos
)

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 aDim the dimension to which the weight corresponds
const THuiMetric & aWeight the weight to be used for the block in the specified dimension, replacing any previously existing weight for that cell
TInt aPos the index of the cell

ReportChanged()

IMPORT_C void ReportChanged ( ) [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 TInt RowCount ( ) const

Return the number of rows in this grid.

SessionId()

IMPORT_C TInt SessionId ( ) const

Gets the session id for object.

SetColumnsL(TInt)

IMPORT_C void SetColumnsL ( TInt aColumnCount )

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 aColumnCount The number of columns.

SetColumnsL(const RArray< TInt > &)

IMPORT_C void SetColumnsL ( 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 > & aWeights An array containing weights for each column.

SetExpanding(TInt)

IMPORT_C void SetExpanding ( TInt aFlags )

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 aFlags Determines the expansion direction.

SetLayoutModeFlags(THuiGridDimension, TUint)

IMPORT_C void SetLayoutModeFlags ( THuiGridDimension aDim,
TUint aGridLayoutModeFlags
)

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 aDim the dimension to which the given flag(s) affect.
TUint aGridLayoutModeFlags Flags to be set or cleared

SetPos(const THuiRealPoint &, TInt)

IMPORT_C void SetPos ( const THuiRealPoint & aPos,
TInt aTransitionTime = 0
) [virtual]

From CHuiVisual . Sets the position of the layout.

Parameters

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

SetRowsL(TInt)

IMPORT_C void SetRowsL ( TInt aRowCount )

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 aRowCount The number of rows.

SetRowsL(const RArray< TInt > &)

IMPORT_C void SetRowsL ( 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 > & aWeights An array containing weights for each row.

SetSessionId(TInt)

IMPORT_C void SetSessionId ( TInt aSessionId )

Sets the session id for object.

Parameters

TInt aSessionId

SetSize(const THuiRealSize &, TInt)

IMPORT_C void SetSize ( const THuiRealSize & aSize,
TInt aTransitionTime = 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 & aSize Size to set the layout to.
TInt aTransitionTime = 0

Type()

IMPORT_C TType Type ( ) const

Gets the object type.

UpdateChildrenLayout(TInt)

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

From CHuiVisual . 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.

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 ( TInt aIndex ) const [virtual]

From CHuiVisual . Returns a child visual.

Parameters

TInt aIndex Index of the child visual.

VisualExtension(const TUid &, TAny **)

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

! From HuiVisual

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

Weight(THuiGridDimension, TInt)

IMPORT_C THuiMetric Weight ( THuiGridDimension aDim,
TInt aPos
) 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 aDim the dimension to which the weight corresponds
TInt aPos the index of the cell

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

void WeightFromMetric ( THuiGridDimension aDim,
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 aDim the dimension along which to calculate
THuiMetric & aMetric The metric to examine
TReal32 & aWeight Contains weight from metric.
TInt & aPix Contains pixel size from metric.

Member Data Documentation

TGridLayoutPrivateData * iGridLayoutData

TGridLayoutPrivateData * iGridLayoutData [private]

TAny * iSpare

TAny * iSpare [private]