|
1 /* |
|
2 * Copyright (c) 2008 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: Implementation of Search Feature |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CVIMPSTENGINESEARCHMGREXTENTION_H |
|
19 #define __CVIMPSTENGINESEARCHMGREXTENTION_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "mvimpstenginesearchmgrextention.h" |
|
25 #include "mvimpstenginesessioncntxtobserver.h" |
|
26 #include "tvimpstenums.h" |
|
27 #include <searchelement.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CVIMPSTEngineRequestMapper; |
|
31 class MXIMPContext; |
|
32 class MSearchFeature; |
|
33 class MSearch; |
|
34 class MSearchKeysEvent; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * search implementation. |
|
40 * @lib vimpstengine.lib |
|
41 * @since S60 5.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CVIMPSTEngineSearchMgrExtention ) : public CBase, |
|
44 public MVIMPSTEngineSearchMgrExtention, |
|
45 public MVIMPSTEngineSessionCntxtObserver |
|
46 |
|
47 { |
|
48 |
|
49 |
|
50 public: // Two-phased constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @param aPresContext: presence context |
|
55 * @param aRequestMapper: Request Mapper for XIMP Events |
|
56 * @return CVIMPSTEngineSearchMgrExtention* a new instance of this class |
|
57 */ |
|
58 |
|
59 static CVIMPSTEngineSearchMgrExtention* NewL( MXIMPContext& aPresenceCtx, |
|
60 CVIMPSTEngineRequestMapper& aRequestMapper |
|
61 ); |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * @param aPresContext: presence context |
|
65 * @param aRequestMapper: Request Mapper for XIMP Events |
|
66 * @return CVIMPSTEngineSearchMgrExtention* a new instance of this class |
|
67 */ |
|
68 static CVIMPSTEngineSearchMgrExtention* NewLC( MXIMPContext& aPresenceCtx, |
|
69 CVIMPSTEngineRequestMapper& aRequestMapper); |
|
70 |
|
71 /** |
|
72 * C++ Destructor. |
|
73 */ |
|
74 virtual ~CVIMPSTEngineSearchMgrExtention(); |
|
75 |
|
76 |
|
77 private: |
|
78 |
|
79 /** |
|
80 * default constructor |
|
81 * @param aPresContext: presence context |
|
82 * @param aRequestMapper: Request Mapper for XIMP Events |
|
83 */ |
|
84 CVIMPSTEngineSearchMgrExtention( MXIMPContext& aPresenceCtx, |
|
85 CVIMPSTEngineRequestMapper& aRequestMapper ); |
|
86 |
|
87 /** |
|
88 * second phase ConstructL |
|
89 */ |
|
90 void ConstructL(); |
|
91 |
|
92 /** |
|
93 * convert the client search keys to ximpfw search keys |
|
94 * @parma aKey client's search key |
|
95 * @return the ximpfw search key |
|
96 */ |
|
97 TSearchKey ConverttoTSearchKey(TVIMPSTEnums::TVIMPSTSearchKey aKey) ; |
|
98 |
|
99 /** |
|
100 * ConverttoTVIMPSTSearchKey |
|
101 * @param aKey: ximpfw key to be conversted |
|
102 */ |
|
103 TVIMPSTEnums::TVIMPSTSearchKey ConverttoTVIMPSTSearchKey( TSearchKey aKey); |
|
104 |
|
105 /** |
|
106 * ProcessSearchKeysEventL |
|
107 * @param aSearchKeysEvent: ximpfw KeysEvent to be process |
|
108 */ |
|
109 void ProcessSearchKeysEventL(const MSearchKeysEvent* aSearchKeysEvent); |
|
110 |
|
111 public: // New methods MVIMPSTEngineSearchMgrExtention |
|
112 |
|
113 /** |
|
114 * RegisterSearchObserver registers the observer for search notifications |
|
115 * @param: aObserver to be registered. |
|
116 */ |
|
117 void RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver); |
|
118 |
|
119 /** |
|
120 * UnRegisterSearchObserver registers the observer for search notifications |
|
121 * @param: aObserver to be registered. |
|
122 */ |
|
123 void UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver); |
|
124 |
|
125 /** |
|
126 * SearchContactsL - Used to search for contacts |
|
127 * @param aKeyDataArray ,array of all search key and entered data |
|
128 * return TInt error if any |
|
129 */ |
|
130 TInt SearchContactsL(RArray<TVIMPSTSearchKeyData>& aKeyDataArray ) ; |
|
131 /** |
|
132 * SubscribeForSearchKeysL |
|
133 * subscribe for search keys |
|
134 * @return TInt error if any |
|
135 */ |
|
136 TInt SubscribeForSearchKeysL() ; |
|
137 |
|
138 |
|
139 public: |
|
140 |
|
141 /** |
|
142 * See MVIMPSTEngineExtentionFeatures |
|
143 */ |
|
144 TVIMPSTEnums::FeatureSupport IsSupported() const; |
|
145 |
|
146 |
|
147 /** |
|
148 * See MVIMPSTEngineExtentionFeatures |
|
149 */ |
|
150 TVIMPSTEnums::ExtentionType Type() const; |
|
151 |
|
152 /** |
|
153 * See MVIMPSTEngineExtentionFeatures |
|
154 */ |
|
155 void SetSupported(TVIMPSTEnums::FeatureSupport aSupported) ; |
|
156 |
|
157 |
|
158 public: |
|
159 /** |
|
160 * See MVIMPSTEngineSessionCntxtObserver |
|
161 */ |
|
162 void HandleSessionContextEventL( const MXIMPContext& aContext, |
|
163 const MXIMPBase& aEvent, |
|
164 TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); |
|
165 |
|
166 private: |
|
167 |
|
168 // not own |
|
169 MXIMPContext& iPresenceCtx; |
|
170 |
|
171 //doesnt own |
|
172 CVIMPSTEngineRequestMapper& iRequestMapper; |
|
173 |
|
174 //owns , search suppoted or not |
|
175 TVIMPSTEnums::FeatureSupport iSearchSupported; |
|
176 |
|
177 //owned, search feature ximp interface |
|
178 MSearchFeature* iSearchFeature; |
|
179 |
|
180 //doesnt own |
|
181 MSearch* iSearch; |
|
182 |
|
183 // indicate that already called |
|
184 TBool iAlreadySubscibed; |
|
185 |
|
186 //not owned |
|
187 RPointerArray<MVIMPSTEngineSearchExtentionEventObserver> iSearchObservers; |
|
188 |
|
189 //Stores the XIMP request ErrCode |
|
190 TInt iReqResult; |
|
191 |
|
192 }; |
|
193 |
|
194 #endif //__CVIMPSTENGINESEARCHMGREXTENTION_H |
|
195 |
|
196 // End of File |