00001 /* 00002 * ============================================================================== 00003 * Name : FavouritesItemList.h 00004 * Part of : Favourites Engine 00005 * Interface : Favourites Engine API 00006 * Description : Declaration of FavouritesItemList 00007 * Version : %Version% 00008 * 00009 * Copyright (C) 2002 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef FAVOURITES_ITEM_LIST_H 00023 #define FAVOURITES_ITEM_LIST_H 00024 00025 // INCLUDE FILES 00026 00027 #include <e32base.h> 00028 00029 // CONSTANTS 00030 00031 // FORWARD DECLARATION 00032 00033 class CFavouritesItem; 00034 class RWriteStream; 00035 class RReadStream; 00036 00037 // CLASS DECLARATION 00038 00045 class CFavouritesItemList: public CArrayPtrFlat<CFavouritesItem> 00046 { 00047 public: // Constructor and destructor 00048 00053 IMPORT_C CFavouritesItemList(); 00054 00059 IMPORT_C virtual ~CFavouritesItemList(); 00060 00061 public: // new methods 00062 00069 IMPORT_C void Delete( TInt aIndex ); 00070 00078 IMPORT_C void Delete( TInt aIndex, TInt aCount ); 00079 00080 public: // Sorting 00081 00092 typedef TInt (*ComparisonFuncL) 00093 ( const CFavouritesItem& aLeft, const CFavouritesItem& aRight ); 00094 00100 IMPORT_C void SortL( ComparisonFuncL aCompareItemsL ); 00101 00102 public: // Uid <--> array index conversion 00103 00110 IMPORT_C TInt UidToIndex( TInt aUid ) const; 00111 00118 IMPORT_C TInt IndexToUid( TInt aIndex ) const; 00119 00127 IMPORT_C const CFavouritesItem* ItemByUid( TInt aUid ) const; 00128 00129 public: // (But not exported:) Streaming 00130 00136 void ExternalizeL( RWriteStream& aStream ) const; 00137 00143 void InternalizeL( RReadStream& aStream ); 00144 00145 }; 00146 00147 #endif 00148 00149 // End of file