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 TUint AttributesSet ( TInt )
IMPORT_C CMPXMedia * CopyL (const CMPXMedia &)
IMPORT_C TInt Count ()
TInt Data ()
IMPORT_C void Delete (const TMPXAttribute &)
IMPORT_C void Delete ( TInt )
IMPORT_C TInt Error (const TMPXAttribute &)
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C void HeapMemoryInfoL ( TInt &, TInt &)
IMPORT_C TInt Index (const TMPXAttribute &)
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TBool IsSupported (const TMPXAttribute &)
IMPORT_C TBool Match (const CMPXMedia &, const TMPXAttribute &)
IMPORT_C void MergeMediaL (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 void Reset ()
void SetCObjectValueL (const TMPXAttribute &, C *)
IMPORT_C void SetErrorL (const TMPXAttribute &, TInt )
void SetNoNewLCObjectL (const TMPXAttribute &, C *)
void SetTObjectValueL (const TMPXAttribute &, T)
IMPORT_C void SetTextValueL (const TMPXAttribute &, const TDesC &)
IMPORT_C const TArray < TInt > SupportedIds ()
IMPORT_C TMPXAttributeType Type ( TInt )
IMPORT_C TMPXAttributeType Type (const TMPXAttribute &)
T * Value (const TMPXAttribute &)
C * ValueCObjectL (const TMPXAttribute &)
C * ValueNoNewLCObjectL (const TMPXAttribute &)
T ValueTObjectL (const TMPXAttribute &)
IMPORT_C const TDesC & ValueText (const TMPXAttribute &)
IMPORT_C CMPXMedia & operator= (const CMPXMedia &)
Private Member Functions
void ConstructL (const TArray < TInt > &)
void ConstructL ( RReadStream &)
IMPORT_C TMPXAttributeType GetValue (const TMPXAttribute &, TDes8 &)
void RefreshAttributes ()
void ResetLocal ()
IMPORT_C void SetValueL (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 ( TInt aIndex ) const

The attribute for a specific index.

Since
S60 3.2.3

Parameters

TInt aIndex the 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 TUint AttributesSet ( TInt aContentId ) const

The attributes set for a specific content id.

Since
S60 3.2.3

Parameters

TInt aContentId content Id

ConstructL(const TArray< TInt > &)

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

2nd phase contructor.

Since
S60 3.2.3

Parameters

const TArray < TInt > & aSupportedIds support content ids

ConstructL(RReadStream &)

void ConstructL ( RReadStream & aStream ) [private]

2nd phase contructor.

Since
S60 3.2.3

Parameters

RReadStream & aStream read 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 & aMedia create object from media

Count()

IMPORT_C TInt Count ( ) 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 void Delete ( 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 & aAttribute the attribute to delete

Delete(TInt)

IMPORT_C void Delete ( TInt aIndex )

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

Since
S60 3.2.3

Parameters

TInt aIndex the index from 0 to Count()-1

Error(const TMPXAttribute &)

IMPORT_C TInt Error ( const TMPXAttribute & aAttribute ) const

Get the error code of an attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the attribute whose error code is retrieved.

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( RWriteStream & aStream ) const

Externalize media object.

Since
S60 3.2.3

Parameters

RWriteStream & aStream write stream

GetValue(const TMPXAttribute &, TDes8 &)

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

Get the binary value for a specific attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the attribute whose value is queried
TDes8 & aValue

HeapMemoryInfoL(TInt &, TInt &)

IMPORT_C void HeapMemoryInfoL ( 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 & aTotal Total size of memory (out parameter)
TInt & aUsed Used size of memory (out parameter)

Index(const TMPXAttribute &)

IMPORT_C TInt Index ( const TMPXAttribute & aAttribute ) const

The index of a given attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the specified attribute

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream )

Internalize media object.

Since
S60 3.2.3

Parameters

RReadStream & aStream read stream

IsSupported(const TMPXAttribute &)

IMPORT_C TBool IsSupported ( const TMPXAttribute & aAttribute ) const

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

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the specified attribute

Match(const CMPXMedia &, const TMPXAttribute &)

IMPORT_C TBool Match ( const CMPXMedia & aMedia,
const TMPXAttribute & aAtt
)

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

Since
S60 3.2.3

Parameters

const CMPXMedia & aMedia Media object to match
const TMPXAttribute & aAtt Attribute to match

MergeMediaL(const CMPXMedia &)

IMPORT_C void MergeMediaL ( const CMPXMedia & aMedia )

Merges in the attributes of the provided media.

Since
S60 3.2.3

Parameters

const CMPXMedia & aMedia Media 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 & aStream create 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 & aMedia create object from media

NewL(TInt)

IMPORT_C CMPXMedia * NewL ( TInt aDataHandle ) [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 aDataHandle handle to the data

RefreshAttributes()

void RefreshAttributes ( ) [private]

Reconstructs local attribute array.

Since
S60 3.2.3

Reset()

IMPORT_C void Reset ( )

Clears all the attributes and values.

Since
S60 3.2.3

ResetLocal()

void ResetLocal ( ) [private]

Frees all local data.

Since
S60 3.2.3

SetCObjectValueL(const TMPXAttribute &, C *)

void SetCObjectValueL ( 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 & aAttribute the attribute whose value is added/modified
C * aValue pointer to the C object

SetErrorL(const TMPXAttribute &, TInt)

IMPORT_C void SetErrorL ( const TMPXAttribute & aAttribute,
TInt aError
)

Set an error code to an attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the attribute whose error code is setted.
TInt aError error 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 *)

void SetNoNewLCObjectL ( 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 & aAttribute the attribute whose value is added/modified
C * aValue pointer to the C object

SetTObjectValueL(const TMPXAttribute &, T)

void SetTObjectValueL ( const TMPXAttribute & aAttribute,
T 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 & aAttribute the attribute whose value is added/modified
T aValue attribute value of the T object.

SetTextValueL(const TMPXAttribute &, const TDesC &)

IMPORT_C void SetTextValueL ( 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 & aAttribute the attribute whose value is added/modified
const TDesC & aValue text value to be set

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

IMPORT_C void SetValueL ( const TMPXAttribute & aAttribute,
const TDesC8 & aValue,
TMPXAttributeType aType
) [private]

Set data.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the attribute whose value is queried
const TDesC8 & aValue the value of the media attribute
TMPXAttributeType aType object 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 TMPXAttributeType Type ( TInt aIndex ) const

The type of data stored for the index.

Since
S60 3.2.3

Parameters

TInt aIndex the index whose type of value is queried

Type(const TMPXAttribute &)

IMPORT_C TMPXAttributeType Type ( const TMPXAttribute & aAttribute ) const

The type of data stored for the attribute.

Since
S60 3.2.3

Parameters

const TMPXAttribute & aAttribute the 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 & aAttribute the 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 & aAttribute the 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 & aAttribute the 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 & aAttribute the attribute whose value is queried

ValueTObjectL(const TMPXAttribute &)

T ValueTObjectL ( 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 & aAttribute the 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 & aAttribute the 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 & aMedia source media

Member Data Documentation

RArray< TMPXAttribute > iAttributes

RArray < TMPXAttribute > iAttributes [private]