TAlfTimedValue Class Reference
Timed value class.
Timed values are able to interpolate their value independently based on time. The interpolation can be configured to follow a curve instead of being linear. Timed value does not restrict the value units but interpolates on any given real value. Mapping function can be used that maps the interpolated values to some other real value space. If no mapping function is specified an identity mapping is used. Current values and target values of timed value can be set through class methods. Delays for timed value to achieve the target value can be given in the Set - method. Timed value supports number of different interpolation styles.
// Here are some examples how the timed value can be used.
// In the examples, the opacity of the visual is used as
// an example, but any of the timed values work the same.
// #1 New variable - getters are not really relevant
TAlfTimedValue opacity;
opacity->SetTarget( 1, 500 );
visual->SetOpacity( opacity ); // changes only the target
// 2# Data fetching
// a) preferred
const TAlfTimedValue& opacity = visual->Opacity();
TReal32 valueNow = opacity->ValueNow();
TReal32 target = opacity->Target();
// b)
TReal32 valueNow = visual->Opacity().ValueNow();
TReal32 target = visual->Opacity().Target();
// 3# Data fetching and value update
TAlfTimedValue opacity( visual->Opacity() );
TReal32 target = opacity->Target();
opacity->SetTarget( target*2, 500 );
visual->SetOpacity( opacity );
// 4# Use the same timed value for other places:
// a)
const TAlfTimedValue& visualOpacity = visual->Opacity();
layout->SetOpacity( visualOpacity );
// b)
TAlfTimedValue visualOpacity( visual->Opacity() );
visualOpacity->SetTarget( 1, 500 );
layout->SetOpacity( visualOpacity );
alfclient.lib
- Since
- S60 v3.2
Constructor & Destructor Documentation
TAlfTimedValue()
Constructor. Enables creation of timed value with no explicitly set initial value. The timed value is set to zero.
TAlfTimedValue(TReal32)
IMPORT_C | TAlfTimedValue | ( | TReal32 | aInitialValue | ) | |
Constructor. Enables initial value setting.
Parameters
TReal32 aInitialValue | Initial value. |
TAlfTimedValue(TReal32, TInt)
IMPORT_C | TAlfTimedValue | ( | TReal32 | aTargetValue, |
| TInt | aTime |
| ) | |
Constructor. Enables target value setting.
Parameters
TReal32 aTargetValue | Target value. |
TInt aTime | When the target value will be in effect. Transition duration in milliseconds. |
Member Functions Documentation
MappingFunctionIdentifier()
IMPORT_C TInt | MappingFunctionIdentifier | ( | ) | const |
Gets identifier of a mapping function that affects the timed value.
SetMappingFunctionIdentifier(TInt)
IMPORT_C void | SetMappingFunctionIdentifier | ( | TInt | aIdentifier | ) | |
Sets identifier of a mapping function that affects the timed value.
Parameters
TInt aIdentifier | Identifier of a function that will map the current value to required number space. |
SetStyle(TAlfInterpolationStyle)
Sets the interpolation style of the timed value.
SetTarget(const TReal32 &, TInt)
IMPORT_C void | SetTarget | ( | const TReal32 & | aTarget, |
| TInt | aTime |
| ) | |
Parameters
const TReal32 & aTarget | |
TInt aTime | Time duration after the target value will be in effect. Transition duration in milliseconds. |
SetTargetWithSpeed(TReal32, TReal32)
IMPORT_C void | SetTargetWithSpeed | ( | TReal32 | aTarget, |
| TReal32 | aUnitsPerSecond |
| ) | |
Sets a new target value. The transition time depends on the speed. SetTarget()
Parameters
TReal32 aTarget | New target value. |
TReal32 aUnitsPerSecond | Speed of change. |
SetValueNow(const TReal32 &)
IMPORT_C void | SetValueNow | ( | const TReal32 & | aValueNow | ) | |
Set a new current value Change becomes effective immediately.
Parameters
const TReal32 & aValueNow | New currentvalue. |
Speed()
Gets speed of the transition in units per second if it has been set with SetTargetWithSpeed.
Style()
Gets the interpolation style of the timed value.
TimeToTargetinMilliSeconds()
IMPORT_C TInt | TimeToTargetinMilliSeconds | ( | ) | const |
Gets duration of the transition.
Member Data Documentation
TInt
iInterpolationStyle
TInt
| iInterpolationStyle | [private] |
TInt
iMappingFunctionIdentifier
TInt
| iMappingFunctionIdentifier | [private] |
TInt
iTimeToTarget
TInt
| iTimeToTarget | [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.