predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2MultiSearchHelper.h
branchRCL_3
changeset 18 d4f567ce2e7c
parent 0 e686773b3f54
equal deleted inserted replaced
17:2666d9724c76 18:d4f567ce2e7c
    62 
    62 
    63     /**
    63     /**
    64      * Filter subset results for multi query mode. 
    64      * Filter subset results for multi query mode. 
    65      */
    65      */
    66     void FilterResultsMultiL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper,
    66     void FilterResultsMultiL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper,
    67                              RPointerArray<CPcsPoolElement>& searchSet,
    67                              RPointerArray<CPcsPoolElement>& aSearchSet,
    68                              RPointerArray<CPsQuery>& searchQuery, TUint8 aFilteredDataMatch,
    68                              RPointerArray<CPsQuery>& aSearchQuery, 
    69                              TBool isGroupSearch, RArray<TInt>& aContactsInGroup, 
    69                              TUint8 aFilteredDataMatch,
    70                              TInt keyboardMode);
    70                              TBool aIsGroupSearch, 
    71 
    71                              const RArray<TInt>& aContactsInGroup);
    72     /**
       
    73      * Convert the search query to a string.
       
    74      * If the mode is ITU-T, character is converted to numeric.
       
    75      * If the mode is Qwerty, character is retained as is.
       
    76      */
       
    77     void ExtractQueryL(CPsQuery& aPsQuery, TDes& aOutput);
       
    78 
       
    79     /**
       
    80      * Convert the input search query to a string.
       
    81      * Mode is referred in the CPsQuery.
       
    82      * If the mode is ITU-T, character is converted to numeric.
       
    83      * If the mode is Qwerty, character is retained as is.
       
    84      */
       
    85     void ExtractQueryL(TDesC& aInput, CPsQuery& aPsQuery, TDes& aOutput);
       
    86     /**
       
    87      * Converts the input data to the key board mode specified by the query.
       
    88      * Mode is referred in the CPsQuery.
       
    89      * If the mode is ITU-T, data is converted to numeric.
       
    90      * If the mode is Qwerty, data is retained as is.
       
    91      */
       
    92     void ConvertdDataToKeyBoardModeL(CPsQuery* aQuery, TPtrC aInputData,
       
    93                                      TBuf<KPsQueryMaxLen>& aOutputData);
       
    94 
    72 
    95 public:
    73 public:
    96 
    74 
    97     /**
    75     /**
    98      * Search Function for multi query
    76      * Search Function for multi query
    99      * Initials search feature
    77      * Initials search feature
   100      */
    78      */
   101     void SearchMultiL(const CPsSettings& aSettings, RPointerArray<CPsQuery>& aQuery, 
    79     void SearchMultiL(const CPsSettings& aSettings, 
   102                       TBool isGroupSearch, RArray<TInt>& aContactsInGroup,
    80                       RPointerArray<CPsQuery>& aQuery, 
   103                       RPointerArray<CPsData>& searchResults,
    81                       TBool aIsGroupSearch, 
   104                       RPointerArray<CPsPattern>& searchSeqs, TInt keyboardMode);
    82                       const RArray<TInt>& aContactsInGroup,
       
    83                       RPointerArray<CPsData>& aSearchResults,
       
    84                       RPointerArray<CPsPattern>& aSearchSeqs);
   105 
    85 
   106     /**
    86     /**
   107      * Funtion to Search matching sequences for multi query
    87      * Funtion to Search matching sequences for multi query
   108      */
    88      */
   109     void SearchMatchSeqMultiL(RPointerArray<CPsQuery>& aPsQuery,
    89     void SearchMatchSeqMultiL(RPointerArray<CPsQuery>& aPsQuery,
   110                               TDesC& aData, RPointerArray<TDesC>& aMatchSet, 
    90                               const TDesC& aData, 
       
    91                               RPointerArray<TDesC>& aMatchSet, 
   111                               RArray<TPsMatchLocation>& aMatchLocation);
    92                               RArray<TPsMatchLocation>& aMatchLocation);
   112 
    93 
   113 private:
    94 private:
   114 
    95 
   115     /**
       
   116      * Constructs a bit pattern using the required/supported data fields
       
   117      * For example, 6, 4 and 27 are supported fields <-- 00000111
       
   118      *              6 and 4 are required fields      <-- 00000011
       
   119      * Bit pattern returned is 00000011.
       
   120      */
       
   121     TUint8 FilterDataFieldsL(RArray<TInt>& aRequiredDataFields,
       
   122                              RArray<TInt>& aSupportedDataFields);
       
   123     /**
    96     /**
   124      * Set the bits corresponding to word matches
    97      * Set the bits corresponding to word matches
   125      *
    98      *
   126      * @param aIndex Index of data element
    99      * @param aIndex Index of data element
   127      * @param aPosition Word matched for predictive search
   100      * @param aPosition Word matched for predictive search
   153     /**
   126     /**
   154      * Utility function to split the query into multiple queries
   127      * Utility function to split the query into multiple queries
   155      */
   128      */
   156     RPointerArray<CPsQuery> MultiQueryL(CPsQuery& aQuery);
   129     RPointerArray<CPsQuery> MultiQueryL(CPsQuery& aQuery);
   157 
   130 
   158     /**
       
   159      * Convert the search query (multiple) to a list
       
   160      */
       
   161     void ConvertQueryToListL(RPointerArray<CPsQuery>& aSearchQuery,
       
   162                              RPointerArray<HBufC>& aQueryList);
       
   163 
       
   164 private:
   131 private:
   165 
   132 
   166     /**
   133     /**
   167      * Constructor
   134      * Constructor
   168      */
   135      */
   181     CPcsAlgorithm2* iAlgorithm;
   148     CPcsAlgorithm2* iAlgorithm;
   182 
   149 
   183     /**
   150     /**
   184      * Pointer to key map instance. Not owned.
   151      * Pointer to key map instance. Not owned.
   185      */
   152      */
   186     CPcsKeyMap* keyMap;
   153     CPcsKeyMap* iKeyMap;
   187 
   154 
   188     /**
   155     /**
   189      * Array of result sets from different data stores.
   156      * Array of result sets from different data stores.
   190      */
   157      */
   191     typedef RPointerArray<CPsData> CPSDATA_R_PTR_ARRAY;
   158     typedef RPointerArray<CPsData> CPSDATA_R_PTR_ARRAY;
   193 
   160 
   194     /**
   161     /**
   195      * Array of word macthes.
   162      * Array of word macthes.
   196      */
   163      */
   197     TUint8 iWordMatches[MAX_DATA_FIELDS];
   164     TUint8 iWordMatches[MAX_DATA_FIELDS];
       
   165 	
       
   166     /**
       
   167      * Counter of the matched contacts 
       
   168      */
       
   169     TInt iMaxCount;
   198     };
   170     };
   199 
   171 
   200 #endif // C_PCS_ALGORITHM_2_MULTI_SEARCH_HELPER
   172 #endif // C_PCS_ALGORITHM_2_MULTI_SEARCH_HELPER