Alf::AlfAttribute Class Reference

class Alf::AlfAttribute
Class for holding attributes. AlfAttribute is a receptacle for holding data that can be applied to visuals/visual templates via the attribute setters. They can also be used hold data for properties of widgets or widget parts implement the IAlfAttributeOwner interface. An attribute can have one or more attribute value types. Attributes can be bunched together in attribute containers. IAlfAttributeSetter IAlfAttributeOwner AlfAttributeValueType AlfAtributeContainer alfwidgetmodel.lib
Since
S60 ?S60_version Draft
Public Member Functions
AlfAttribute ()
AlfAttribute (const char *, attributecategory )
AlfAttribute (const char *, int, TAlfUnit , attributecategory )
AlfAttribute (const char *, float, TAlfUnit , attributecategory )
AlfAttribute (const char *, const UString &, attributecategory )
~AlfAttribute ()
OSN_IMPORT void addSourceValue ( AlfAttributeValueType *)
OSN_IMPORT void addTargetValue ( AlfAttributeValueType *)
OSN_IMPORT attributecategory category ()
OSN_IMPORT AlfAttribute * clone ()
OSN_IMPORT const char * getDataField ()
OSN_IMPORT int getDelay ()
OSN_IMPORT TAlfInterpolationStyle getInterpolationStyle ()
OSN_IMPORT int getMappingFunctionId ()
OSN_IMPORT AlfAttributeValueType * getSourceValue (unsigned int)
OSN_IMPORT unsigned int getSourceValueCount ()
OSN_IMPORT AlfAttributeValueType * getTargetValue (unsigned int)
OSN_IMPORT unsigned int getTargetValueCount ()
OSN_IMPORT int getTime ()
OSN_IMPORT int intValue (unsigned int)
OSN_IMPORT bool isDirty ()
OSN_IMPORT bool isValueSet ()
OSN_IMPORT const char * name ()
OSN_IMPORT AlfAttribute & operator= (const AlfAttribute &)
OSN_IMPORT float realValue (unsigned int)
OSN_IMPORT void removeSourceValue (unsigned int)
OSN_IMPORT void removeTargetValue (unsigned int)
OSN_IMPORT void setDataField (const char *)
OSN_IMPORT void setDelay (int)
OSN_IMPORT void setDirty (bool)
OSN_IMPORT void setInterpolationStyle ( TAlfInterpolationStyle )
OSN_IMPORT void setMappingFunctionId (int)
OSN_IMPORT void setSourceValue ( AlfAttributeValueType *, unsigned int)
OSN_IMPORT void setTargetValue ( AlfAttributeValueType *, unsigned int)
OSN_IMPORT void setTime (int)
OSN_IMPORT const UString & stringValue (unsigned int)
OSN_IMPORT AlfAttributeValueType::Type type (unsigned int)
OSN_IMPORT TAlfUnit unit (unsigned int)
Private Member Functions
AlfAttribute (const AlfAttribute &)
AlfAttributeValueType * cloneValueType ( AlfAttributeValueType *)
void reset (const char *, AlfAttributeValueType *, attributecategory )
Public Member Enumerations
enum attributecategory { EStatic , EDynamic , EStaticData , EDynamicData }
Private Attributes
auto_ptr< AlfAttributeImpl > mData

Constructor & Destructor Documentation

AlfAttribute()

OSN_IMPORT AlfAttribute ( )
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

AlfAttribute(const char *, attributecategory)

OSN_IMPORT AlfAttribute ( const char * aName,
attributecategory aCategory
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aName Attribute name. Makes a copy of the name.
attributecategory aCategory Attribute category.

AlfAttribute(const char *, int, TAlfUnit, attributecategory)

OSN_IMPORT AlfAttribute ( const char * aName,
int aTargetValue,
TAlfUnit aUnit = EAlfUnitPixel,
attributecategory aCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aName Attribute name. Makes a copy of the name.
int aTargetValue The target value of the child attribute.
TAlfUnit aUnit = EAlfUnitPixel Unit of the value.
attributecategory aCategory = EStatic Attribute category.

AlfAttribute(const char *, float, TAlfUnit, attributecategory)

OSN_IMPORT AlfAttribute ( const char * aName,
float aTargetValue,
TAlfUnit aUnit = EAlfUnitNormalized,
attributecategory aCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aName Attribute name. Makes a copy of the name.
float aTargetValue The target value of the child attribute.
TAlfUnit aUnit = EAlfUnitNormalized Unit of the value.
attributecategory aCategory = EStatic Attribute category.

AlfAttribute(const char *, const UString &, attributecategory)

OSN_IMPORT AlfAttribute ( const char * aName,
const UString & aTargetValue,
attributecategory aCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aName Attribute name. Makes a copy of the name.
const UString & aTargetValue The target value of the child attribute. Makes a copy of the value.
attributecategory aCategory = EStatic Attribute category.

AlfAttribute(const AlfAttribute &)

AlfAttribute ( const AlfAttribute & attribute ) [private]

Declaring private copy construction to prevent usage.

Since
S60 ?S60_version

Parameters

const AlfAttribute & attribute

~AlfAttribute()

OSN_IMPORT ~AlfAttribute ( ) [virtual]

Destructor.

Member Functions Documentation

addSourceValue(AlfAttributeValueType *)

OSN_IMPORT void addSourceValue ( AlfAttributeValueType * aValue )

Adds a new source value to the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValue New value to be added.

addTargetValue(AlfAttributeValueType *)

OSN_IMPORT void addTargetValue ( AlfAttributeValueType * aValue )

Adds a new target value to the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValue New value to be added.

category()

OSN_IMPORT attributecategory category ( ) const

Gets the category of the attribute.

Since
S60 ?S60_version

clone()

OSN_IMPORT AlfAttribute * clone ( )
Clones the attribute.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

cloneValueType(AlfAttributeValueType *)

AlfAttributeValueType * cloneValueType ( AlfAttributeValueType * aValue ) const [private]
Helper function for cloning value type.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValue The source attribute value.

getDataField()

OSN_IMPORT const char * getDataField ( ) const

Gets the datafield for the attribute.

Since
S60 ?S60_version

getDelay()

OSN_IMPORT int getDelay ( ) const

Gets the delay before the transition.

Since
S60 ?S60_version

getInterpolationStyle()

OSN_IMPORT TAlfInterpolationStyle getInterpolationStyle ( ) const

Gets the interpolation style of the attribute.

Since
S60 ?S60_version

getMappingFunctionId()

OSN_IMPORT int getMappingFunctionId ( ) const

Gets the mapping function id for the attribute.

Since
S60 ?S60_version

getSourceValue(unsigned int)

OSN_IMPORT AlfAttributeValueType * getSourceValue ( unsigned int aIndex = 0 ) const

Gets the source value of the attribute.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

getSourceValueCount()

OSN_IMPORT unsigned int getSourceValueCount ( ) const
Gets source value count.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

getTargetValue(unsigned int)

OSN_IMPORT AlfAttributeValueType * getTargetValue ( unsigned int aIndex = 0 ) const

Gets the target value of the attribute.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

getTargetValueCount()

OSN_IMPORT unsigned int getTargetValueCount ( ) const
Gets target value count.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

getTime()

OSN_IMPORT int getTime ( ) const

Gets the transition time for the attribute.

intValue(unsigned int)

OSN_IMPORT int intValue ( unsigned int aIndex = 0 ) const
Gets the int target value. Use this method only if the attribute type is EInt.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

isDirty()

OSN_IMPORT bool isDirty ( ) const

Gets the dirty information

Since
S60 ?S60_version

isValueSet()

OSN_IMPORT bool isValueSet ( ) const

Returns true if the attribute value is set.

Since
S60 ?S60_version

name()

OSN_IMPORT const char * name ( ) const

Gets the name of the attribute.

Since
S60 ?S60_version

operator=(const AlfAttribute &)

OSN_IMPORT AlfAttribute & operator= ( const AlfAttribute & aAttribute )
Assignment operation. Assigns all the member variables to the values in the reference attribute.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const AlfAttribute & aAttribute The source attribute.

realValue(unsigned int)

OSN_IMPORT float realValue ( unsigned int aIndex = 0 ) const
Gets the real target value. Use this method only if the attribute type is EFloat.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

removeSourceValue(unsigned int)

OSN_IMPORT void removeSourceValue ( unsigned int aIndex = 0 )
Removes the source value of the attribute.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

removeTargetValue(unsigned int)

OSN_IMPORT void removeTargetValue ( unsigned int aIndex = 0 )
Removes the target value of the attribute.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

reset(const char *, AlfAttributeValueType *, attributecategory)

void reset ( const char * aName,
AlfAttributeValueType * aValue,
attributecategory aCategory
) [private]

Resets the data.

Since
S60 ?S60_version

Parameters

const char * aName Attribute name.
AlfAttributeValueType * aValue The value of the attribute.
attributecategory aCategory Attribute category.

setDataField(const char *)

OSN_IMPORT void setDataField ( const char * aDataField )

Sets the datafield for the attribute.

Since
S60 ?S60_version

Parameters

const char * aDataField The datafield for the attribute.

setDelay(int)

OSN_IMPORT void setDelay ( int aDelay )

Sets the delay before the transition.

Since
S60 ?S60_version

Parameters

int aDelay The delay before the transition.

setDirty(bool)

OSN_IMPORT void setDirty ( bool aFlag )

Sets the dirty information

Since
S60 ?S60_version

Parameters

bool aFlag

setInterpolationStyle(TAlfInterpolationStyle)

OSN_IMPORT void setInterpolationStyle ( TAlfInterpolationStyle aInterpolationStyle )

Sets the interpolation style of the attribute.

Since
S60 ?S60_version

Parameters

TAlfInterpolationStyle aInterpolationStyle The interpolation style.

setMappingFunctionId(int)

OSN_IMPORT void setMappingFunctionId ( int aId )

Sets the mapping function id for the attribute.

Since
S60 ?S60_version

Parameters

int aId The mapping function id for the attribute.

setSourceValue(AlfAttributeValueType *, unsigned int)

OSN_IMPORT void setSourceValue ( AlfAttributeValueType * aValue,
unsigned int aIndex = 0
)

Sets the source value of the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValue The source value of the attribute.
unsigned int aIndex = 0 The index of the attribute value.

setTargetValue(AlfAttributeValueType *, unsigned int)

OSN_IMPORT void setTargetValue ( AlfAttributeValueType * aValue,
unsigned int aIndex = 0
)

Sets the target value of the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValue The target value of the attribute.
unsigned int aIndex = 0 The index of the attribute value.

setTime(int)

OSN_IMPORT void setTime ( int aTime )

Sets the transition time for the attribute.

Since
S60 ?S60_version

Parameters

int aTime The transition time for the attribute.

stringValue(unsigned int)

OSN_IMPORT const UString & stringValue ( unsigned int aIndex = 0 ) const
Gets the string target value. Use this method only if the attribute type is EString.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

type(unsigned int)

OSN_IMPORT AlfAttributeValueType::Type type ( unsigned int aIndex = 0 ) const
Gets the type of the attribute.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0

unit(unsigned int)

OSN_IMPORT TAlfUnit unit ( unsigned int aIndex = 0 ) const [virtual]
Gets the unit of the value.
Exceptions
osncore::AlfAttributeException

Thrown with error code osncore::EInvalidAttribute if aIndex is invalid.

Since
S60 ?S60_version

Parameters

unsigned int aIndex = 0 The index of the attribute value.

Member Enumerations Documentation

Enum attributecategory

Enumerators

EStatic
EDynamic
EStaticData
EDynamicData

Member Data Documentation

auto_ptr< AlfAttributeImpl > mData

auto_ptr< AlfAttributeImpl > mData [private]