1 /* |
|
2 * Copyright (c) 2007-2010 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: CSC Applications Service View |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CSCSERVICEVIEW_H |
|
20 #define C_CSCSERVICEVIEW_H |
|
21 |
|
22 #include <aknview.h> |
|
23 #include "mcscservicecontainerobserver.h" |
|
24 #include "mcscengtimerobserver.h" |
|
25 |
|
26 class CCSCAppUi; |
|
27 class CCSCDialog; |
|
28 class CCSCEngCCHHandler; |
|
29 class CCSCServiceContainer; |
|
30 class CCSCEngStartupHandler; |
|
31 class CCSCEngServiceHandler; |
|
32 class CCSCEngBrandingHandler; |
|
33 class CCSCEngServicePluginHandler; |
|
34 class CCSCEngUiExtensionPluginHandler; |
|
35 class CCSCSettingsUi; |
|
36 |
|
37 /** |
|
38 * CCSCServiceView class |
|
39 * An instance of CCSCServiceView is the Application View object |
|
40 * for the CSC application |
|
41 * |
|
42 * @lib |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CCSCServiceView ) : public CAknView, |
|
46 public MEikListBoxObserver, |
|
47 public MCSCServiceContainerObserver, |
|
48 public MCSCEngTimerObserver |
|
49 { |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * |
|
55 * @param aServicePluginHandler reference to service plug-in handler |
|
56 * @param aUiExtensionPluginHandler reference to ui extension |
|
57 * plug-in handler |
|
58 * @param aStartupHandler reference to startup handler |
|
59 * @param aServiceHandler reference to service handler |
|
60 * @param aBrandingHandler reference to branding handler |
|
61 * @param aCCHHandler reference to cch handler |
|
62 */ |
|
63 static CCSCServiceView* NewL( |
|
64 CCSCEngServicePluginHandler& aServicePluginHandler, |
|
65 CCSCEngUiExtensionPluginHandler& aUiExtensionPluginHandler, |
|
66 CCSCEngStartupHandler& aStartupHandler, |
|
67 CCSCEngServiceHandler& aServiceHandler, |
|
68 CCSCEngBrandingHandler& aBrandingHandler, |
|
69 CCSCEngCCHHandler& aCCHHandler ); |
|
70 |
|
71 |
|
72 /** |
|
73 * Two-phased constructor. |
|
74 * |
|
75 * @param aServicePluginHandler reference to service plug-in handler |
|
76 * @param aUiExtensionPluginHandler reference to ui extension |
|
77 * plug-in handler |
|
78 * @param aStartupHandler reference to startup handler |
|
79 * @param aServiceHandler reference to service handler |
|
80 * @param aBrandingHandler reference to branding handler |
|
81 * @param aCCHHandler reference to cch handler |
|
82 */ |
|
83 static CCSCServiceView* NewLC( |
|
84 CCSCEngServicePluginHandler& aServicePluginHandler, |
|
85 CCSCEngUiExtensionPluginHandler& aUiExtensionPluginHandler, |
|
86 CCSCEngStartupHandler& aStartupHandler, |
|
87 CCSCEngServiceHandler& aServiceHandler, |
|
88 CCSCEngBrandingHandler& aBrandingHandler, |
|
89 CCSCEngCCHHandler& aCCHHandler ); |
|
90 |
|
91 |
|
92 /** |
|
93 * Destructor. |
|
94 */ |
|
95 virtual ~CCSCServiceView(); |
|
96 |
|
97 /** |
|
98 * Initializes view with startup parameters. |
|
99 * |
|
100 * @since S60 v5.1 |
|
101 */ |
|
102 void InitializeWithStartupParametersL(); |
|
103 |
|
104 |
|
105 // from base class CAknView |
|
106 |
|
107 /** |
|
108 * From CAknView. |
|
109 * Handles the commands. If the command is command which is require to |
|
110 * display outline-screen, the command display outline-screen |
|
111 * corresponded to required. |
|
112 * |
|
113 * @since S60 v3.0 |
|
114 * @param aCommand Command to be handled. |
|
115 */ |
|
116 void HandleCommandL( TInt aCommand ); |
|
117 |
|
118 |
|
119 /** |
|
120 * From CAknView. |
|
121 * |
|
122 * @since S60 v3.0 |
|
123 * @return The ID of view. |
|
124 */ |
|
125 TUid Id() const; |
|
126 |
|
127 |
|
128 /** |
|
129 * From CAknView. |
|
130 * |
|
131 * @since S60 v3.0 |
|
132 * @param aForeground |
|
133 */ |
|
134 void HandleForegroundEventL( TBool aForeground ); |
|
135 |
|
136 |
|
137 /** |
|
138 * For handling ui extension plug-in exits |
|
139 * |
|
140 * @since S60 v3.2 |
|
141 */ |
|
142 void HandleUiExtensionExitL(); |
|
143 |
|
144 |
|
145 /** |
|
146 * For updating service view |
|
147 * |
|
148 * @since S60 v3.2 |
|
149 */ |
|
150 void UpdateServiceViewL(); |
|
151 |
|
152 |
|
153 /** |
|
154 * For deleting service |
|
155 * |
|
156 * @since S60 v3.2 |
|
157 * @param aServiceId |
|
158 */ |
|
159 void DeleteServiceL( TUint aServiceId ); |
|
160 |
|
161 |
|
162 /** |
|
163 * Service configuration failed. |
|
164 * |
|
165 * @since S60 v3.2 |
|
166 * @param aIndex index of plugin |
|
167 */ |
|
168 void ServiceConfiguringFailedL( TInt aIndex ); |
|
169 |
|
170 |
|
171 /** |
|
172 * Hides dialog wait note |
|
173 * |
|
174 * @since S60 v3.2 |
|
175 * @param aIndex index of plugin |
|
176 */ |
|
177 void HideDialogWaitNote(); |
|
178 |
|
179 |
|
180 /** |
|
181 * For handling service configuration |
|
182 * |
|
183 * @since S60 v3.2 |
|
184 * @param aUid for service setup plugin uid |
|
185 * @return ETrue if configuration canceled by user |
|
186 */ |
|
187 TBool HandleServiceConfigurationL( TUid aUid ); |
|
188 |
|
189 |
|
190 /** |
|
191 * Executes startup actions based on startup parameters. |
|
192 * |
|
193 * @since S60 v5.1 |
|
194 * @param aForeGroundEvent ETrue if initiated by foreground event. |
|
195 * @param aLaunchedFromAi ETrue if launched from active idle. |
|
196 */ |
|
197 void ExecuteStartupActionsL( |
|
198 TBool aForeGroundEvent = EFalse, |
|
199 TBool aLaunchedFromAi = EFalse ); |
|
200 |
|
201 |
|
202 // from base class MCSCServiceContainerObserver |
|
203 |
|
204 /** |
|
205 * Update softkey |
|
206 * |
|
207 * @since S60 v3.2 |
|
208 */ |
|
209 void UpdateCbaL(); |
|
210 |
|
211 |
|
212 protected: |
|
213 |
|
214 // from base class MEIkListBoxObserver |
|
215 |
|
216 /** |
|
217 * From MEikListBoxObserver. |
|
218 * For handling list box events. |
|
219 * |
|
220 * @since S60 v3.0 |
|
221 * @param aListBox for listbox |
|
222 * @param aEventType for event type |
|
223 */ |
|
224 void HandleListBoxEventL( CEikListBox* aListBox, |
|
225 TListBoxEvent aEventType ); |
|
226 |
|
227 |
|
228 private: |
|
229 |
|
230 |
|
231 CCSCServiceView( |
|
232 CCSCEngServicePluginHandler& aServicePluginHandler, |
|
233 CCSCEngUiExtensionPluginHandler& aUiExtensionPluginHandler, |
|
234 CCSCEngStartupHandler& aStartupHandler, |
|
235 CCSCEngServiceHandler& aServiceHandler, |
|
236 CCSCEngBrandingHandler& aBrandingHandler, |
|
237 CCSCEngCCHHandler& aCCHHandler ); |
|
238 |
|
239 |
|
240 void ConstructL(); |
|
241 |
|
242 |
|
243 /** |
|
244 * For handling listbox itemp opening. |
|
245 * |
|
246 * @since S60 v3.2 |
|
247 */ |
|
248 void HandleListboxItemOpenL(); |
|
249 |
|
250 |
|
251 /** |
|
252 * For changing text in the title pane. |
|
253 * |
|
254 * @since S60 v3.2 |
|
255 */ |
|
256 void SetTitlePaneTextL() const; |
|
257 |
|
258 |
|
259 // from base class CAknView |
|
260 |
|
261 /** |
|
262 * From CAknView. |
|
263 * Dynamically initializes the contents of the menu list. |
|
264 * |
|
265 * @since S60 v3.0 |
|
266 * @param aResourceId Initiallized resource |
|
267 * @param aMenuPane Instance to MenuPanel |
|
268 */ |
|
269 void DynInitMenuPaneL( TInt aResourceId, |
|
270 CEikMenuPane* aMenuPane ); |
|
271 |
|
272 |
|
273 /** |
|
274 * From CAknView. |
|
275 * Creates the Container class object. |
|
276 * |
|
277 * @since S60 v3.0 |
|
278 * @param aPrevViewId is not used. |
|
279 * @param aCustomMessageId is not used. |
|
280 * @param aCustomMessage is not used. |
|
281 */ |
|
282 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
283 TUid aCustomMessageId, |
|
284 const TDesC8& aCustomMessage ); |
|
285 |
|
286 |
|
287 /** |
|
288 * From CAknView. |
|
289 * Deletes the Container class object. |
|
290 * |
|
291 * @since S60 v3.0 |
|
292 */ |
|
293 void DoDeactivate(); |
|
294 |
|
295 |
|
296 // from base class MCSCEngTimerObserver |
|
297 |
|
298 /** |
|
299 * From MCSCEngTimerObserver. |
|
300 * |
|
301 * @since S60 v5.0 |
|
302 */ |
|
303 void TimerExpired(); |
|
304 |
|
305 |
|
306 private: // data |
|
307 |
|
308 /** |
|
309 * Reference to CCSCServicePluginHandler |
|
310 */ |
|
311 CCSCEngServicePluginHandler& iServicePluginHandler; |
|
312 |
|
313 /** |
|
314 * Reference to CCSCUiExtensionPluginHandler |
|
315 */ |
|
316 CCSCEngUiExtensionPluginHandler& iUiExtensionPluginHandler; |
|
317 |
|
318 /** |
|
319 * Reference to CCSCEngStartupHandler |
|
320 */ |
|
321 CCSCEngStartupHandler& iStartupHandler; |
|
322 |
|
323 /** |
|
324 * Reference to CCSCEngServiceHandler |
|
325 */ |
|
326 CCSCEngServiceHandler& iServiceHandler; |
|
327 |
|
328 /** |
|
329 * Reference to CCSCEngBrandingHandler |
|
330 */ |
|
331 CCSCEngBrandingHandler& iBrandingHandler; |
|
332 |
|
333 /** |
|
334 * Reference to CCSCEngCCHHandler |
|
335 */ |
|
336 CCSCEngCCHHandler& iCCHHandler; |
|
337 |
|
338 /** |
|
339 * Pointer to service container |
|
340 * Own. |
|
341 */ |
|
342 CCSCServiceContainer* iContainer; |
|
343 |
|
344 /** |
|
345 * Pointer to CSC Settings UI |
|
346 * Own. |
|
347 */ |
|
348 CCSCSettingsUi* iSettingsUi; |
|
349 |
|
350 /** |
|
351 * Flag indicating if DoActivateL is called first time (startup) |
|
352 */ |
|
353 TBool iStartup; |
|
354 |
|
355 /** |
|
356 * Current list item index in container |
|
357 */ |
|
358 TInt iCurrentIndex; |
|
359 |
|
360 /** |
|
361 * Array for already offered to configure plugin uids |
|
362 */ |
|
363 RArray<TUid> iOfferedPluginUids; |
|
364 |
|
365 /** |
|
366 * Pointer to timer |
|
367 * Own. |
|
368 */ |
|
369 CCSCEngTimer* iEngTimer; |
|
370 |
|
371 /** |
|
372 * Plugin info. |
|
373 */ |
|
374 TServicePluginInfo iPluginInfo; |
|
375 |
|
376 /** |
|
377 * Next plugin index. |
|
378 */ |
|
379 TUint iNextPluginIndex; |
|
380 |
|
381 /** |
|
382 * Uid. |
|
383 */ |
|
384 TUid iUid; |
|
385 |
|
386 #ifdef _DEBUG |
|
387 friend class UT_CSC; |
|
388 #endif |
|
389 |
|
390 }; |
|
391 |
|
392 #endif // C_CSCSERVICEVIEW_H |
|