|
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: Search view declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVIMPSTUISEARCHVIEW_H |
|
21 #define CVIMPSTUISEARCHVIEW_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> // CBase |
|
26 #include <badesca.h> |
|
27 #include <AknIconArray.h> |
|
28 |
|
29 #include "CxSPBaseView.h" |
|
30 #include "tvimpstenums.h" |
|
31 #include "mvimpstcmdobserver.h" |
|
32 #include "mvimpstenginesearchextentioneventobserver.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CVIMPSTUiSearchViewControl; |
|
36 class CVIMPSTUIExtensionService; |
|
37 class MVIMPSTEngine; |
|
38 class MVIMPSTCmdHandler; |
|
39 class CAknNavigationDecorator; |
|
40 class CVIMPSTUtilsWaitNote; |
|
41 class CAsyncCallBack; |
|
42 |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * Search view implementation |
|
47 * @lib vimpstui.lib |
|
48 * @since S60 v5.0 |
|
49 */ |
|
50 // codescanner warnings can be ignored as CxSPBaseView derived from CBsse |
|
51 |
|
52 class CVIMPSTUiSearchView :public CxSPBaseView, |
|
53 public MVIMPSTCmdObserver, |
|
54 public MVIMPSTEngineSearchExtentionEventObserver |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 |
|
59 /** |
|
60 * Creates a new CVIMPSTUiSearchView. |
|
61 * |
|
62 * @param aMapper Reference to view mapper object |
|
63 * @param aContactManager Reference to contact manager object |
|
64 * @param aSearchViewId search view id |
|
65 * @param aServiceId service id |
|
66 * @param aView Reference to Phonebook2-created view instance |
|
67 * @param aId native view id |
|
68 * @param aServiceData Reference to ui extension service |
|
69 * @param aEngine Reference to engine object |
|
70 * @param aCommandHandler Reference to commnad handler object |
|
71 * @return New instance of this class |
|
72 */ |
|
73 static CVIMPSTUiSearchView* NewL( MxSPViewMapper& aMapper, |
|
74 MxSPContactManager& aContactManager, |
|
75 TUint aSearchViewId, |
|
76 TUint aServiceId, |
|
77 CPbk2UIExtensionView& aView, |
|
78 TUid aId, |
|
79 CVIMPSTUIExtensionService& aServiceData, |
|
80 MVIMPSTEngine& aEngine, |
|
81 MVIMPSTCmdHandler& aCommandHandler ); |
|
82 |
|
83 |
|
84 |
|
85 public: // From MPbk2UIExtensionView through CxSPBaseView |
|
86 |
|
87 /** |
|
88 * @see MPbk2UIExtensionView |
|
89 */ |
|
90 TBool HandleCommandKeyL( |
|
91 const TKeyEvent& aKeyEvent, |
|
92 TEventCode aType ); |
|
93 |
|
94 /** |
|
95 * @see MPbk2UIExtensionView |
|
96 */ |
|
97 void DoDeactivate(); |
|
98 |
|
99 /** |
|
100 * @see MPbk2UIExtensionView |
|
101 */ |
|
102 void HandleCommandL( TInt aCommand ); |
|
103 |
|
104 /** |
|
105 * @see MPbk2UIExtensionView |
|
106 */ |
|
107 void DynInitMenuPaneL( TInt aResourceId, |
|
108 CEikMenuPane* aMenuPane ); |
|
109 |
|
110 /** |
|
111 * @see MPbk2UIExtensionView |
|
112 */ |
|
113 void HandleStatusPaneSizeChange(); |
|
114 |
|
115 /** |
|
116 * Function to launch help |
|
117 */ |
|
118 void LaunchHelpL( const TDesC& aContext); |
|
119 |
|
120 /** |
|
121 * Search CallBack function |
|
122 * This is used to call the search functionality when its called form the |
|
123 * Tabbed view |
|
124 * |
|
125 * @param aInstance : Search view pointer is passed in our case |
|
126 * @return Error to call back function |
|
127 */ |
|
128 static TInt SearchCallbackL(TAny* aInstance); |
|
129 |
|
130 private: // From CxSPBaseView |
|
131 |
|
132 /** |
|
133 * @see CxSPBaseView |
|
134 */ |
|
135 void DoActivateViewL( const TVwsViewId& aPrevViewId, |
|
136 TUid aCustomMessageId, |
|
137 const TDesC8& aCustomMessage ); |
|
138 |
|
139 |
|
140 private : //From MImCommandObserver |
|
141 |
|
142 /** |
|
143 * @see MImCommandObserver |
|
144 */ |
|
145 void CommandFinishedL( |
|
146 const MVIMPSTCmd& aCommand ); |
|
147 |
|
148 /** |
|
149 * @see MImCommandObserver |
|
150 */ |
|
151 void HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) ; |
|
152 |
|
153 private: |
|
154 |
|
155 /** |
|
156 * Used to search for contacts matched against entered string |
|
157 */ |
|
158 void SearchContactsL(); |
|
159 |
|
160 |
|
161 /** |
|
162 * This function updates text to navi pane |
|
163 */ |
|
164 void UpdateNaviPaneTextL( ); |
|
165 |
|
166 |
|
167 private: // Functions from MVIMPSTEngineSearchExtentionEventObserver |
|
168 |
|
169 /** |
|
170 * @see MVIMPSTEngineSearchExtentionEventObserver |
|
171 */ |
|
172 void HandleSearchResultL(RArray<TVIMPSTSearchData> aSerachData) ; |
|
173 |
|
174 /** |
|
175 * @see MVIMPSTEngineSearchExtentionEventObserver |
|
176 */ |
|
177 void HandleSearchFinishedL(TInt aError); |
|
178 |
|
179 |
|
180 /** |
|
181 * @see MVIMPSTEngineSearchExtentionEventObserver |
|
182 */ |
|
183 void HandleSearchKeysEventL( RArray<TInt>& aEnumKeysArray, RPointerArray<HBufC>& aLebelKeysArray ) ; |
|
184 |
|
185 |
|
186 private: |
|
187 |
|
188 /** |
|
189 * Standard C++ constructor |
|
190 * @param aMapper Reference to view mapper object |
|
191 * @param aContactManager Reference to contact manager object |
|
192 * @param aSearchViewId search view id |
|
193 * @param aServiceId service id |
|
194 * @param aView Reference to Phonebook2-created view instance |
|
195 * @param aId native view id |
|
196 * @param aServiceData Reference to ui extension service |
|
197 * @param aEngine Reference to engine object |
|
198 * @param aCommandHandler Reference to commnad handler object |
|
199 */ |
|
200 CVIMPSTUiSearchView( MxSPViewMapper& aMapper, |
|
201 MxSPContactManager& aContactManager, |
|
202 TUint aSearchViewId, |
|
203 TUint aServiceId, |
|
204 CPbk2UIExtensionView& aView, |
|
205 TUid aId, |
|
206 CVIMPSTUIExtensionService& aServiceData, |
|
207 MVIMPSTEngine& aEngine, |
|
208 MVIMPSTCmdHandler& aCommandHandler ); |
|
209 |
|
210 /** |
|
211 * Performs the 2nd phase of construction. |
|
212 */ |
|
213 void ConstructL(); |
|
214 |
|
215 /** |
|
216 * Standard C++ destructor. |
|
217 */ |
|
218 ~CVIMPSTUiSearchView(); |
|
219 |
|
220 public: |
|
221 |
|
222 /** |
|
223 * returns ETrue if the contact is already in the contact list |
|
224 * else returns EFalse |
|
225 * Based on this option "add to contacts " is shown |
|
226 * |
|
227 * @return whether the contact is already in the contact list or not |
|
228 */ |
|
229 TBool HideAddToContactsL() const; |
|
230 |
|
231 |
|
232 private: // Data |
|
233 |
|
234 // Own: This view's control container |
|
235 CVIMPSTUiSearchViewControl* iContainer; |
|
236 |
|
237 // Stores view id |
|
238 TUint iSearchViewId; |
|
239 |
|
240 //service id |
|
241 TUint32 iServiceId; |
|
242 |
|
243 //Doesnt own - reference to engine for this service |
|
244 MVIMPSTEngine& iEngine; |
|
245 |
|
246 // Own: Used for navigation pane text |
|
247 CAknNavigationDecorator* iNaviDecorator; |
|
248 |
|
249 //doesnt own, refernec to extension service |
|
250 CVIMPSTUIExtensionService& iExtensionService; |
|
251 |
|
252 //Owns command Handler for this view |
|
253 MVIMPSTCmdHandler& iCommandHandler; |
|
254 |
|
255 // owned |
|
256 CVIMPSTUtilsWaitNote* iWaitNote; |
|
257 |
|
258 // this flag is to check whether the search id initiated |
|
259 // from the search view or not |
|
260 // At the first time its EFalse since search is always initiated from tabview |
|
261 TBool iSearchInitiated; |
|
262 |
|
263 //flag to check if End Key was pressed |
|
264 TBool iEndKeyPressed; |
|
265 /** |
|
266 * Active object for async calls. |
|
267 */ |
|
268 CAsyncCallBack* iCallBack; |
|
269 |
|
270 }; |
|
271 |
|
272 #endif // CVIMPSTUISEARCHVIEW_H |
|
273 |
|
274 // End of File |