diff -r 2666d9724c76 -r d4f567ce2e7c predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2Utils.h --- a/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2Utils.h Thu Jul 15 18:22:55 2010 +0300 +++ b/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2Utils.h Thu Aug 19 09:41:07 2010 +0300 @@ -20,11 +20,12 @@ // INCLUDE FILES -#include - -#include "CPsData.h" +#include // FORWARD DECLARATION +class CPsData; +class CPsQuery; +struct TPsMatchLocation; typedef RPointerArray CPSDATA_R_PTR_ARRAY; @@ -41,10 +42,10 @@ * works for all type of key board modes */ static void FormCompleteSearchResultsL(RPointerArray& aSearchResultsArr, - RPointerArray& SearchResults); + RPointerArray& aSearchResults); /** - * Customized CompareC + * Customized CompareC */ static TInt MyCompareC(const TDesC& aLeft, const TDesC& aRight); @@ -54,6 +55,16 @@ static TInt CompareDataBySortOrder(const CPsData& aObject1, const CPsData& aObject2); /** + * TIdentityRelation rule for comparing descriptors case-sensitively. + */ + static TBool CompareExact(const TDesC& aFirst, const TDesC& aSecond); + + /** + * TLinearOrder rule for comparing queries by length + */ + static TInt CompareLength(const CPsQuery& aFirst, const CPsQuery& aSecond); + + /** * Trim off all white spaces and special chars */ static void MyTrim(TDes& aString); @@ -62,8 +73,28 @@ * Check if the input URI is of contact search in a group template form */ static TBool IsGroupUri(TDesC& aURI); + + /** + * Constructs a bit pattern using the required/supported data fields + * For example, 6, 4 and 27 are supported fields <-- 00000111 + * 6 and 4 are required fields <-- 00000011 + * Bit pattern returned is 00000011. + */ + static TUint8 FilterDataFieldsL(const RArray& aRequiredDataFields, + const RArray& aSupportedDataFields); + + /** + * Create upper-case match sequence buffer from matching part and append it to + * array unless there's equal sequence already present. + */ + static void AppendMatchToSeqL( RPointerArray& aMatchSeq, const TDesC& aMatch ); + + /** + * Check if two match location items have overlapping indices. + */ + static TBool MatchesOverlap( const TPsMatchLocation& aFirst, const TPsMatchLocation& aSecond ); + }; - }; // CleanupStack helpers for item owning RPointerArrays template