2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 #include <CLFContentListing.hrh>
24 #include <CLFContentListing.h>
27 // FORWARD DECLARATIONS
33 * Content Listing Framework item.
34 * All items that are fetched from server have got an Item ID number.
35 * Item ID is defined in runtime so do not store Item IDs permanently.
36 * One item can contain multiple fields. The field consists of a Field ID and
37 * field data. Type of the field is defined with Field ID: see
38 * TCLFDefaultFieldId in CLFContentListing.hrh.
39 * For example, a music file could contain these two fields:
40 * ECLFFieldIdSongName (data: title of the song) and ECLFFieldIdArtist
41 * (data: name of the artist).<br><br>
44 * // Get file names and sizes of all items
45 * TInt count( listModel->ItemCount() );
46 * for( TInt i = 0 ; i < count ; ++i )
48 * const MCLFItem& myItem = listModel->Item( i );
50 * // Get file name of an item (string data)
52 * TInt error( myItem.GetField( ECLFFieldIdFileName, fileName ) );
56 * // Get file size of an item (integer data)
58 * error = myItem.GetField( ECLFFieldIdFileSize, size );
65 * @lib ContentListingFramwork.lib
75 virtual ~MCLFItem() {}
77 public: // New functions
80 * Get Item ID of the item.
82 * @return Item ID of the item
84 virtual TCLFItemId ItemId() const = 0;
87 * Get data type of the field. Data type can be text, time or integer.
89 * @param aFieldId ID of the field (TCLFDefaultFieldId)
90 * @return Data type of the field.
91 * ECLFItemDataTypeNull, if the field does not exist in the item.
93 virtual TCLFItemDataType DataType( TCLFFieldId aFieldId ) const = 0;
96 * Get field data that is a string.
98 * @param aFieldId ID of the field (TCLFDefaultFieldId)
99 * @param aData Data of the field
100 * @return System wide error code.
101 * KErrNone if field exist,
102 * KErrNotFound if field doesn't exist,
103 * KErrNotSupported if field type doesn't match
105 virtual TInt GetField( TCLFFieldId aFieldId, TPtrC& aData ) const = 0;
108 * Get field data that is an integer.
110 * @param aFieldId ID of the field (TCLFDefaultFieldId)
111 * @param aData Data of the field
112 * @return System wide error code.
113 * KErrNone if field exist,
114 * KErrNotFound if field doesn't exist,
115 * KErrNotSupported if field type doesn't match
117 virtual TInt GetField( TCLFFieldId aFieldId, TInt32& aData ) const = 0;
120 * Get field data that is a time data.
122 * @param aFieldId ID of the field (TCLFDefaultFieldId)
123 * @param aData Data of the field
124 * @return System wide error code.
125 * KErrNone if field exist,
126 * KErrNotFound if field doesn't exist,
127 * KErrNotSupported if field type doesn't match
129 virtual TInt GetField( TCLFFieldId aFieldId, TTime& aData ) const = 0;
131 private: // Extension interface
134 * This member is internal and not intended for use.
136 virtual MCLFItemExt* Extension() { return NULL; }