author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:15:33 +0300 | |
branch | RCL_3 |
changeset 85 | 38bb213f60ba |
parent 68 | 9da50d567e3c |
permissions | -rw-r--r-- |
63 | 1 |
/* |
2 |
* Copyright (c) 2006-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: Identifies a contact in cache pools |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_PCS_ALGORITHM_2_UTILS |
|
19 |
#define C_PCS_ALGORITHM_2_UTILS |
|
20 |
||
21 |
// INCLUDE FILES |
|
22 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
23 |
#include <e32hashtab.h> |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
24 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
25 |
#include "CPsData.h" |
63 | 26 |
|
27 |
// FORWARD DECLARATION |
|
28 |
||
29 |
typedef RPointerArray<CPsData> CPSDATA_R_PTR_ARRAY; |
|
30 |
||
31 |
// CLASS DECLARATION |
|
32 |
class CPcsAlgorithm2Utils : public CBase |
|
33 |
{ |
|
34 |
public: |
|
35 |
||
36 |
/** |
|
37 |
* Merge function to merge the search results from different arrays |
|
38 |
* into a single array in sorted order. |
|
39 |
* It merges all the result sets that are there in iSearchResultsArr |
|
40 |
* into single result set. This is a wrapper funciton implemented that |
|
41 |
* works for all type of key board modes |
|
42 |
*/ |
|
43 |
static void FormCompleteSearchResultsL(RPointerArray<CPSDATA_R_PTR_ARRAY>& aSearchResultsArr, |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
44 |
RPointerArray<CPsData>& SearchResults); |
63 | 45 |
|
46 |
/** |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
47 |
* Customized CompareC |
63 | 48 |
*/ |
49 |
static TInt MyCompareC(const TDesC& aLeft, const TDesC& aRight); |
|
50 |
||
51 |
/** |
|
52 |
* TLinearOrder rule for comparison of data objects |
|
53 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
54 |
static TInt CompareDataBySortOrder(const CPsData& aObject1, const CPsData& aObject2); |
63 | 55 |
|
56 |
/** |
|
57 |
* Trim off all white spaces and special chars |
|
58 |
*/ |
|
59 |
static void MyTrim(TDes& aString); |
|
60 |
||
61 |
/** |
|
62 |
* Check if the input URI is of contact search in a group template form |
|
63 |
*/ |
|
64 |
static TBool IsGroupUri(TDesC& aURI); |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
65 |
|
63 | 66 |
}; |
67 |
||
68 |
// CleanupStack helpers for item owning RPointerArrays |
|
69 |
template <class T> |
|
70 |
class CleanupResetAndDestroy |
|
71 |
{ |
|
72 |
public: |
|
73 |
inline static void PushL(T& aRef) |
|
74 |
{ CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef)); } |
|
75 |
private: |
|
76 |
inline static void ResetAndDestroy(TAny *aPtr) |
|
77 |
{ static_cast<T*>(aPtr)->ResetAndDestroy(); } |
|
78 |
}; |
|
79 |
||
80 |
template <class T> |
|
81 |
inline void CleanupResetAndDestroyPushL(T& aRef) |
|
82 |
{ CleanupResetAndDestroy<T>::PushL(aRef); } |
|
83 |
||
84 |
#endif // C_PCS_ALGORITHM_2_UTILS |