|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Declares the firmware update view for the application |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CNSMLDMFOTAVIEW_H |
|
21 #define CNSMLDMFOTAVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <aknview.h> |
|
25 #include <AknWaitNoteWrapper.h> |
|
26 #include <e32property.h> |
|
27 #include "NSmlDMProgress.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CNSmlDMFotaContainer; |
|
31 class CNSmlDMFotaModel; |
|
32 class CAknIconArray; |
|
33 class CDLObserver; |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Fota view in the NSmlDMSyncApp. |
|
38 * |
|
39 * @lib NSmlDMSyncApp |
|
40 * @since Series 60 3.1 |
|
41 */ |
|
42 enum TFotaState |
|
43 { |
|
44 /** No firmware update has been started */ |
|
45 EIdle = 10, |
|
46 /** Client has sent a client initiated request */ |
|
47 EClientRequest = 5, |
|
48 /** There is no data available and download is about to start */ |
|
49 EStartingDownload = 15, |
|
50 /** Download failed and there is no data received */ |
|
51 EDownloadFailed = 20, |
|
52 /** Download is progressing with resume support. This state shouldn't be set as FUMO state*/ |
|
53 EDownloadProgressingWithResume = 25, |
|
54 /** Denotes that a download has started and that 0 or more bytes of |
|
55 data have been downloaded */ |
|
56 EDownloadProgressing = 30, |
|
57 /** Have data and download has been completed successfully */ |
|
58 EDownloadComplete = 40, |
|
59 /** Have data and about to start update */ |
|
60 EStartingUpdate = 50, |
|
61 /** Denotes that the update is currently running, but has not yet |
|
62 completed */ |
|
63 EUpdateProgressing = 60, |
|
64 /** Have data but update failed */ |
|
65 EUpdateFailed = 70, |
|
66 /** Update failed and data deleted or removed */ |
|
67 EUpdateFailedNoData = 80, |
|
68 /** Update complete and data still available */ |
|
69 EUpdateSuccessful = 90, |
|
70 /** Data deleted or removed after a successful update */ |
|
71 EUpdateSuccessfulNoData = 100, |
|
72 }; |
|
73 |
|
74 class CNSmlDMFotaView : public CAknView, public MAknBackgroundProcess |
|
75 { |
|
76 friend class CDLObserver; |
|
77 public: // Constructors and destructor |
|
78 |
|
79 /** |
|
80 * Symbian 2nd phase constructor. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 /** |
|
85 * Destructor. |
|
86 */ |
|
87 virtual ~CNSmlDMFotaView(); |
|
88 |
|
89 public: // Functions from base classes |
|
90 |
|
91 /** |
|
92 * From CAknView Returns view id. |
|
93 * @since Series 60 3.1 |
|
94 * @param None. |
|
95 * @return View identifier. |
|
96 */ |
|
97 TUid Id() const; |
|
98 |
|
99 /** |
|
100 * From CAknView Handles user commands. |
|
101 * @since Series 60 3.1 |
|
102 * @param aCommand The command identifier. |
|
103 * @return None. |
|
104 */ |
|
105 void HandleCommandL( TInt aCommand ); |
|
106 |
|
107 /** |
|
108 * From MAknBackgroundProcess Is called periodically by the |
|
109 * wait note wrapper. |
|
110 * @since Series 60 3.1 |
|
111 * @param None. |
|
112 * @return None. |
|
113 */ |
|
114 void StepL(); |
|
115 |
|
116 /** |
|
117 * From MAknBackgroundProcess Checks if the process is finished |
|
118 * and the wait note can be dismissed. |
|
119 * @since Series 60 3.1 |
|
120 * @param None. |
|
121 * @return Can the wait note be dismissed. |
|
122 */ |
|
123 TBool IsProcessDone() const; |
|
124 |
|
125 public: // New functions |
|
126 |
|
127 /** |
|
128 * Refreshes the container contents. |
|
129 * @since Series 60 3.2 |
|
130 * @param aPostponeDisplay, on ETrue adds the first list item |
|
131 * @return None. |
|
132 */ |
|
133 |
|
134 void RefreshL(TBool aPostponeDisplay); |
|
135 |
|
136 |
|
137 /** |
|
138 * For setting the iExitPress value. |
|
139 * @since Series 60 3.2 |
|
140 * @param None. |
|
141 * @return None. |
|
142 */ |
|
143 void UpdateExitL(); |
|
144 |
|
145 private: // New functions |
|
146 |
|
147 /** |
|
148 * ?member_description. |
|
149 * @since Series 60 3.1 |
|
150 * @param None |
|
151 * @return None |
|
152 */ |
|
153 void InitiateFotaCheckL(); |
|
154 |
|
155 /** |
|
156 * Shows a popup list of available device management |
|
157 * profiles. Leaves if the query is cancelled. |
|
158 * @since Series 60 3.1 |
|
159 * @param None |
|
160 * @return Identifier of the selected profile. |
|
161 */ |
|
162 TInt ShowFotaProfileQueryL(); |
|
163 |
|
164 /** |
|
165 * Formats the fota initiation profile query |
|
166 * listbox items. |
|
167 * @since Series 60 3.1 |
|
168 * @param aItems Array of items included in the listbox |
|
169 * @param aProfileIdList Is changed to an array of profile identifiers. The order is the same as the listbox itmes. |
|
170 * @return None |
|
171 */ |
|
172 void FormatProfileQueryListItemsL( CDesCArray* aItems, |
|
173 CArrayFixFlat<TInt>* aProfileIdList ); |
|
174 |
|
175 /** |
|
176 * Creates a listbox icon array containing the device |
|
177 * management bearer icons. |
|
178 * @since Series 60 3.1 |
|
179 * @param aIconArray Pointer to the icon array to be formatted. |
|
180 * @return None |
|
181 */ |
|
182 void CreateIconArrayL( CAknIconArray* aIconArray ); |
|
183 |
|
184 /** |
|
185 * Initiates a firmware update package installation. |
|
186 * @since Series 60 3.1 |
|
187 * @param None. |
|
188 * @return None. |
|
189 */ |
|
190 void InitiateFwUpdInstallL(); |
|
191 |
|
192 /** |
|
193 * Continues a firmware update package installation which is suspended. |
|
194 * @since Series 60 3.2 |
|
195 * @param None. |
|
196 * @return None. |
|
197 */ |
|
198 void InitiateFwUpdContinueL(); |
|
199 |
|
200 /** |
|
201 * Manual check allowed or not. |
|
202 * @since Series 60 3.2 |
|
203 * @param None. |
|
204 * @return TBool based on manual; check allowed or not. |
|
205 */ |
|
206 TBool ManualCheckAllowedL(); |
|
207 |
|
208 /** |
|
209 * Enabling context options msk. |
|
210 * @since Series 60 3.2 |
|
211 * @param TBool aEnabled. |
|
212 * @return None. |
|
213 */ |
|
214 void EnableMskL ( TBool aEnable ); |
|
215 |
|
216 private: // Functions from base classes |
|
217 /** |
|
218 * From CAknView Activates view. |
|
219 * @since Series 60 3.1 |
|
220 * @param aPrevViewId Id of previous view. |
|
221 * @param aCustomMessageId Custom message id. |
|
222 * @param aCustomMessage Custom message. |
|
223 * @return None. |
|
224 */ |
|
225 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
226 TUid aCustomMessageId, |
|
227 const TDesC8& aCustomMessage ); |
|
228 |
|
229 /** |
|
230 * From CAknView Deactivates view. |
|
231 * @since Series 60 3.1 |
|
232 * @param None. |
|
233 * @return None. |
|
234 */ |
|
235 void DoDeactivate(); |
|
236 |
|
237 /** |
|
238 * From CAknView Dynamically initialises options menu. |
|
239 * @since Series 60 3.1 |
|
240 * @param aResourceId Id identifying the menu pane to initialise. |
|
241 * @param aMenuPane The in-memory representation of the menu pane. |
|
242 * @return None. |
|
243 */ |
|
244 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
245 |
|
246 protected: |
|
247 /** |
|
248 * From CAknView to handle foreground events |
|
249 * @since Series 60 3.2 |
|
250 * @param aForeground |
|
251 * @return None. |
|
252 */ |
|
253 void HandleForegroundEventL(TBool aForeground); |
|
254 |
|
255 private: // Data |
|
256 // Container for view contol. |
|
257 CNSmlDMFotaContainer* iContainer; |
|
258 |
|
259 // Pointer to the fota model instance. |
|
260 CNSmlDMFotaModel* iFotaModel; |
|
261 |
|
262 // Pointer to the wait note wrapper that is used during |
|
263 // the manual checking of firmware updates. |
|
264 CAknWaitNoteWrapper* iWaitNoteWrapper; |
|
265 |
|
266 //For storing cenrep value of manual check updates |
|
267 TInt iManCheckAllowed; |
|
268 |
|
269 //T be used in HandleForegroundeventL for Exit and End key press |
|
270 TInt iExitPress; |
|
271 |
|
272 // Active object for refreshing main view |
|
273 CDLObserver* iFotaDLObserver; |
|
274 }; |
|
275 |
|
276 // CLASS DECLARATION |
|
277 // Active object for refreshing main view |
|
278 class CDLObserver : public CActive |
|
279 { |
|
280 friend class CNSmlDMFotaView; |
|
281 public: |
|
282 |
|
283 /** |
|
284 * Constructor. |
|
285 */ |
|
286 inline CDLObserver(); |
|
287 |
|
288 /** |
|
289 * Starts the active object monitoring on P&S key |
|
290 * @param aResetKey,whcih sets the P&S key |
|
291 * @return None |
|
292 */ |
|
293 void StartL(TBool aResetKey); |
|
294 |
|
295 /** |
|
296 * Destructor. |
|
297 */ |
|
298 ~CDLObserver(); |
|
299 |
|
300 private: |
|
301 |
|
302 /** |
|
303 * From CActive. Called when asynchronous request completes. |
|
304 * @param None |
|
305 * @return None |
|
306 */ |
|
307 void RunL(); |
|
308 |
|
309 /** |
|
310 * From CActive. Cancels asynchronous request. |
|
311 * @param None |
|
312 * @return None |
|
313 */ |
|
314 void DoCancel(); |
|
315 |
|
316 /** |
|
317 * Symbian 2nd phase constructor. |
|
318 */ |
|
319 void ConstructL(CNSmlDMFotaView *iFotaView); |
|
320 |
|
321 /** |
|
322 * From CActive. Called when RunL Leaves. |
|
323 * @param None |
|
324 * @return error |
|
325 */ |
|
326 TInt RunError( TInt aError ); |
|
327 |
|
328 private: |
|
329 CNSmlDMFotaView* iView; |
|
330 RProperty iProperty; |
|
331 }; |
|
332 |
|
333 #endif // CNSMLDMFOTAVIEW_H |
|
334 |
|
335 // End of File |