diff -r 2666d9724c76 -r d4f567ce2e7c predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsCache.h --- a/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsCache.h Thu Jul 15 18:22:55 2010 +0300 +++ b/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsCache.h Thu Aug 19 09:41:07 2010 +0300 @@ -38,7 +38,7 @@ /** * Two phase construction */ - static CPcsCache* NewL(CPcsAlgorithm2* aAlgorithm, TDesC& aURI, + static CPcsCache* NewL(CPcsAlgorithm2* aAlgorithm, const TDesC& aURI, CPcsKeyMap& aKeyMap, TUint8 aUriId); /** @@ -74,7 +74,7 @@ /** * Removes all data elements from the cache */ - void RemoveAllFromCacheL(); + void RemoveAllFromCache(); /** * Sets data fields to the cache @@ -125,6 +125,16 @@ */ void ResortdataInPoolsL(); + /** + * Get data index of the first name field + */ + TInt GetFirstNameIndex() const; + + /** + * Get data index of the last name field + */ + TInt GetLastNameIndex() const; + private: /** @@ -135,24 +145,36 @@ /** * Second phase constructor */ - void ConstructL(CPcsAlgorithm2* aAlgorithm, TDesC& aURI, + void ConstructL(CPcsAlgorithm2* aAlgorithm, const TDesC& aURI, CPcsKeyMap& aKeyMap, TUint8 aUriId); /** * Utility function to add a contact to the pool */ - void AddToPoolL(TInt& aInfo, CPsData& data); + void AddToPoolL(TUint64& aPoolMap, CPsData& aData); + + /** + * Utility function + */ + void SetPoolMap(TUint64& aPoolMap, TInt aArrayIndex); /** * Utility function */ - void SetPoolMap(TInt& aPoolMap, TInt aPoolId); + TBool GetPoolMap(TUint64& aPoolMap, TInt aArrayIndex); /** - * Utility function + * Gets all the first characters of the words in the data field according + * to which the contact should be inserted into cache. */ - TBool GetPoolMap(TInt& aPoolMap, TInt arrayIndex); - + void GetFirstCharsForDataL( const TDesC& aData, RArray& aFirstChars ) const; + + /** + * Gets all the pool IDs matching the given characters. If there are two predictive + * keyboards available, then pool IDs are given according to both keyboards. + */ + void GetPoolIdsForCharsL( const RArray& aChars, RArray& aPoolIds ) const; + /** * Utility function */ @@ -165,27 +187,27 @@ * Array of key maps */ typedef RPointerArray R_PTR_ARRAY; - RPointerArray keyArr; + RPointerArray iKeyArr; /* * Hashmaps to remember the location of a contact in the pools */ - RHashMap cacheInfo; + RHashMap iCacheInfo; /* * Master pool of all contacts in this cache */ - RPointerArray masterPool; + RPointerArray iMasterPool; /* * Master pool backup of all contacts in this cache when sortorder changed */ - RPointerArray masterPoolBackup; + RPointerArray iMasterPoolBackup; /* * Not owned */ - CPcsKeyMap* keyMap; + CPcsKeyMap* iKeyMap; /** * Owned. Refer to the database URI this cache is for.