|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Predictive Contact Search Algorithm 1 main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PCS_ALGORITHM_1_UTILS |
|
20 #define C_PCS_ALGORITHM_1_UTILS |
|
21 |
|
22 // INCLUDE FILES |
|
23 |
|
24 #include <e32hashtab.h> |
|
25 |
|
26 #include "CPsData.h" |
|
27 #include "CPsQuery.h" |
|
28 |
|
29 // FORWARD DECLARATION |
|
30 |
|
31 typedef RPointerArray<CPsData> CPSDATA_R_PTR_ARRAY; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 class CPcsAlgorithm1Utils : public CBase |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Merge function to merge the search results from different arrays |
|
40 * into a single array in sorted order. |
|
41 * It merges all the result sets that are there in iSearchResultsArr |
|
42 * into single result set. This is a wrapper funciton implemented that |
|
43 * works for all type of key board modes |
|
44 */ |
|
45 static void FormCompleteSearchResultsL(RPointerArray<CPSDATA_R_PTR_ARRAY>& aSearchResultsArr, |
|
46 RPointerArray<CPsData>& SearchResults); |
|
47 |
|
48 /** |
|
49 * Case Sensitive compare for keys |
|
50 */ |
|
51 static TBool MyCompareK(const TDesC& aLeft, const TDesC& aRight, CPsQuery& aPsQuery); |
|
52 |
|
53 /** |
|
54 * Customized CompareC |
|
55 */ |
|
56 static TInt MyCompareC(const TDesC& aLeft, const TDesC& aRight); |
|
57 |
|
58 |
|
59 /** |
|
60 * TLinearOrder rule for comparison of data objects |
|
61 */ |
|
62 static TInt CompareDataBySortOrderL(const CPsData& aObject1, |
|
63 const CPsData& aObject2); |
|
64 |
|
65 /** |
|
66 * Trim off all white spaces and special chars |
|
67 */ |
|
68 static void MyTrim(TDes& aString); |
|
69 |
|
70 |
|
71 /** |
|
72 * Check if the input URI is of contact search in a group template form |
|
73 */ |
|
74 static TBool IsGroupUri(TDesC& aURI); |
|
75 |
|
76 }; |
|
77 #endif // C_PCS_ALGORITHM_1_UTILS |
|
78 |