1.1 --- a/epoc32/include/mw/mclfitem.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/mclfitem.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,142 @@
1.4 -mclfitem.h
1.5 +/*
1.6 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef MCLFITEM_H
1.24 +#define MCLFITEM_H
1.25 +
1.26 +// INCLUDES
1.27 +#include <CLFContentListing.hrh>
1.28 +#include <CLFContentListing.h>
1.29 +#include <e32std.h>
1.30 +
1.31 +// FORWARD DECLARATIONS
1.32 +class MCLFItemExt;
1.33 +
1.34 +// CLASS DECLARATION
1.35 +
1.36 +/**
1.37 +* Content Listing Framework item.
1.38 +* All items that are fetched from server have got an Item ID number.
1.39 +* Item ID is defined in runtime so do not store Item IDs permanently.
1.40 +* One item can contain multiple fields. The field consists of a Field ID and
1.41 +* field data. Type of the field is defined with Field ID: see
1.42 +* TCLFDefaultFieldId in CLFContentListing.hrh.
1.43 +* For example, a music file could contain these two fields:
1.44 +* ECLFFieldIdSongName (data: title of the song) and ECLFFieldIdArtist
1.45 +* (data: name of the artist).<br><br>
1.46 +* Usage:
1.47 +* @code
1.48 +* // Get file names and sizes of all items
1.49 +* TInt count( listModel->ItemCount() );
1.50 +* for( TInt i = 0 ; i < count ; ++i )
1.51 +* {
1.52 +* const MCLFItem& myItem = listModel->Item( i );
1.53 +*
1.54 +* // Get file name of an item (string data)
1.55 +* TPtrC fileName;
1.56 +* TInt error( myItem.GetField( ECLFFieldIdFileName, fileName ) );
1.57 +*
1.58 +* ...
1.59 +*
1.60 +* // Get file size of an item (integer data)
1.61 +* TInt32 size( 0 );
1.62 +* error = myItem.GetField( ECLFFieldIdFileSize, size );
1.63 +*
1.64 +* ...
1.65 +*
1.66 +* }
1.67 +* @endcode
1.68 +*
1.69 +* @lib ContentListingFramwork.lib
1.70 +* @since S60 3.1
1.71 +*/
1.72 +class MCLFItem
1.73 + {
1.74 + public: // Destructor
1.75 +
1.76 + /**
1.77 + * Destructor.
1.78 + */
1.79 + virtual ~MCLFItem() {}
1.80 +
1.81 + public: // New functions
1.82 +
1.83 + /**
1.84 + * Get Item ID of the item.
1.85 + * @since S60 3.1
1.86 + * @return Item ID of the item
1.87 + */
1.88 + virtual TCLFItemId ItemId() const = 0;
1.89 +
1.90 + /**
1.91 + * Get data type of the field. Data type can be text, time or integer.
1.92 + * @since S60 3.1
1.93 + * @param aFieldId ID of the field (TCLFDefaultFieldId)
1.94 + * @return Data type of the field.
1.95 + * ECLFItemDataTypeNull, if the field does not exist in the item.
1.96 + */
1.97 + virtual TCLFItemDataType DataType( TCLFFieldId aFieldId ) const = 0;
1.98 +
1.99 + /**
1.100 + * Get field data that is a string.
1.101 + * @since S60 3.1
1.102 + * @param aFieldId ID of the field (TCLFDefaultFieldId)
1.103 + * @param aData Data of the field
1.104 + * @return System wide error code.
1.105 + * KErrNone if field exist,
1.106 + * KErrNotFound if field doesn't exist,
1.107 + * KErrNotSupported if field type doesn't match
1.108 + */
1.109 + virtual TInt GetField( TCLFFieldId aFieldId, TPtrC& aData ) const = 0;
1.110 +
1.111 + /**
1.112 + * Get field data that is an integer.
1.113 + * @since S60 3.1
1.114 + * @param aFieldId ID of the field (TCLFDefaultFieldId)
1.115 + * @param aData Data of the field
1.116 + * @return System wide error code.
1.117 + * KErrNone if field exist,
1.118 + * KErrNotFound if field doesn't exist,
1.119 + * KErrNotSupported if field type doesn't match
1.120 + */
1.121 + virtual TInt GetField( TCLFFieldId aFieldId, TInt32& aData ) const = 0;
1.122 +
1.123 + /**
1.124 + * Get field data that is a time data.
1.125 + * @since S60 3.1
1.126 + * @param aFieldId ID of the field (TCLFDefaultFieldId)
1.127 + * @param aData Data of the field
1.128 + * @return System wide error code.
1.129 + * KErrNone if field exist,
1.130 + * KErrNotFound if field doesn't exist,
1.131 + * KErrNotSupported if field type doesn't match
1.132 + */
1.133 + virtual TInt GetField( TCLFFieldId aFieldId, TTime& aData ) const = 0;
1.134 +
1.135 + private: // Extension interface
1.136 +
1.137 + /**
1.138 + * This member is internal and not intended for use.
1.139 + */
1.140 + virtual MCLFItemExt* Extension() { return NULL; }
1.141 +
1.142 + };
1.143 +
1.144 +#endif // MCLFITEM_H
1.145 +
1.146 +// End of File