MCLFItem Class Reference

API published in: S60 3rd Ed FP 1

Link against: contentlistingframework.lib

Capability Information

Required Capabilities

None


#include <mclfitem.h>

Inherited by MCLFModifiableItem.


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 );

      ...

      }

Public Member Functions

virtual  ~MCLFItem ()
  Destructor.
virtual TCLFItemId  ItemId () const =0
  Get Item ID of the item.
virtual TCLFItemDataType  DataType (TCLFFieldId aFieldId) const =0
  Get data type of the field.
virtual TInt  GetField (TCLFFieldId aFieldId, TPtrC &aData) const =0
  Get field data that is a string.
virtual TInt  GetField (TCLFFieldId aFieldId, TInt32 &aData) const =0
  Get field data that is an integer.
virtual TInt  GetField (TCLFFieldId aFieldId, TTime &aData) const =0
  Get field data that is a time data.

Constructor & Destructor Documentation

virtual MCLFItem::~MCLFItem  )  [inline, virtual]
 

Destructor.


Member Function Documentation

virtual TCLFItemDataType MCLFItem::DataType TCLFFieldId  aFieldId  )  const [pure virtual]
 

Get data type of the field.

Data type can be text, time or integer.

Parameters:
aFieldId  ID of the field (TCLFDefaultFieldId)
Returns:
Data type of the field. ECLFItemDataTypeNull, if the field does not exist in the item.
virtual TInt MCLFItem::GetField TCLFFieldId  aFieldId,
TTime &  aData
const [pure virtual]
 

Get field data that is a time data.

Parameters:
aFieldId  ID of the field (TCLFDefaultFieldId)
aData  Data 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
virtual TInt MCLFItem::GetField TCLFFieldId  aFieldId,
TInt32 &  aData
const [pure virtual]
 

Get field data that is an integer.

Parameters:
aFieldId  ID of the field (TCLFDefaultFieldId)
aData  Data 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
virtual TInt MCLFItem::GetField TCLFFieldId  aFieldId,
TPtrC &  aData
const [pure virtual]
 

Get field data that is a string.

Parameters:
aFieldId  ID of the field (TCLFDefaultFieldId)
aData  Data 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
virtual TCLFItemId MCLFItem::ItemId  )  const [pure virtual]
 

Get Item ID of the item.

Returns:
Item ID of the item

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top