25 |
25 |
26 |
26 |
27 #ifndef STARTUPAPPUI_H |
27 #ifndef STARTUPAPPUI_H |
28 #define STARTUPAPPUI_H |
28 #define STARTUPAPPUI_H |
29 |
29 |
30 // FLAGS |
30 #include <SecondaryDisplay/SecondaryDisplayStartupAPI.h> |
31 //#define USE_STARTUPTEST_APP |
|
32 |
|
33 |
|
34 // SYSTEM INCLUDES |
|
35 #include <aknappui.h> //appui |
|
36 |
|
37 #include <data_caging_path_literals.hrh> |
|
38 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
39 #include <secondarydisplay/SecondaryDisplaySystemStateAPI.h> |
|
40 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
41 #include <secondarydisplay/SecondaryDisplayStartupAPI.h> |
|
42 |
31 |
43 |
32 |
44 // USER INCLUDES |
33 // USER INCLUDES |
45 #include "startup.hrh" //internal state types |
34 #include "startup.hrh" //internal state types |
46 #include "StartupDefines.h" //some common defines |
35 #include "StartupDefines.h" //some common defines |
47 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
36 #include <eikappui.h> |
48 #include "StartupTone.h" |
|
49 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
50 |
|
51 |
|
52 // CONSTANTS |
|
53 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
54 const TInt KConnectionRetryTime = 50000; // 50 ms |
|
55 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
56 |
37 |
57 // FORWARD DECLARATIONS |
38 // FORWARD DECLARATIONS |
58 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
39 |
59 class CStartupWelcomeAnimation; |
|
60 class CStartupOperatorAnimation; |
|
61 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
62 class CStartupUserWelcomeNote; |
40 class CStartupUserWelcomeNote; |
63 class CStartupPubSubObserver; |
41 class CStartupPubSubObserver; |
64 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
42 |
65 class CStartupAnimationWrapper; |
43 class CStartupAnimationWrapper; |
66 class CStartupView; |
44 class CStartupView; |
67 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
68 class CStartupTone; |
|
69 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
70 class CStartupMediatorObserver; |
|
71 |
45 |
72 /** |
46 /** |
73 * 'AppUi' class. |
47 * 'AppUi' class. |
74 * |
48 * |
75 */ |
49 */ |
76 class CStartupAppUi : public CAknAppUi |
50 class CStartupAppUi : public CEikAppUi //: public CAknAppUi |
77 { |
51 { |
78 public: // Constructors and destructor |
52 public: // Constructors and destructor |
79 |
53 |
80 /** |
54 /** |
81 * C++ default constructor. |
55 * C++ default constructor. |
123 * @param None |
97 * @param None |
124 * @return TBool |
98 * @return TBool |
125 */ |
99 */ |
126 TBool HiddenReset(); |
100 TBool HiddenReset(); |
127 |
101 |
128 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
102 |
129 /** |
|
130 * Continue startup when startup tone completes. |
|
131 * @param None |
|
132 * @return void |
|
133 */ |
|
134 void ContinueStartupAfterToneL(TToneType aToneType); |
|
135 |
|
136 /** |
|
137 * Stop startuptone |
|
138 * @param None |
|
139 * @return void |
|
140 */ |
|
141 void StopStartupTone(); |
|
142 |
|
143 /** |
|
144 * Stop startuptone |
|
145 * @param None |
|
146 * @return void |
|
147 */ |
|
148 void StopOperatorTone(); |
|
149 |
|
150 /** |
|
151 * Checks if StartupTone is playing |
|
152 * @param None |
|
153 * @return TBool |
|
154 */ |
|
155 TBool StartupTonePlaying(); |
|
156 |
|
157 /** |
|
158 * Checks if OperatorTone is playing |
|
159 * @param None |
|
160 * @return TBool |
|
161 */ |
|
162 TBool OperatorTonePlaying(); |
|
163 |
|
164 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
165 /** |
103 /** |
166 * Called when welcome or operator animation has finished. |
104 * Called when welcome or operator animation has finished. |
167 * |
105 * |
168 * @since S60 3.2 |
106 * @since S60 3.2 |
169 */ |
107 */ |
170 void AnimationFinished(); |
108 void AnimationFinished(); |
171 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
172 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
173 /** |
|
174 * Brings Startup application to foregound after Touch Screen Calibration and emergency call from PIN query. |
|
175 * @param None |
|
176 * @return void |
|
177 */ |
|
178 void BringToForeground(); |
|
179 |
|
180 /** |
|
181 * Send Startup application to background before Touch Screen Calibration. |
|
182 * @param None |
|
183 * @return void |
|
184 */ |
|
185 void SendToBackground(); |
|
186 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
187 |
109 |
188 /** |
110 /** |
189 * Sets iCleanBoot to EStartupCleanBoot. |
111 * Sets iCleanBoot to EStartupCleanBoot. |
190 * @param None |
112 * @param None |
191 * @return void |
113 * @return void |
192 */ |
114 */ |
193 void SetCleanBoot(); |
115 void SetCleanBoot(); |
194 |
116 |
195 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
196 /** |
|
197 * |
|
198 * @param None |
|
199 * @return void |
|
200 */ |
|
201 void WaitingTouchScreenCalibL(); |
|
202 |
|
203 #ifdef RD_SCALABLE_UI_V2 |
|
204 /** |
|
205 * |
|
206 * @param None |
|
207 * @return void |
|
208 */ |
|
209 void TouchScreenCalibrationDoneL(); |
|
210 #endif // RD_SCALABLE_UI_V2 |
|
211 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
212 |
|
213 |
|
214 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
215 /** |
|
216 * |
|
217 * @param None |
|
218 * @return void |
|
219 */ |
|
220 void CoverUIWelcomeAnimationSyncOKL(); |
|
221 |
|
222 /** |
|
223 * |
|
224 * @param None |
|
225 * @return void |
|
226 */ |
|
227 void WaitingCoverUIWelcomeAnimationSyncL(); |
|
228 |
|
229 /** |
|
230 * |
|
231 * @param None |
|
232 * @return void |
|
233 */ |
|
234 void CoverUIOperatorAnimationSyncOKL(); |
|
235 |
|
236 /** |
|
237 * |
|
238 * @param None |
|
239 * @return void |
|
240 */ |
|
241 void WaitingCoverUIOperatorAnimationSyncL(); |
|
242 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
243 |
|
244 /** |
|
245 * |
|
246 * @param None |
|
247 * @return void |
|
248 */ |
|
249 void WaitingCoverUIStartupReadySyncL(); |
|
250 |
|
251 /** |
|
252 * |
|
253 * @param None |
|
254 * @return void |
|
255 */ |
|
256 void CoverUIStartupReadySyncOKL(); |
|
257 |
|
258 /** |
|
259 * |
|
260 * @param None |
|
261 * @return void |
|
262 */ |
|
263 void RaiseCoverUIEvent( TUid aCategory, |
|
264 TInt aEventId, |
|
265 const TDesC8& aData ); |
|
266 |
117 |
267 |
118 |
268 void SetCriticalBlockEndedL(); |
119 void SetCriticalBlockEndedL(); |
269 void WaitingCriticalBlockEndingL(); |
120 void WaitingCriticalBlockEndingL(); |
270 |
121 |
283 void WaitingStartupAnimationStartL(); |
134 void WaitingStartupAnimationStartL(); |
284 |
135 |
285 /** System state has changed to EmergencyCallsOnly. Skip the animations. */ |
136 /** System state has changed to EmergencyCallsOnly. Skip the animations. */ |
286 void SetEmergencyCallsOnlyL(); |
137 void SetEmergencyCallsOnlyL(); |
287 |
138 |
288 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
139 |
289 /** |
140 /** |
290 * Check if animation should be loaded in advance and do it. |
141 * Check if animation should be loaded in advance and do it. |
291 */ |
142 */ |
292 void TryPreLoadAnimation(); |
143 void TryPreLoadAnimation(); |
293 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
144 |
294 |
145 |
295 /** |
146 /** |
296 * Propagates fatal startup error state. |
147 * Propagates fatal startup error state. |
297 * @param aPropertyChanged |
148 * @param aPropertyChanged |
298 * (ETrue, if state received via property changed event) |
149 * (ETrue, if state received via property changed event) |
299 * @return void |
150 * @return void |
300 */ |
151 */ |
301 void SwStateFatalStartupErrorL( TBool aPropertyChanged ); |
152 void SwStateFatalStartupErrorL( TBool aPropertyChanged ); |
302 |
153 |
303 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
304 /** |
|
305 * Returns value of iOfflineModeQueryShown. |
|
306 * @param None |
|
307 * @return TBool |
|
308 */ |
|
309 TBool GetOfflineModeQueryShown(); |
|
310 |
|
311 /** |
|
312 * Sets value of iOfflineModeQueryShown. |
|
313 * @param TBool |
|
314 * @return void |
|
315 */ |
|
316 void SetOfflineModeQueryShown(TBool aValue); |
|
317 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
318 |
|
319 /** |
154 /** |
320 * Return value of the__SIMCARD feature |
155 * Return value of the__SIMCARD feature |
321 * @param None |
156 * @param None |
322 * @return TBool |
157 * @return TBool |
323 */ |
158 */ |
324 TBool SimSupported(); |
159 TBool SimSupported(); |
325 |
160 |
326 /** |
161 |
327 * Return value of KFeatureIdCoverDisplay feature |
|
328 * @param None |
|
329 * @return TBool |
|
330 */ |
|
331 TBool CoverUISupported(); |
|
332 |
162 |
333 /** |
163 /** |
334 * Checks if DOS is in Offline Mode |
164 * Checks if DOS is in Offline Mode |
335 * |
165 * |
336 * @return TBool |
166 * @return TBool |
347 * @param None |
177 * @param None |
348 * @return TBool |
178 * @return TBool |
349 */ |
179 */ |
350 TBool SimStatusChangedReset(); |
180 TBool SimStatusChangedReset(); |
351 |
181 |
352 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
182 public: // from MEikMenuObserver |
353 private: |
|
354 /** |
|
355 * For starting startup tone initialization timer when needed |
|
356 * @param None |
|
357 * @return void |
|
358 */ |
|
359 void WaitingStartupToneL(); |
|
360 |
|
361 /** |
|
362 * Callback function of startup tone initialization timer |
|
363 * @param TAny* |
|
364 * @return TInt |
|
365 */ |
|
366 static TInt ToneInitTimerTimeoutL(TAny* aObject); |
|
367 |
|
368 /** |
|
369 * For checking startup tone initialization status |
|
370 * @param None |
|
371 * @return void |
|
372 */ |
|
373 void StartupToneWaitStatusL(); |
|
374 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
375 |
|
376 private: // from MEikMenuObserver |
|
377 |
183 |
378 /** |
184 /** |
379 * EPOC default constructor. |
185 * EPOC default constructor. |
380 */ |
186 */ |
381 void ConstructL(); |
187 void ConstructL(); |
382 |
188 |
383 private: // from CEikAppUi |
189 private: // from CEikAppUi |
384 |
190 |
385 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
191 |
386 /** |
192 /** |
|
193 * Functionality Commented as no support from Qt |
387 * From CAknAppUi. |
194 * From CAknAppUi. |
388 * Handles a change to the application's resources which are shared across |
195 * Handles a change to the application's resources which are shared across |
389 * the environment. |
196 * the environment. |
390 * |
197 * |
391 * @since S60 3.2 |
198 * @since S60 3.2 |
392 * |
199 * |
393 * @param aType The type of resources that have changed. |
200 * @param aType The type of resources that have changed. |
394 */ |
201 |
395 void HandleResourceChangeL( TInt aType ); |
202 void HandleResourceChangeL( TInt aType ); |
396 |
203 */ |
397 void IsFTUAvailableL(TBool& aFTUAvailable); |
204 |
398 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
399 |
205 |
400 /** |
206 /** |
401 * Takes care of command handling. |
207 * Takes care of command handling. |
402 * @param aCommand Command to be handled. |
208 * @param aCommand Command to be handled. |
403 * @return void |
209 * @return void |
439 * shows the operator animation. |
245 * shows the operator animation. |
440 */ |
246 */ |
441 void DoStartupShowOperatorAnimationL(); |
247 void DoStartupShowOperatorAnimationL(); |
442 |
248 |
443 /** |
249 /** |
444 * This part of the startup phases |
|
445 * shows the user welcome note. |
|
446 */ |
|
447 void DoStartupShowUserWelcomeNoteL(); |
|
448 |
|
449 /** |
|
450 * Returns EFalse if date, time and city |
|
451 * queries are disabled for testing purposes |
|
452 * @return TBool |
|
453 */ |
|
454 TBool StartupQueriesEnabled(); |
|
455 |
|
456 /** |
|
457 * Predictive Time and Country selection support |
250 * Predictive Time and Country selection support |
458 * Returns ETrue when enabled. |
251 * Returns ETrue when enabled. |
459 * @return TBool |
252 * @return TBool |
460 */ |
253 */ |
461 TBool PredictiveTimeEnabled(); |
254 TBool PredictiveTimeEnabled(); |
524 * @param None |
310 * @param None |
525 * @return TBool : Off-line Mode status |
311 * @return TBool : Off-line Mode status |
526 */ |
312 */ |
527 TBool UiInOfflineMode(); |
313 TBool UiInOfflineMode(); |
528 |
314 |
529 /** |
315 |
530 * Shows country and city selection lists to the user. |
|
531 * This is shown in first boot. |
|
532 */ |
|
533 void ShowCountryAndCityListsL(); |
|
534 |
|
535 /** |
|
536 * Shows country selection list to the user. |
|
537 * This is shown in first boot. |
|
538 * @return TInt |
|
539 */ |
|
540 TInt ShowCountryListL(); |
|
541 |
|
542 /** |
|
543 * Shows city selection list to the user. |
|
544 * This is shown in first boot. |
|
545 * @return TBool |
|
546 */ |
|
547 TBool ShowCityListL(TUint8 cityGroupId); |
|
548 |
|
549 /** |
|
550 * Shows time query to the user. |
|
551 * This is shown in first boot or when |
|
552 * real time clock isn't valid. |
|
553 * @return TBool |
|
554 */ |
|
555 TBool ShowTimeQueryL(); |
|
556 |
|
557 /** |
|
558 * Shows date query to the user. |
|
559 * This is shown in first boot or when |
|
560 * real time clock isn't valid. |
|
561 * @return TBool |
|
562 */ |
|
563 TBool ShowDateQueryL(); |
|
564 |
|
565 /** |
|
566 * Gets default time and date from cenrep |
|
567 * @param aTime |
|
568 * @return void |
|
569 */ |
|
570 void GetDefaultTimeAndDate( TTime& aTime ); |
|
571 |
316 |
572 /** |
317 /** |
573 * Returns information about is this the first boot happening. |
318 * Returns information about is this the first boot happening. |
574 * @return TBool |
319 * @return TBool |
575 */ |
320 */ |
586 * when global state change to EStartupSystemFatalError. |
331 * when global state change to EStartupSystemFatalError. |
587 * This method is called only from DoNextStartupPhaseL()!! |
332 * This method is called only from DoNextStartupPhaseL()!! |
588 */ |
333 */ |
589 void SystemFatalErrorL(); |
334 void SystemFatalErrorL(); |
590 |
335 |
591 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
336 |
592 /** |
337 /** |
593 * Updates startup UI phase to Publish&Subscribe key KPSStartupUiPhase. |
338 * Updates startup UI phase to Publish&Subscribe key KPSStartupUiPhase. |
594 * |
339 * |
595 * @param aValue the new value to be written to the key KPSStartupUiPhase. |
340 * @param aValue the new value to be written to the key KPSStartupUiPhase. |
596 */ |
341 */ |
597 void UpdateStartupUiPhase( TInt aValue ); |
342 void UpdateStartupUiPhase( TInt aValue ); |
598 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
343 |
599 |
344 |
600 private: // ***** Member Data ******************************************** |
345 private: // ***** Member Data ******************************************** |
601 |
346 |
602 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
347 |
603 // The only window-owning control of the Startup application. |
348 // The only window-owning control of the Startup application. |
604 CStartupView* iMainView; |
349 CStartupView* iMainView; |
605 |
350 |
606 // Used for showing Welcome Animation. Owned. May not be NULL. |
351 // Used for showing Welcome Animation. Owned. May not be NULL. |
607 CStartupAnimationWrapper* iAnimation; |
352 CStartupAnimationWrapper* iAnimation; |
608 |
353 |
609 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
354 |
610 |
355 |
611 //used for showing Welcome Animation |
356 |
612 CStartupWelcomeAnimation* iWelcomeAnimation; //owns |
357 |
613 |
358 |
614 //used for showing Operator Animation |
|
615 CStartupOperatorAnimation* iOperatorAnimation; //owns |
|
616 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
617 |
|
618 //used for showing User Welcome Note |
|
619 CStartupUserWelcomeNote* iUserWelcomeNote; //owns |
|
620 |
|
621 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
622 //used for showing welcome animation |
|
623 CPeriodic* iAnimTimer; //owns |
|
624 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
625 |
359 |
626 //used for showing user welcome note |
360 //used for showing user welcome note |
627 CPeriodic* iNoteTimer; //owns |
361 CPeriodic* iNoteTimer; //owns |
628 |
362 |
629 //used for exiting application, smoothly without tricky errors |
363 //used for exiting application, smoothly without tricky errors |
630 CPeriodic* iExitTimer; //owns |
364 CPeriodic* iExitTimer; //owns |
631 |
365 |
632 |
366 |
633 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
634 // Used for playing startup tone |
|
635 CStartupTone* iStartupTone; //owns |
|
636 |
|
637 // Used for waiting startup tone initialization |
|
638 CPeriodic* iToneInitTimer; //owns |
|
639 |
|
640 // Used for playing operator startup tone |
|
641 CStartupTone* iOpStartupTone; //owns |
|
642 |
|
643 // Used for following tone initialization time |
|
644 TInt iToneInitWaitTime; |
|
645 |
|
646 //used for telling if the user welcome note is animation |
|
647 TBool iAnimation; |
|
648 #endif RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
649 |
|
650 //internal execution state |
367 //internal execution state |
651 TStartupInternalState iInternalState; |
368 TStartupInternalState iInternalState; |
652 |
369 |
653 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
654 //is used for telling the application that |
|
655 //splashscreen should be removed for showing the code queries |
|
656 //or welcome note |
|
657 TBool iSplashScreenShouldBeRemoved; |
|
658 #endif RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
659 |
370 |
660 //is used for quarantee only one time continuing |
371 //is used for quarantee only one time continuing |
661 TBool iStartupFirstBootAndRTCCheckAlreadyCalled; |
372 TBool iStartupFirstBootAndRTCCheckAlreadyCalled; |
662 |
373 |
663 //is used for indicating charger or alarm boot |
374 //is used for indicating charger or alarm boot |