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