startupservices/Startup/inc/StartupAppUi.h
branchRCL_3
changeset 20 c2c61fdca848
parent 19 924385140d98
child 21 9af619316cbf
equal deleted inserted replaced
19:924385140d98 20:c2c61fdca848
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    25 
    25 
    26 
    26 
    27 #ifndef STARTUPAPPUI_H
    27 #ifndef STARTUPAPPUI_H
    28 #define STARTUPAPPUI_H
    28 #define STARTUPAPPUI_H
    29 
    29 
    30 #include <SecondaryDisplay/SecondaryDisplayStartupAPI.h>
    30 // FLAGS
       
    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>
    31 
    42 
    32 
    43 
    33 // USER INCLUDES
    44 // USER INCLUDES
    34 #include "startup.hrh"          //internal state types
    45 #include "startup.hrh"          //internal state types
    35 #include "StartupDefines.h"     //some common defines
    46 #include "StartupDefines.h"     //some common defines
    36  #include <eikappui.h>
    47 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    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
    37 
    56 
    38 // FORWARD DECLARATIONS
    57 // FORWARD DECLARATIONS
    39 
    58 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    59  class CStartupWelcomeAnimation;
       
    60  class CStartupOperatorAnimation;
       
    61 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
    40 class CStartupUserWelcomeNote;
    62 class CStartupUserWelcomeNote;
    41 class CStartupPubSubObserver;
    63 class CStartupPubSubObserver;
    42 
    64 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
    43  class CStartupAnimationWrapper;
    65  class CStartupAnimationWrapper;
    44  class CStartupView;
    66  class CStartupView;
       
    67 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    68  class CStartupTone;
       
    69 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    70 class CStartupMediatorObserver;
    45 
    71 
    46 /**
    72 /**
    47 *  'AppUi' class.
    73 *  'AppUi' class.
    48 *
    74 *
    49 */
    75 */
    50 class CStartupAppUi : public CEikAppUi //: public CAknAppUi
    76 class CStartupAppUi : public CAknAppUi
    51 {
    77 {
    52     public: // Constructors and destructor
    78     public: // Constructors and destructor
    53 
    79 
    54         /**
    80         /**
    55         * C++ default constructor.
    81         * C++ default constructor.
    97         * @param        None
   123         * @param        None
    98         * @return       TBool
   124         * @return       TBool
    99         */
   125         */
   100         TBool HiddenReset();
   126         TBool HiddenReset();
   101 
   127 
   102 
   128 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   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
   103         /**
   165         /**
   104         * Called when welcome or operator animation has finished.
   166         * Called when welcome or operator animation has finished.
   105         *
   167         *
   106         * @since S60 3.2
   168         * @since S60 3.2
   107         */
   169         */
   108         void AnimationFinished();
   170         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
   109 
   187 
   110         /**
   188         /**
   111         * Sets iCleanBoot to EStartupCleanBoot.
   189         * Sets iCleanBoot to EStartupCleanBoot.
   112         * @param        None
   190         * @param        None
   113         * @return       void
   191         * @return       void
   114         */
   192         */
   115         void SetCleanBoot();
   193         void SetCleanBoot();
   116 
   194 
       
   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 );
   117 
   266 
   118 
   267 
   119         void SetCriticalBlockEndedL();
   268         void SetCriticalBlockEndedL();
   120         void WaitingCriticalBlockEndingL();
   269         void WaitingCriticalBlockEndingL();
   121 
   270 
   134         void WaitingStartupAnimationStartL();
   283         void WaitingStartupAnimationStartL();
   135 
   284 
   136         /** System state has changed to EmergencyCallsOnly. Skip the animations. */
   285         /** System state has changed to EmergencyCallsOnly. Skip the animations. */
   137         void SetEmergencyCallsOnlyL();
   286         void SetEmergencyCallsOnlyL();
   138 
   287 
   139 
   288 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   140         /**
   289         /**
   141         * Check if animation should be loaded in advance and do it.
   290         * Check if animation should be loaded in advance and do it.
   142         */
   291         */
   143         void TryPreLoadAnimation();
   292         void TryPreLoadAnimation();
   144 
   293 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   145 
   294 
   146         /**
   295         /**
   147         * Propagates fatal startup error state.
   296         * Propagates fatal startup error state.
   148         * @param        aPropertyChanged
   297         * @param        aPropertyChanged
   149         *               (ETrue, if state received via property changed event)
   298         *               (ETrue, if state received via property changed event)
   150         * @return       void
   299         * @return       void
   151         */
   300         */
   152         void SwStateFatalStartupErrorL( TBool aPropertyChanged );
   301         void SwStateFatalStartupErrorL( TBool aPropertyChanged );
   153 
   302 
       
   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 
   154         /**
   319         /**
   155         * Return value of the__SIMCARD feature
   320         * Return value of the__SIMCARD feature
   156         * @param None
   321         * @param None
   157         * @return TBool
   322         * @return TBool
   158         */
   323         */
   159         TBool SimSupported();
   324         TBool SimSupported();
   160 
   325 
   161        
   326         /**
       
   327         * Return value of KFeatureIdCoverDisplay feature
       
   328         * @param None
       
   329         * @return TBool
       
   330         */
       
   331         TBool CoverUISupported();
   162 
   332 
   163         /**
   333         /**
   164         *  Checks if DOS is in Offline Mode
   334         *  Checks if DOS is in Offline Mode
   165         *
   335         *
   166         *  @return    TBool
   336         *  @return    TBool
   177         * @param        None
   347         * @param        None
   178         * @return       TBool
   348         * @return       TBool
   179         */
   349         */
   180         TBool SimStatusChangedReset();
   350         TBool SimStatusChangedReset();
   181 
   351 
   182     public: // from MEikMenuObserver
   352 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   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
   183 
   377 
   184         /**
   378         /**
   185         * EPOC default constructor.
   379         * EPOC default constructor.
   186         */
   380         */
   187         void ConstructL();
   381         void ConstructL();
   188 
   382 
   189     private: // from CEikAppUi
   383     private: // from CEikAppUi
   190 
   384 
   191 
   385 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   192         /**
   386         /**
   193          * Functionality Commented as no support from Qt
       
   194         * From CAknAppUi.
   387         * From CAknAppUi.
   195         * Handles a change to the application's resources which are shared across
   388         * Handles a change to the application's resources which are shared across
   196         * the environment.
   389         * the environment.
   197         *
   390         *
   198         * @since S60 3.2
   391         * @since S60 3.2
   199         *
   392         *
   200         * @param aType The type of resources that have changed.
   393         * @param aType The type of resources that have changed.
       
   394         */
       
   395         void HandleResourceChangeL( TInt aType );
   201         
   396         
   202         void HandleResourceChangeL( TInt aType );
   397         void IsFTUAvailableL(TBool& aFTUAvailable);
   203         */
   398 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   204 
       
   205 
   399 
   206         /**
   400         /**
   207         *  Takes care of command handling.
   401         *  Takes care of command handling.
   208         *  @param   aCommand        Command to be handled.
   402         *  @param   aCommand        Command to be handled.
   209         *  @return  void
   403         *  @return  void
   245         *  shows the operator animation.
   439         *  shows the operator animation.
   246         */
   440         */
   247         void DoStartupShowOperatorAnimationL();
   441         void DoStartupShowOperatorAnimationL();
   248 
   442 
   249         /**
   443         /**
       
   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         /**
   250         *  Predictive Time and Country selection support
   457         *  Predictive Time and Country selection support
   251         *  Returns ETrue when enabled.
   458         *  Returns ETrue when enabled.
   252         *  @return TBool
   459         *  @return TBool
   253         */
   460         */
   254 		TBool PredictiveTimeEnabled();
   461 		TBool PredictiveTimeEnabled();
   258         *  from the user in case of first boot or
   465         *  from the user in case of first boot or
   259         *  real time clock value is invalid
   466         *  real time clock value is invalid
   260         *  @return    void
   467         *  @return    void
   261         */
   468         */
   262         void DoStartupFirstBootAndRTCCheckL();
   469         void DoStartupFirstBootAndRTCCheckL();
       
   470 
       
   471         /**
       
   472         *  Shows the needed startup queries in first boot
       
   473         *  or when real time clock value is invalid
       
   474         *  @return    void
       
   475         */
       
   476         void ShowStartupQueriesL();
   263 
   477 
   264         /**
   478         /**
   265         *  Last part of the startup phases.
   479         *  Last part of the startup phases.
   266         *  This part does some cleaning things and
   480         *  This part does some cleaning things and
   267         *  calls the Exit().
   481         *  calls the Exit().
   310         * @param None
   524         * @param None
   311         * @return TBool : Off-line Mode status
   525         * @return TBool : Off-line Mode status
   312         */
   526         */
   313         TBool UiInOfflineMode();
   527         TBool UiInOfflineMode();
   314 
   528 
   315       
   529         /**
       
   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 );
   316 
   571 
   317         /**
   572         /**
   318         *  Returns information about is this the first boot happening.
   573         *  Returns information about is this the first boot happening.
   319         *  @return    TBool
   574         *  @return    TBool
   320         */
   575         */
   331         *  when global state change to EStartupSystemFatalError.
   586         *  when global state change to EStartupSystemFatalError.
   332         *  This method is called only from DoNextStartupPhaseL()!!
   587         *  This method is called only from DoNextStartupPhaseL()!!
   333         */
   588         */
   334         void SystemFatalErrorL();
   589         void SystemFatalErrorL();
   335 
   590 
   336         
   591 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION        
   337         /**
   592         /**
   338         * Updates startup UI phase to Publish&Subscribe key KPSStartupUiPhase.
   593         * Updates startup UI phase to Publish&Subscribe key KPSStartupUiPhase.
   339         *
   594         *
   340         * @param aValue the new value to be written to the key KPSStartupUiPhase.
   595         * @param aValue the new value to be written to the key KPSStartupUiPhase.
   341         */
   596         */
   342         void UpdateStartupUiPhase( TInt aValue );
   597         void UpdateStartupUiPhase( TInt aValue );
   343 
   598 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   344 
   599 
   345     private: // ***** Member Data ********************************************
   600     private: // ***** Member Data ********************************************
   346 
   601 
   347 
   602 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   348         // The only window-owning control of the Startup application.
   603         // The only window-owning control of the Startup application.
   349         CStartupView* iMainView;
   604         CStartupView* iMainView;
   350 
   605 
   351         // Used for showing Welcome Animation. Owned. May not be NULL.
   606         // Used for showing Welcome Animation. Owned. May not be NULL.
   352         CStartupAnimationWrapper* iAnimation;
   607         CStartupAnimationWrapper* iAnimation;
   353 
   608 
   354 
   609 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
   355 
   610 
   356         
   611         //used for showing Welcome Animation
   357 
   612         CStartupWelcomeAnimation* iWelcomeAnimation;  //owns
   358 
   613 
       
   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
   359 
   625 
   360         //used for showing user welcome note
   626         //used for showing user welcome note
   361         CPeriodic* iNoteTimer; //owns
   627         CPeriodic* iNoteTimer; //owns
   362 
   628 
   363         //used for exiting application, smoothly without tricky errors
   629         //used for exiting application, smoothly without tricky errors
   364         CPeriodic* iExitTimer; //owns
   630         CPeriodic* iExitTimer; //owns
   365         
   631 
   366        
   632 
       
   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 
   367         //internal execution state
   650         //internal execution state
   368         TStartupInternalState iInternalState;
   651         TStartupInternalState iInternalState;
   369 
   652 
       
   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
   370 
   659 
   371         //is used for quarantee only one time continuing
   660         //is used for quarantee only one time continuing
   372         TBool iStartupFirstBootAndRTCCheckAlreadyCalled;
   661         TBool iStartupFirstBootAndRTCCheckAlreadyCalled;
   373 
   662 
   374         //is used for indicating charger or alarm boot
   663         //is used for indicating charger or alarm boot
   401         CStartupPubSubObserver* iStartupPubSubObserver; //owns
   690         CStartupPubSubObserver* iStartupPubSubObserver; //owns
   402 
   691 
   403         //is used for telling if SIM card is supported
   692         //is used for telling if SIM card is supported
   404         TBool iSimSupported;
   693         TBool iSimSupported;
   405 
   694 
   406      
   695         CStartupMediatorObserver* iStartupMediatorObserver; //owns
   407      
   696 
   408 
   697         TBool iCoverUISupported;
   409   
   698 
       
   699         TInt iCounryListIndex;
   410 
   700 
   411         TTime iTime;
   701         TTime iTime;
   412 
   702 
   413 
   703 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   704         TBool iTouchScreenCalibSupport;
       
   705         TBool iTouchScreenCalibrationDone;
       
   706 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   414 };
   707 };
   415 
   708 
   416 #endif // STARTUPAPPUI_H
   709 #endif // STARTUPAPPUI_H
   417 
   710 
   418 // End of file
   711 // End of file