MCLFItem Class Reference
Link against: ContentListingFramwork.lib
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 );
...
}
Constructor & Destructor Documentation
~MCLFItem ( )
~MCLFItem | ( | ) | [inline, virtual] |
Member Function Documentation
DataType ( TCLFFieldId )
Get data type of the field. Data type can be text, time or integer.
- Since
- S60 3.1
Parameter | Description | aFieldId | ID of the field (TCLFDefaultFieldId) |
Returns: Data type of the field. ECLFItemDataTypeNull, if the field does not exist in the item.
GetField ( TCLFFieldId, TPtrC & )
Get field data that is a string.
- Since
- S60 3.1
Parameter | Description | 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
GetField ( TCLFFieldId, TInt32 & )
Get field data that is an integer.
- Since
- S60 3.1
Parameter | Description | 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
GetField ( TCLFFieldId, TTime & )
Get field data that is a time data.
- Since
- S60 3.1
Parameter | Description | 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
ItemId ( )
Get Item ID of the item.
- Since
- S60 3.1
Returns: Item ID of the item