class CAlfCurvePathLayout : public CAlfLayout |
Curve path layout can be used to control size and position properties of a visual using a curve path object. CAlfCurvePathWhen using a curve path layout the user has to specify which properties of a visual should be controlled by the layout. By default the curve path layout does not affect any properties of its child visuals. Mapping function identifier retrieved through CAlfCurvePathLayout::MappingFunctionIdentifier() - method can be used to bind the curve path layout to properties of a visual.
The curve path layout contains a curve path instance that can be used to customize the path that is used to layout the properties of a visual. Reference to the curve path can be acquired through the CAlfCurvePathLayout::CurvePath() - method.
The following code example creates a curve path layout, sets its base unit to normalized (0.0 - 1.0) units, defines a curve path, binds the curve path layouting to image visual's position property and animates the position of the image visual on the curve path from start point of the curve path (0.0) to end point of the curve path (2.0) within 3 seconds. Notice that the curve path layout does not adjust the size of the image visual and because of that the image visual size is explicitly set to (0.25, 0.25). The size of the image visual is defined in base units of it's parent layout.
// Create a curve path layout CAlfCurvePathLayout* layout = CAlfCurvePathLayout::AddNewL(*this); layout->SetBaseUnit(TAlfMetric(1.0, EAlfUnitNormalized)); // Define a curve path CAlfCurvePath& curvePath = layout->CurvePath(); curvePath.AppendArcL(TAlfRealPoint(0.5, 0.5), TAlfRealSize(0.5, 0.5), 180.0, 360.0, 2.0); // Create an image visual CAlfImageVisual* imageVisual = CAlfImageVisual::AddNewL(*this, layout); imageVisual->SetSize(TAlfRealSize(0.25, 0.25)); CAlfTextureManager& defaultTexture = aEnv.TextureManager( ); CAlfTexture& texture = defaultTexture.LoadTextureL(_L("album4.jpg"),EAlfTextureFlagDefault,KAlfAutoGeneratedTextureId); imageVisual->SetImage(TAlfImage(texture)); // Control the position of the image visual with the curve path TAlfTimedPoint pos; pos.SetMappingFunctionIdentifier(layout->MappingFunctionIdentifier()); pos.SetTarget(2.0, 3000); imageVisual->SetPos(pos);
Public Member Functions | |
---|---|
CAlfCurvePathLayout() | |
~CAlfCurvePathLayout() | |
IMPORT_C CAlfCurvePathLayout * | AddNewL(CAlfControl &, CAlfLayout *) |
IMPORT_C TAlfXYMetric | BaseUnit() |
IMPORT_C void | ConstructL(CAlfControl &) |
IMPORT_C CAlfCurvePath & | CurvePath() |
IMPORT_C CAlfVisual * | FindTag(const TDesC8 &) |
IMPORT_C TReal32 | MapValue(TReal32, TInt) |
IMPORT_C TInt | MappingFunctionIdentifier() |
IMPORT_C void | RemoveAndDestroyAllD() |
IMPORT_C void | UpdateChildrenLayout(TInt) |
Protected Member Functions | |
---|---|
IMPORT_C void | DoRemoveAndDestroyAllD() |
IMPORT_C void | PropertyOwnerExtension(const TUid &, TAny **) |
Inherited Enumerations | |
---|---|
CAlfLayout:TExpansionFlags |
Private Attributes | |
---|---|
TCurvePathLayoutPrivateData * | iCurvePathLayoutData |
IMPORT_C CAlfCurvePathLayout * | AddNewL | ( | CAlfControl & | aOwner, |
CAlfLayout * | aParentLayout = 0 | |||
) | [static] |
2-phased constructor which also gives ownedship to control.
CAlfControl & aOwner | |
CAlfLayout * aParentLayout = 0 | If given, has the parent layout. |
IMPORT_C void | ConstructL | ( | CAlfControl & | aOwner | ) | [virtual] |
From CAlfLayout. Second-phase constructor.
CAlfControl & aOwner |
IMPORT_C CAlfCurvePath & | CurvePath | ( | ) |
Returns the curve path instance of the layout. The returned instance can be used to modify the curve path that is used to control the properties of a layed out visual. The curve path instance is defined in the base units used by this layout. CAlfCurvePathLayout::BaseUnit() CAlfCurvePathLayout::SetBaseUnit()
IMPORT_C void | DoRemoveAndDestroyAllD | ( | ) | [protected, virtual] |
From CAlfVisual CAlfVisual
IMPORT_C CAlfVisual * | FindTag | ( | const TDesC8 & | aTag | ) | [virtual] |
CAlfVisual Finds a visual whose tag descriptor contains a specific tag.
CAlfLayout::FindTag() extends the search into child visuals, covering recursively entire visual hierarchies.
Todo: how should several visuals with matching tag to be handled ??
CAlfVisual::Tag() CAlfVisual::SetTagL() CAlfVisual::IsTagged() CAlfVisual::FindTag()
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 (:). |
IMPORT_C void | PropertyOwnerExtension | ( | const TUid & | aExtensionUid, |
TAny ** | aExtensionParams | |||
) | [protected, virtual] |
! future proofing
IMPORT_C void | UpdateChildrenLayout | ( | TInt | aTransitionTime = 0 | ) | [virtual] |
CAlfVisual Update the layout of all children. Subclasses can call this to recalculate the layout of all children.
TInt aTransitionTime = 0 | Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime() |
TCurvePathLayoutPrivateData * | iCurvePathLayoutData | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.