63
|
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_HELPER
|
|
20 |
#define C_PCS_ALGORITHM_1_HELPER
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32cmn.h>
|
|
24 |
#include <e32math.h>
|
|
25 |
#include <e32hashtab.h>
|
|
26 |
|
|
27 |
#include "CPcsPlugin.h"
|
|
28 |
#include "CPsData.h"
|
|
29 |
#include "CPcsCache.h"
|
|
30 |
#include "CPcsKeyMap.h"
|
|
31 |
#include "CPsQuery.h"
|
|
32 |
#include "CPcsAlgorithm1FilterHelper.h"
|
|
33 |
#include "mdatastoreobserver.h"
|
|
34 |
|
|
35 |
// FORWARD DECLARATION
|
|
36 |
class CPcsAlgorithm1;
|
|
37 |
class CPsData;
|
|
38 |
class CPsDataPluginInterface;
|
|
39 |
class CPsQuery;
|
|
40 |
|
|
41 |
// CLASS DECLARATION
|
|
42 |
class CPcsAlgorithm1Helper : public CBase
|
|
43 |
{
|
|
44 |
private:
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Constructor
|
|
48 |
*/
|
|
49 |
CPcsAlgorithm1Helper();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* 2nd phase construtor
|
|
53 |
*/
|
|
54 |
void ConstructL(CPcsAlgorithm1* aAlgorithm);
|
|
55 |
|
|
56 |
public:
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Two phase construction
|
|
60 |
*/
|
|
61 |
static CPcsAlgorithm1Helper* NewL(CPcsAlgorithm1* aAlgorithm);
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor
|
|
65 |
*/
|
|
66 |
virtual ~CPcsAlgorithm1Helper();
|
|
67 |
|
|
68 |
private:
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Filter subset results for ITU-T mode, QWERTY mode, or Mixed (ITU-T and QWERTY) mode.
|
|
72 |
*/
|
|
73 |
void FilterResultsSingleL(CPcsAlgorithm1FilterHelper* aAlgorithmFilterHelper,
|
|
74 |
RPointerArray<CPcsPoolElement>& searchSet,
|
|
75 |
CPsQuery& aPsQuery,
|
|
76 |
TUint8 aFilteredDataMatch,
|
|
77 |
TBool isSearchInGroup,
|
|
78 |
RArray<TInt>& aContactsInGroup);
|
|
79 |
|
|
80 |
public:
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Search function for query in ITU-T mode, QWERTY mode, or Mixed (ITU-T and QWERTY) mode.
|
|
84 |
*/
|
|
85 |
void SearchSingleL(const CPsSettings& aSettings,
|
|
86 |
CPsQuery& aPsQuery,
|
|
87 |
TBool aIsGroupSearch,
|
|
88 |
RArray<TInt>& aContactsInGroup,
|
|
89 |
RPointerArray<CPsData>& aSearchResults,
|
|
90 |
RPointerArray<CPsPattern>& aSearchSeqs );
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Funciton to search matching sequences in the input text.
|
|
94 |
*/
|
|
95 |
void SearchMatchSeqL(CPsQuery& aPsQuery,
|
|
96 |
const TDesC& aData,
|
|
97 |
RPointerArray<TDesC>& aMatchSet,
|
|
98 |
RArray<TPsMatchLocation>& aMatchLocation );
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Sort search sequences.
|
|
102 |
*/
|
|
103 |
void SortSearchSeqsL(RPointerArray<TDesC>& aMatchSet);
|
|
104 |
|
|
105 |
private:
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Pointer to algorithm instance. Not owned.
|
|
109 |
*/
|
|
110 |
CPcsAlgorithm1* iAlgorithm;
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Pointer to key map instance. Not owned.
|
|
114 |
*/
|
|
115 |
CPcsKeyMap* iKeyMap;
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Array of result sets from different data stores.
|
|
119 |
*/
|
|
120 |
typedef RPointerArray<CPsData> CPSDATA_R_PTR_ARRAY;
|
|
121 |
RPointerArray<CPSDATA_R_PTR_ARRAY> iSearchResultsArr;
|
|
122 |
};
|
|
123 |
|
|
124 |
#endif // C_PCS_ALGORITHM_1_HELPER
|