class CAlfLineVisual : public CAlfVisual |
Line visual draws a line along a curve path.
A line visual will draw a bendy line that follows a specified curve path. Width and alpha functions can be set to change the opacity and thickness of the line along its length.
Note that the Bitgdi renderer contains only a minimal implementation of line drawing. There is no aliasing or shading on the line, and thickness and alpha functions have no effect. The entire thickness of a Bitgdi line is set by the initial thickness at point 0. Usage:
//Create curvepath, which can be used as a path for linevisual CAlfCurvePath* path = CAlfCurvePath::NewL( &iEnv ); path->AppendArcL( TPoint(120, 120), TSize(60, 60), 180, 180 + 270, 0.5 ); path->AppendLineL( TPoint(120, 180), TPoint(20, 180), 0.5 ); //Create linevisual CAlfLineVisual* line = CAlfLineVisual::AddNewL( control ); //set curvepath instance, with ownership transfered to visual line->SetPath( path, EAlfHasOwnership ); //Line opacity function. Line visuals can use a mapping function to determine the opacity //of the line along the path. //member variable : LinearMappingFunction linearFunc; linearFunc.SetFactor( 1 ); //setlinevisual alpha function line->SetAlphaFunction( &linearFunc ); //Similerly, line visuals can use a mapping function to determine the width of the //line along the path. linearFunc.SetFactor( 60 ); line->SetWidthFunction( &linearFunc ); *
Public Member Functions | |
---|---|
CAlfLineVisual () | |
~CAlfLineVisual () | |
IMPORT_C CAlfLineVisual * | AddNewL ( CAlfControl &, CAlfLayout *) |
IMPORT_C void | ConstructL ( CAlfControl &) |
IMPORT_C const TAlfTimedValue & | EndPos () |
IMPORT_C CAlfVisual * | FindTag (const TDesC8 &) |
IMPORT_C const TAlfImage & | Image () |
IMPORT_C CAlfCurvePath * | Path () |
IMPORT_C void | RemoveAndDestroyAllD () |
IMPORT_C void | SetAlphaFunction ( MAlfMappingFunction *) |
IMPORT_C void | SetColor (const TRgb &) |
IMPORT_C void | SetEndPos (const TAlfTimedValue &) |
IMPORT_C void | SetImage (const TAlfImage &) |
IMPORT_C void | SetPath (CAlfCurvePath *, TAlfOwnership ) |
IMPORT_C void | SetShadowThickness (const TAlfTimedValue &) |
IMPORT_C void | SetStartPos (const TAlfTimedValue &) |
IMPORT_C void | SetThickness (const TAlfTimedValue &) |
IMPORT_C void | SetWidthFunction ( MAlfMappingFunction *) |
IMPORT_C const TAlfTimedValue & | ShadowThickness () |
IMPORT_C const TAlfTimedValue & | StartPos () |
IMPORT_C const TAlfTimedValue & | Thickness () |
IMPORT_C void | UpdateChildrenLayout ( TInt ) |
Protected Member Functions | |
---|---|
IMPORT_C void | DoRemoveAndDestroyAllD () |
IMPORT_C void | PropertyOwnerExtension (const TUid &, TAny **) |
Private Attributes | |
---|---|
TLineVisualPrivateData * | iLineVisualData |
IMPORT_C CAlfLineVisual * | AddNewL | ( | CAlfControl & | aOwnerControl, |
CAlfLayout * | aParentLayout = 0 | |||
) | [static] |
Constructor, which gives ownership to the control.
CAlfControl & aOwnerControl | The control |
CAlfLayout * aParentLayout = 0 | If given, the parent layout. |
IMPORT_C void | ConstructL | ( | CAlfControl & | aOwner | ) | [virtual] |
Second-phase constructor.
CAlfControl & aOwner |
IMPORT_C void | DoRemoveAndDestroyAllD | ( | ) | [protected, virtual] |
From CAlfVisual CAlfVisual
IMPORT_C CAlfVisual * | FindTag | ( | const TDesC8 & | aTag | ) | [virtual] |
Finds a visual whose tag descriptor contains a specific tag.
CAlfVisual::FindTag() is the basic implementation that checks if this visual's tag matches the specified 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() CAlfLayout::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 CAlfCurvePath * | Path | ( | ) |
Returns the path of the visual. The path can be modified via this reference.
IMPORT_C void | PropertyOwnerExtension | ( | const TUid & | aExtensionUid, |
TAny ** | aExtensionParams | |||
) | [protected, virtual] |
! future proofing
IMPORT_C void | SetAlphaFunction | ( | MAlfMappingFunction * | aFunction | ) |
Sets the alpha mapping function that generates alpha values for the path.
MAlfMappingFunction * aFunction |
IMPORT_C void | SetColor | ( | const TRgb & | aColor | ) |
Sets the color of the line.
const TRgb & aColor |
IMPORT_C void | SetEndPos | ( | const TAlfTimedValue & | aEndPos | ) |
const TAlfTimedValue & aEndPos |
IMPORT_C void | SetImage | ( | const TAlfImage & | aImage | ) |
Sets the image used by the line.
const TAlfImage & aImage |
IMPORT_C void | SetPath | ( | CAlfCurvePath * | aPath, |
TAlfOwnership | aOwnership | |||
) |
Sets the path instance of the visual.
CAlfCurvePath * aPath | |
TAlfOwnership aOwnership |
IMPORT_C void | SetShadowThickness | ( | const TAlfTimedValue & | aShadowThickness | ) |
const TAlfTimedValue & aShadowThickness |
IMPORT_C void | SetStartPos | ( | const TAlfTimedValue & | aStartPos | ) |
const TAlfTimedValue & aStartPos |
IMPORT_C void | SetThickness | ( | const TAlfTimedValue & | aThickness | ) |
const TAlfTimedValue & aThickness |
IMPORT_C void | SetWidthFunction | ( | MAlfMappingFunction * | aFunction | ) |
Sets the width mapping function that generates width values for the path.
MAlfMappingFunction * aFunction |
IMPORT_C const TAlfTimedValue & | ShadowThickness | ( | ) | const |
Thickness of the shadow around the line.
IMPORT_C void | UpdateChildrenLayout | ( | TInt | aTransitionTime = 0 | ) | [virtual] |
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() |
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.