CFavouritesItemList Class Reference

API published in: S60 1st Ed

Link against: favouritesengine.lib

Capability Information

Required Capabilities

ReadUserData WriteUserData


#include <
favouritesitemlist.h>

Detailed Description

CFavouritesItemList is the Array of CFavouritesItem-s.

Items are owned and deleted upon destruction. Note: using this array downcasted to its base can result in leaks. Delete method of base class is not virtual!


Public Types

typedef TInt(* ComparisonFuncL )(const CFavouritesItem &aLeft, const CFavouritesItem &aRight)
 Comparison function type; compare two items.

Public Member Functions

IMPORT_C CFavouritesItemList ()
 Constructor.
virtual IMPORT_C ~CFavouritesItemList ()
 Destructor.
IMPORT_C void Delete (TInt aIndex)
 Remove and destroy an element.
IMPORT_C void Delete (TInt aIndex, TInt aCount)
 Remove and destroy elements.
IMPORT_C void SortL (ComparisonFuncL aCompareItemsL)
 Sort the list using bubble-sort.
IMPORT_C TInt UidToIndex (TInt aUid) const
 Convert Uid to index.
IMPORT_C TInt IndexToUid (TInt aIndex) const
 Convert index to Uid.
IMPORT_C const CFavouritesItemItemByUid (TInt aUid) const
 Get pointer to item having aUid.
void ExternalizeL (RWriteStream &aStream) const
 Externalize into a stream.
void InternalizeL (RReadStream &aStream)
 Internalize from a stream.

Member Typedef Documentation

typedef TInt(* CFavouritesItemList::ComparisonFuncL)(const CFavouritesItem &aLeft, const CFavouritesItem &aRight)
 

Comparison function type; compare two items.

Should leave in error.

Parameters:
aLeft item to compare to aRight.
aRight Item to compare to aLeft.
Returns:
  • negative value, if aLeft is less than aRight;
  • 0, if aLeft equals to aRight;
  • positive value, if aLeft is greater than aRight.

Constructor & Destructor Documentation

IMPORT_C CFavouritesItemList::CFavouritesItemList  ) 
 

Constructor.

virtual IMPORT_C CFavouritesItemList::~CFavouritesItemList  )  [virtual]
 

Destructor.

Elements are destroyed.


Member Function Documentation

IMPORT_C void CFavouritesItemList::Delete TInt  aIndex,
TInt  aCount
 

Remove and destroy elements.

Invalid params Panic.

Parameters:
aIndex Index of start element to delete.
aCount Number of items to delete.
Returns:
void
IMPORT_C void CFavouritesItemList::Delete TInt  aIndex  ) 
 

Remove and destroy an element.

Invalid params will Panic.

Parameters:
aIndex Index of element to delete.
Returns:
void
void CFavouritesItemList::ExternalizeL RWriteStream &  aStream  )  const
 

Externalize into a stream.

Parameters:
aStream The stream to externalize to.
IMPORT_C TInt CFavouritesItemList::IndexToUid TInt  aIndex  )  const
 

Convert index to Uid.

Parameters:
aIndex Index to convert.
Returns:
Uid for this index, or KFavouritesNullUid if not found.
void CFavouritesItemList::InternalizeL RReadStream &  aStream  ) 
 

Internalize from a stream.

Existing data is kept, new ones appended.

Parameters:
aStream The stream to externalize from.
IMPORT_C const CFavouritesItem* CFavouritesItemList::ItemByUid TInt  aUid  )  const
 

Get pointer to item having aUid.

Parameters:
aUid Uid of item to look for.
Returns:
Pointer to item having aUid, or NULL if there is no such item. Item is still owned by the list.
IMPORT_C void CFavouritesItemList::SortL ComparisonFuncL  aCompareItemsL  ) 
 

Sort the list using bubble-sort.

Parameters:
aCompareItemsL Function to be used two elements.
IMPORT_C TInt CFavouritesItemList::UidToIndex TInt  aUid  )  const
 

Convert Uid to index.

Parameters:
aUid Uid to convert.
Returns:
Index for this Uid, or -KErrNotFound if not found.

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

Copyright © Nokia Corporation 2001-2008
Back to top