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 voidaddSourceValue(AlfAttributeValueType *)
OSN_IMPORT voidaddTargetValue(AlfAttributeValueType *)
OSN_IMPORT attributecategorycategory()
OSN_IMPORT AlfAttribute *clone()
OSN_IMPORT const char *getDataField()
OSN_IMPORT intgetDelay()
OSN_IMPORT TAlfInterpolationStylegetInterpolationStyle()
OSN_IMPORT intgetMappingFunctionId()
OSN_IMPORT AlfAttributeValueType *getSourceValue(unsigned int)
OSN_IMPORT unsigned intgetSourceValueCount()
OSN_IMPORT AlfAttributeValueType *getTargetValue(unsigned int)
OSN_IMPORT unsigned intgetTargetValueCount()
OSN_IMPORT intgetTime()
OSN_IMPORT intintValue(unsigned int)
OSN_IMPORT boolisDirty()
OSN_IMPORT boolisValueSet()
OSN_IMPORT const char *name()
OSN_IMPORT AlfAttribute &operator=(const AlfAttribute &)
OSN_IMPORT floatrealValue(unsigned int)
OSN_IMPORT voidremoveSourceValue(unsigned int)
OSN_IMPORT voidremoveTargetValue(unsigned int)
OSN_IMPORT voidsetDataField(const char *)
OSN_IMPORT voidsetDelay(int)
OSN_IMPORT voidsetDirty(bool)
OSN_IMPORT voidsetInterpolationStyle(TAlfInterpolationStyle)
OSN_IMPORT voidsetMappingFunctionId(int)
OSN_IMPORT voidsetSourceValue(AlfAttributeValueType *, unsigned int)
OSN_IMPORT voidsetTargetValue(AlfAttributeValueType *, unsigned int)
OSN_IMPORT voidsetTime(int)
OSN_IMPORT const UString &stringValue(unsigned int)
OSN_IMPORT AlfAttributeValueType::Typetype(unsigned int)
OSN_IMPORT TAlfUnitunit(unsigned int)
Private Member Functions
AlfAttribute(const AlfAttribute &)
AlfAttributeValueType *cloneValueType(AlfAttributeValueType *)
voidreset(const char *, AlfAttributeValueType *, attributecategory)
Public Member Enumerations
enumattributecategory { EStatic, EDynamic, EStaticData, EDynamicData }
Private Attributes
auto_ptr< AlfAttributeImpl >mData

Constructor & Destructor Documentation

AlfAttribute()

OSN_IMPORTAlfAttribute()
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

AlfAttribute(const char *, attributecategory)

OSN_IMPORTAlfAttribute(const char *aName,
attributecategoryaCategory
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aNameAttribute name. Makes a copy of the name.
attributecategory aCategoryAttribute category.

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

OSN_IMPORTAlfAttribute(const char *aName,
intaTargetValue,
TAlfUnitaUnit = EAlfUnitPixel,
attributecategoryaCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aNameAttribute name. Makes a copy of the name.
int aTargetValueThe target value of the child attribute.
TAlfUnit aUnit = EAlfUnitPixelUnit of the value.
attributecategory aCategory = EStaticAttribute category.

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

OSN_IMPORTAlfAttribute(const char *aName,
floataTargetValue,
TAlfUnitaUnit = EAlfUnitNormalized,
attributecategoryaCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aNameAttribute name. Makes a copy of the name.
float aTargetValueThe target value of the child attribute.
TAlfUnit aUnit = EAlfUnitNormalizedUnit of the value.
attributecategory aCategory = EStaticAttribute category.

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

OSN_IMPORTAlfAttribute(const char *aName,
const UString &aTargetValue,
attributecategoryaCategory = EStatic
)
Constructor.
Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

const char * aNameAttribute name. Makes a copy of the name.
const UString & aTargetValueThe target value of the child attribute. Makes a copy of the value.
attributecategory aCategory = EStaticAttribute 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 voidaddSourceValue(AlfAttributeValueType *aValue)

Adds a new source value to the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValueNew value to be added.

addTargetValue(AlfAttributeValueType *)

OSN_IMPORT voidaddTargetValue(AlfAttributeValueType *aValue)

Adds a new target value to the attribute.

Since
S60 ?S60_version

Parameters

AlfAttributeValueType * aValueNew value to be added.

category()

OSN_IMPORT attributecategorycategory()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 * aValueThe source attribute value.

getDataField()

OSN_IMPORT const char *getDataField()const

Gets the datafield for the attribute.

Since
S60 ?S60_version

getDelay()

OSN_IMPORT intgetDelay()const

Gets the delay before the transition.

Since
S60 ?S60_version

getInterpolationStyle()

OSN_IMPORT TAlfInterpolationStylegetInterpolationStyle()const

Gets the interpolation style of the attribute.

Since
S60 ?S60_version

getMappingFunctionId()

OSN_IMPORT intgetMappingFunctionId()const

Gets the mapping function id for the attribute.

Since
S60 ?S60_version

getSourceValue(unsigned int)

OSN_IMPORT AlfAttributeValueType *getSourceValue(unsigned intaIndex = 0)const

Gets the source value of the attribute.

Since
S60 ?S60_version

Parameters

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

getSourceValueCount()

OSN_IMPORT unsigned intgetSourceValueCount()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 intaIndex = 0)const

Gets the target value of the attribute.

Since
S60 ?S60_version

Parameters

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

getTargetValueCount()

OSN_IMPORT unsigned intgetTargetValueCount()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 intgetTime()const

Gets the transition time for the attribute.

intValue(unsigned int)

OSN_IMPORT intintValue(unsigned intaIndex = 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 = 0The index of the attribute value.

isDirty()

OSN_IMPORT boolisDirty()const

Gets the dirty information

Since
S60 ?S60_version

isValueSet()

OSN_IMPORT boolisValueSet()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 & aAttributeThe source attribute.

realValue(unsigned int)

OSN_IMPORT floatrealValue(unsigned intaIndex = 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 = 0The index of the attribute value.

removeSourceValue(unsigned int)

OSN_IMPORT voidremoveSourceValue(unsigned intaIndex = 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 = 0The index of the attribute value.

removeTargetValue(unsigned int)

OSN_IMPORT voidremoveTargetValue(unsigned intaIndex = 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 = 0The index of the attribute value.

reset(const char *, AlfAttributeValueType *, attributecategory)

voidreset(const char *aName,
AlfAttributeValueType *aValue,
attributecategoryaCategory
)[private]

Resets the data.

Since
S60 ?S60_version

Parameters

const char * aNameAttribute name.
AlfAttributeValueType * aValueThe value of the attribute.
attributecategory aCategoryAttribute category.

setDataField(const char *)

OSN_IMPORT voidsetDataField(const char *aDataField)

Sets the datafield for the attribute.

Since
S60 ?S60_version

Parameters

const char * aDataFieldThe datafield for the attribute.

setDelay(int)

OSN_IMPORT voidsetDelay(intaDelay)

Sets the delay before the transition.

Since
S60 ?S60_version

Parameters

int aDelayThe delay before the transition.

setDirty(bool)

OSN_IMPORT voidsetDirty(boolaFlag)

Sets the dirty information

Since
S60 ?S60_version

Parameters

bool aFlag

setInterpolationStyle(TAlfInterpolationStyle)

OSN_IMPORT voidsetInterpolationStyle(TAlfInterpolationStyleaInterpolationStyle)

Sets the interpolation style of the attribute.

Since
S60 ?S60_version

Parameters

TAlfInterpolationStyle aInterpolationStyleThe interpolation style.

setMappingFunctionId(int)

OSN_IMPORT voidsetMappingFunctionId(intaId)

Sets the mapping function id for the attribute.

Since
S60 ?S60_version

Parameters

int aIdThe mapping function id for the attribute.

setSourceValue(AlfAttributeValueType *, unsigned int)

OSN_IMPORT voidsetSourceValue(AlfAttributeValueType *aValue,
unsigned intaIndex = 0
)

Sets the source value of the attribute.

Since
S60 ?S60_version

Parameters

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

setTargetValue(AlfAttributeValueType *, unsigned int)

OSN_IMPORT voidsetTargetValue(AlfAttributeValueType *aValue,
unsigned intaIndex = 0
)

Sets the target value of the attribute.

Since
S60 ?S60_version

Parameters

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

setTime(int)

OSN_IMPORT voidsetTime(intaTime)

Sets the transition time for the attribute.

Since
S60 ?S60_version

Parameters

int aTimeThe transition time for the attribute.

stringValue(unsigned int)

OSN_IMPORT const UString &stringValue(unsigned intaIndex = 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 = 0The index of the attribute value.

type(unsigned int)

OSN_IMPORT AlfAttributeValueType::Typetype(unsigned intaIndex = 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 TAlfUnitunit(unsigned intaIndex = 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 = 0The 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]