MCLFItem Class Reference

#include <mw/MCLFItem.h>

Link against: ContentListingFramwork.lib

class MCLFItem
Public Member Functions
virtual ~MCLFItem()
pure virtual TCLFItemDataType DataType(TCLFFieldId)
pure virtual TInt GetField(TCLFFieldId, TPtrC &)
pure virtual TInt GetField(TCLFFieldId, TInt32 &)
pure virtual TInt GetField(TCLFFieldId, TTime &)
pure virtual TCLFItemId ItemId()

Detailed Description

Content Listing Framework item. All items that are fetched from server have got an Item ID number. Item ID is defined in runtime so do not store Item IDs permanently. One item can contain multiple fields. The field consists of a Field ID and field data. Type of the field is defined with Field ID: see TCLFDefaultFieldId in CLFContentListing.hrh. For example, a music file could contain these two fields: ECLFFieldIdSongName (data: title of the song) and ECLFFieldIdArtist (data: name of the artist). Usage:
  // Get file names and sizes of all items
  TInt count( listModel->ItemCount() );
  for( TInt i = 0 ; i < count ; ++i )
      {
      const MCLFItem& myItem = listModel->Item( i );

      // Get file name of an item (string data)
      TPtrC fileName;
      TInt error( myItem.GetField( ECLFFieldIdFileName, fileName ) );

      ...

      // Get file size of an item (integer data)
      TInt32 size( 0 );
      error = myItem.GetField( ECLFFieldIdFileSize, size );

      ...

      }
Since
S60 3.1

Constructor & Destructor Documentation

~MCLFItem ( )

~MCLFItem()[inline, virtual]

Destructor.

Member Function Documentation

DataType ( TCLFFieldId )

TCLFItemDataType DataType(TCLFFieldIdaFieldId)const [pure virtual]
Get data type of the field. Data type can be text, time or integer.
Since
S60 3.1
ParameterDescription
aFieldIdID of the field (TCLFDefaultFieldId)

Returns: Data type of the field. ECLFItemDataTypeNull, if the field does not exist in the item.

GetField ( TCLFFieldId, TPtrC & )

TInt GetField(TCLFFieldIdaFieldId,
TPtrC &aData
)const [pure virtual]
Get field data that is a string.
Since
S60 3.1
ParameterDescription
aFieldIdID of the field (TCLFDefaultFieldId)
aDataData of the field

Returns: System wide error code. KErrNone if field exist, KErrNotFound if field doesn't exist, KErrNotSupported if field type doesn't match

GetField ( TCLFFieldId, TInt32 & )

TInt GetField(TCLFFieldIdaFieldId,
TInt32 &aData
)const [pure virtual]
Get field data that is an integer.
Since
S60 3.1
ParameterDescription
aFieldIdID of the field (TCLFDefaultFieldId)
aDataData of the field

Returns: System wide error code. KErrNone if field exist, KErrNotFound if field doesn't exist, KErrNotSupported if field type doesn't match

GetField ( TCLFFieldId, TTime & )

TInt GetField(TCLFFieldIdaFieldId,
TTime &aData
)const [pure virtual]
Get field data that is a time data.
Since
S60 3.1
ParameterDescription
aFieldIdID of the field (TCLFDefaultFieldId)
aDataData of the field

Returns: System wide error code. KErrNone if field exist, KErrNotFound if field doesn't exist, KErrNotSupported if field type doesn't match

ItemId ( )

TCLFItemId ItemId()const [pure virtual]
Get Item ID of the item.
Since
S60 3.1

Returns: Item ID of the item