CMPXMedia Class Reference

class CMPXMedia

Encapsulates arbitrary data. The ID is a unique identifier for the type of content contained within this object: there may be several supported IDs. Supported IDs provide a means whereby a client who receives a media object can request additional media objects from the same source using another of the supported IDs. Attributes are referenced by flags which are unique to the type of content contained in the object (i.e ID). The media object may contain the full range of attribute values or some subset, depending both on the attributes requested by the client and the capabilities of the source of the data.

mpxcommon.lib

Public Member Functions
~CMPXMedia()
IMPORT_C const TMPXAttribute &Attribute(TInt)
IMPORT_C const TArray< TMPXAttribute >Attributes()
IMPORT_C TUintAttributesSet(TInt)
IMPORT_C CMPXMedia *CopyL(const CMPXMedia &)
IMPORT_C TIntCount()
TInt Data()
IMPORT_C voidDelete(const TMPXAttribute &)
IMPORT_C voidDelete(TInt)
IMPORT_C TIntError(const TMPXAttribute &)
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidHeapMemoryInfoL(TInt &, TInt &)
IMPORT_C TIntIndex(const TMPXAttribute &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsSupported(const TMPXAttribute &)
IMPORT_C TBoolMatch(const CMPXMedia &, const TMPXAttribute &)
IMPORT_C voidMergeMediaL(const CMPXMedia &)
IMPORT_C CMPXMedia *NewL(const TArray< TInt > &)
IMPORT_C CMPXMedia *NewL()
IMPORT_C CMPXMedia *NewL(RReadStream &)
IMPORT_C CMPXMedia *NewL(const CMPXMedia &)
IMPORT_C CMPXMedia *NewL(TInt)
IMPORT_C voidReset()
voidSetCObjectValueL(const TMPXAttribute &, C *)
IMPORT_C voidSetErrorL(const TMPXAttribute &, TInt)
voidSetNoNewLCObjectL(const TMPXAttribute &, C *)
voidSetTObjectValueL(const TMPXAttribute &, T)
IMPORT_C voidSetTextValueL(const TMPXAttribute &, const TDesC &)
IMPORT_C const TArray< TInt >SupportedIds()
IMPORT_C TMPXAttributeTypeType(TInt)
IMPORT_C TMPXAttributeTypeType(const TMPXAttribute &)
T *Value(const TMPXAttribute &)
C *ValueCObjectL(const TMPXAttribute &)
C *ValueNoNewLCObjectL(const TMPXAttribute &)
TValueTObjectL(const TMPXAttribute &)
IMPORT_C const TDesC &ValueText(const TMPXAttribute &)
IMPORT_C CMPXMedia &operator=(const CMPXMedia &)
Private Member Functions
voidConstructL(const TArray< TInt > &)
voidConstructL(RReadStream &)
IMPORT_C TMPXAttributeTypeGetValue(const TMPXAttribute &, TDes8 &)
voidRefreshAttributes()
voidResetLocal()
IMPORT_C voidSetValueL(const TMPXAttribute &, const TDesC8 &, TMPXAttributeType)
TAny *ValueCObjectL(const TDesC8 &)
T *ValueL(const TDesC8 &)
IMPORT_C TAny *ValuePtr(const TMPXAttribute &)
Private Attributes
RArray< TMPXAttribute >iAttributes

Constructor & Destructor Documentation

~CMPXMedia()

IMPORT_C~CMPXMedia()

Destructor.

Since
S60 3.2.3

Member Functions Documentation

Attribute(TInt)

IMPORT_C const TMPXAttribute &Attribute(TIntaIndex)const

The attribute for a specific index.

Since
S60 3.2.3

Parameters

TInt aIndexthe index from 0 to Count()-1, covering all the values provided in this object

Attributes()

IMPORT_C const TArray< TMPXAttribute >Attributes()const

The attributes provided in this media object.

Since
S60 3.2.3

AttributesSet(TInt)

IMPORT_C TUintAttributesSet(TIntaContentId)const

The attributes set for a specific content id.

Since
S60 3.2.3

Parameters

TInt aContentIdcontent Id

ConstructL(const TArray< TInt > &)

voidConstructL(const TArray< TInt > &aSupportedIds)[private]

2nd phase contructor.

Since
S60 3.2.3

Parameters

const TArray< TInt > & aSupportedIdssupport content ids

ConstructL(RReadStream &)

voidConstructL(RReadStream &aStream)[private]

2nd phase contructor.

Since
S60 3.2.3

Parameters

RReadStream & aStreamread stream

CopyL(const CMPXMedia &)

IMPORT_C CMPXMedia *CopyL(const CMPXMedia &aMedia)[static]

Two-phased constructor. Creates new instance of CMPXMedia which duplicates underlying data from aMedia.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMediacreate object from media

Count()

IMPORT_C TIntCount()const

The number of attribute values provided in this media object.

Since
S60 3.2.3

Data()

TInt Data()const [inline]

A representation (handle) of the data stored in this object.

Since
S60 3.2.3

Delete(const TMPXAttribute &)

IMPORT_C voidDelete(const TMPXAttribute &aAttribute)

Deletes a given attribute and its value; No effect if attribute is not present.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute to delete

Delete(TInt)

IMPORT_C voidDelete(TIntaIndex)

Deletes a given attribute and its value; No effect if attribute is not present.

Since
S60 3.2.3

Parameters

TInt aIndexthe index from 0 to Count()-1

Error(const TMPXAttribute &)

IMPORT_C TIntError(const TMPXAttribute &aAttribute)const

Get the error code of an attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose error code is retrieved.

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalize media object.

Since
S60 3.2.3

Parameters

RWriteStream & aStreamwrite stream

GetValue(const TMPXAttribute &, TDes8 &)

IMPORT_C TMPXAttributeTypeGetValue(const TMPXAttribute &aAttribute,
TDes8 &aValue
)const [private]

Get the binary value for a specific attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried
TDes8 & aValue

HeapMemoryInfoL(TInt &, TInt &)

IMPORT_C voidHeapMemoryInfoL(TInt &aTotal,
TInt &aUsed
)[static]

Gets the total size and the currently used size of the global heap.

Since
S60 3.2.3

Parameters

TInt & aTotalTotal size of memory (out parameter)
TInt & aUsedUsed size of memory (out parameter)

Index(const TMPXAttribute &)

IMPORT_C TIntIndex(const TMPXAttribute &aAttribute)const

The index of a given attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe specified attribute

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalize media object.

Since
S60 3.2.3

Parameters

RReadStream & aStreamread stream

IsSupported(const TMPXAttribute &)

IMPORT_C TBoolIsSupported(const TMPXAttribute &aAttribute)const

Checks if this object contains the value for a given attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe specified attribute

Match(const CMPXMedia &, const TMPXAttribute &)

IMPORT_C TBoolMatch(const CMPXMedia &aMedia,
const TMPXAttribute &aAtt
)

Compares if the specified media's attribute matches this one.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMediaMedia object to match
const TMPXAttribute & aAttAttribute to match

MergeMediaL(const CMPXMedia &)

IMPORT_C voidMergeMediaL(const CMPXMedia &aMedia)

Merges in the attributes of the provided media.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMediaMedia object with attributes to merge in

NewL(const TArray< TInt > &)

IMPORT_C CMPXMedia *NewL(const TArray< TInt > &aSupportedIds)[static]

Two-phased constructor.

Since
S60 3.2.3

Parameters

const TArray< TInt > & aSupportedIds

NewL()

IMPORT_C CMPXMedia *NewL()[static]
Two-phased constructor.
Since
S60 3.2.3

NewL(RReadStream &)

IMPORT_C CMPXMedia *NewL(RReadStream &aStream)[static]

Two-phased constructor.

Since
S60 3.2.3

Parameters

RReadStream & aStreamcreate object from stream

NewL(const CMPXMedia &)

IMPORT_C CMPXMedia *NewL(const CMPXMedia &aMedia)[static]

Two-phased constructor. Creates new instance of CMPXMedia which shares underlying data from aMedia; lifetime of data is reference counted, i.e. all CMPXMedia instances which reference same data must be deleted before underlying data is deleted.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMediacreate object from media

NewL(TInt)

IMPORT_C CMPXMedia *NewL(TIntaDataHandle)[static]

Two-phased constructor. Creates object from existing data handle. The data handle is used to indentify the data in a media object.

Since
S60 3.2.3

Parameters

TInt aDataHandlehandle to the data

RefreshAttributes()

voidRefreshAttributes()[private]

Reconstructs local attribute array.

Since
S60 3.2.3

Reset()

IMPORT_C voidReset()

Clears all the attributes and values.

Since
S60 3.2.3

ResetLocal()

voidResetLocal()[private]

Frees all local data.

Since
S60 3.2.3

SetCObjectValueL(const TMPXAttribute &, C *)

voidSetCObjectValueL(const TMPXAttribute &aAttribute,
C *aValue
)[inline]

Add a new attribute value to this object, or modifies existing value if already present. Uses CTypeObject::NewL( RReadStream& aStream ).

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is added/modified
C * aValuepointer to the C object

SetErrorL(const TMPXAttribute &, TInt)

IMPORT_C voidSetErrorL(const TMPXAttribute &aAttribute,
TIntaError
)

Set an error code to an attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose error code is setted.
TInt aErrorerror code of the attribute. Note: if error code is set for an attribute, call to Value<T> for the attribute will return NULL. You MUST be careful to check the return value of Value<T>. The Value<T> is deprecated for this reason and you should use ValueTObject instead.

SetNoNewLCObjectL(const TMPXAttribute &, C *)

voidSetNoNewLCObjectL(const TMPXAttribute &aAttribute,
C *aValue
)[inline]

Add a new attribute value to this object, or modifies existing value if already present.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is added/modified
C * aValuepointer to the C object

SetTObjectValueL(const TMPXAttribute &, T)

voidSetTObjectValueL(const TMPXAttribute &aAttribute,
TaValue
)[inline]

Add a new attribute value to this object, or modifies existing value if already present.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is added/modified
T aValueattribute value of the T object.

SetTextValueL(const TMPXAttribute &, const TDesC &)

IMPORT_C voidSetTextValueL(const TMPXAttribute &aAttribute,
const TDesC &aValue
)

Add a new attribute value to this object, or modifies existing value if already present.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is added/modified
const TDesC & aValuetext value to be set

SetValueL(const TMPXAttribute &, const TDesC8 &, TMPXAttributeType)

IMPORT_C voidSetValueL(const TMPXAttribute &aAttribute,
const TDesC8 &aValue,
TMPXAttributeTypeaType
)[private]

Set data.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried
const TDesC8 & aValuethe value of the media attribute
TMPXAttributeType aTypeobject type of the media attribute

SupportedIds()

IMPORT_C const TArray< TInt >SupportedIds()const

Possible content IDs that denote the type of content the source of this object can supply.

Since
S60 3.2.3

Type(TInt)

IMPORT_C TMPXAttributeTypeType(TIntaIndex)const

The type of data stored for the index.

Since
S60 3.2.3

Parameters

TInt aIndexthe index whose type of value is queried

Type(const TMPXAttribute &)

IMPORT_C TMPXAttributeTypeType(const TMPXAttribute &aAttribute)const

The type of data stored for the attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose type of value is queried

Value(const TMPXAttribute &)

T *Value(const TMPXAttribute &aAttribute)const [inline]

The value for a specific attribute. it may return NULL

This method supports all T types and CMPXMediaBase classes like CMPXMedia and CMPXMediaArray.

This method returns NULL (ASSERT happens on UDEB image) for CBase objects other than CMPXMedia, CMPXMediaArray.

Since
S60 3.2.3
if an error code is set for the attribue, use method: CMPXMedia::ValueTObjectL(const TMPXAttribute& aAttribute), CMPXMedia::ValueNoNewLCObjectL(const TMPXAttribute& aAttribute), CMPXMedia::ValueCObjectL(const TMPXAttribute& aAttribute).

For CMPXCollectionPath, use method: CMPXMedia::ValueCObjectL(const TMPXAttribute& aAttribute).

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

ValueCObjectL(const TMPXAttribute &)

C *ValueCObjectL(const TMPXAttribute &aAttribute)const [inline]

Copy an object out of media object. Note: class C must implement the function NewL() and streamable.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

ValueCObjectL(const TDesC8 &)

TAny *ValueCObjectL(const TDesC8 &aData)const [private]

Copy an object out of media object.

Since
S60 3.2.3

Parameters

const TDesC8 & aData

ValueL(const TDesC8 &)

T *ValueL(const TDesC8 &aData)const [private, inline]

Copy an object out of a descriptor buffer. Note: Cbased class must implement the function NewL().

Since
S60 3.2.3

Parameters

const TDesC8 & aData

ValueNoNewLCObjectL(const TMPXAttribute &)

C *ValueNoNewLCObjectL(const TMPXAttribute &aAttribute)const [inline]

Copy an object out of media object. Note: C++ default contructor of class C must be public.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

ValuePtr(const TMPXAttribute &)

IMPORT_C TAny *ValuePtr(const TMPXAttribute &aAttribute)const [private]

The value for a specific attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

ValueTObjectL(const TMPXAttribute &)

TValueTObjectL(const TMPXAttribute &aAttribute)const [inline]

A copy of the value for a specific attribute. If the media attribute does not exist, the default T object will be returned.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

ValueText(const TMPXAttribute &)

IMPORT_C const TDesC &ValueText(const TMPXAttribute &aAttribute)const

The value for a specific attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttributethe attribute whose value is queried

operator=(const CMPXMedia &)

IMPORT_C CMPXMedia &operator=(const CMPXMedia &aMedia)

Assignment operator. It copies data handle and increase the reference count of the aMedia only.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMediasource media

Member Data Documentation

RArray< TMPXAttribute > iAttributes

RArray< TMPXAttribute >iAttributes[private]