startupservices/Startup/src/StartupAppUi.cpp
changeset 29 6a787171e1de
parent 28 b0b858956ed5
child 46 eea20ed08f4b
equal deleted inserted replaced
28:b0b858956ed5 29:6a787171e1de
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // SYSTEM INCLUDES
    19 // SYSTEM INCLUDES
    20 #include <StringLoader.h>
    20 #include <StringLoader.h>
    21 #include <AknGlobalNote.h>          //used for Selftest failed note
    21 
    22 #include <aknPopup.h>
       
    23 #include <aknlists.h>
       
    24 #include <aknSDData.h>
       
    25 #include <badesca.h>
       
    26 #include <tzlocalizationdatatypes.h>
       
    27 #include <tzlocalizer.h>
       
    28 #include <tz.h>
       
    29 #include <featmgr.h>                // Feature Manager
    22 #include <featmgr.h>                // Feature Manager
    30 #include <centralrepository.h>
    23 #include <centralrepository.h>
    31 #include <startup.rsg>
    24 #include <startup.rsg>
    32 #include <starterdomaincrkeys.h>
    25 #include <starterdomaincrkeys.h>
    33 #include "startupappprivatepskeys.h"
    26 #include "startupappprivatepskeys.h"
    34 #include <startupdomainpskeys.h>
    27 #include <startupdomainpskeys.h>
    35 #include <startupdomaincrkeys.h>
    28 #include <startupdomaincrkeys.h>
    36 #include <coreapplicationuissdkcrkeys.h>
    29 #include <CoreApplicationUIsSDKCRKeys.h>
    37 #include <starterclient.h>
    30 #include <starterclient.h>
    38 
    31 #include <hbdevicemessageboxsymbian.h>
    39 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
    32 #include "sanimstartupctrl.h"
    40 // Transition effects
       
    41 #include <gfxtranseffect/gfxtranseffect.h>
       
    42 #include <akntranseffect.h>
       
    43 #endif
       
    44 
       
    45 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    46   #include "sanimstartupctrl.h"
       
    47 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    48   #include <akndef.h>                 // For layout change event definitions
       
    49   #include <AknSoundSystem.h>
       
    50 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    51 
    33 
    52 // USER INCLUDES
    34 // USER INCLUDES
    53 #include "StartupAppUi.h"
    35 #include "StartupAppUi.h"
    54 #include "StartupApplication.h"
    36 #include "StartupApplication.h"
    55 #include "StartupUserWelcomeNote.h"
    37 
    56 #include "StartupQueryDialog.h"     //used for Startup own Time and Date queries
       
    57 #include "StartupPopupList.h"       //used for Startup own City and Country queries
       
    58 #include "StartupMediatorObserver.h"
       
    59 #include "StartupPubSubObserver.h"
    38 #include "StartupPubSubObserver.h"
    60 
    39 #include "startupanimationwrapper.h"
    61 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
    40 #include "startupview.h"
    62   #include "startupanimationwrapper.h"
    41   
    63   #include "startupview.h"
    42 #include <eikenv.h>
    64 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
    43 
    65   #include "StartupDocument.h"
    44 
    66   #include "StartupOperatorAnimation.h"
       
    67   #include "StartupTone.h"
       
    68   #include "StartupWelcomeAnimation.h"
       
    69 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    70 
       
    71 
       
    72 // CONSTANTS
       
    73 const TInt KUserWelcomeNoteShowPeriodTime = 3000000; // 3 sec
       
    74 
       
    75 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    76   const TInt KOneMilliSecondInMicroSeconds = 1000;
       
    77   const TInt KMaxToneInitWait = 200; // 200 ms
       
    78 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    79 
       
    80 static const TInt KMaxCityLength(120);
       
    81 static const TInt KMaxCountryLength(120);
       
    82 
       
    83 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    84 static const CSAnimStartupCtrl::TAnimationParams KStartupAnimationParams =
    45 static const CSAnimStartupCtrl::TAnimationParams KStartupAnimationParams =
    85     {
    46     {
    86     KCRUidStartupConf,
    47     KCRUidStartupConf,
    87     KStartupAnimationPath,
    48     KStartupAnimationPath,
    88     KStartupAnimationFrameDelay,
    49     KStartupAnimationFrameDelay,
    89     KStartupAnimationScaling,
    50     KStartupAnimationScaling,
    90     KStartupTonePath,
    51     KStartupTonePath,
    91     KStartupToneVolume
    52     KStartupToneVolume
    92     };
    53     };
    93 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
    54 
    94 
       
    95 _LIT(KEmpty, " ");
       
    96 
       
    97 // Default date and time value is used if cenrep string is not valid
       
    98 // Default date is 01.01.2007 and default time is 09:00 AM
       
    99 _LIT( KDefaultDateTimeValue, "20070000:090000" ); // YYYYMMDD:HHMMSS
       
   100 
       
   101 static const TInt KTimeFormatLength(16); // "20070000:090000."
       
   102 
    55 
   103 _LIT_SECURITY_POLICY_C1(KReadDeviceDataPolicy, ECapabilityReadDeviceData);
    56 _LIT_SECURITY_POLICY_C1(KReadDeviceDataPolicy, ECapabilityReadDeviceData);
   104 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
    57 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
   105 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy);
    58 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy);
   106 
    59 
   107 // ======== LOCAL FUNCTIONS ==================================================
    60 // ======== LOCAL FUNCTIONS ==================================================
   108 
    61 
   109 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   110 namespace
    62 namespace
   111     {
    63     {
   112     TInt AnimationFinishedFunc( TAny* aPtr )
    64     TInt AnimationFinishedFunc( TAny* aPtr )
   113         {
    65         {
   114         static_cast<CStartupAppUi*>( aPtr )->AnimationFinished();
    66         static_cast<CStartupAppUi*>( aPtr )->AnimationFinished();
   115         return KErrNone;
    67         return KErrNone;
   116         }
    68         }
   117     }
    69     }
   118 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
    70 
   119 
    71 
   120 
    72 
   121 // ================= MEMBER FUNCTIONS ========================================
    73 // ================= MEMBER FUNCTIONS ========================================
   122 //
    74 //
   123 // ---------------------------------------------------------------------------
    75 // ---------------------------------------------------------------------------
   124 // CStartupAppUi::CStartupAppUi()
    76 // CStartupAppUi::CStartupAppUi()
   125 // ---------------------------------------------------------------------------
    77 // ---------------------------------------------------------------------------
   126 CStartupAppUi::CStartupAppUi() :
    78 CStartupAppUi::CStartupAppUi() :
   127     iUserWelcomeNote( NULL ),
    79    iInternalState( EStartupStartingUp ),
   128 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
    80 
   129     iStartupTone( NULL ),
       
   130     iOpStartupTone( NULL ),
       
   131     iToneInitWaitTime( 0 ),
       
   132     iAnimation( EFalse ),
       
   133 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   134     iInternalState( EStartupStartingUp ),
       
   135 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   136     iSplashScreenShouldBeRemoved( EFalse ),
       
   137 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   138     iStartupFirstBootAndRTCCheckAlreadyCalled( EFalse ),
    81     iStartupFirstBootAndRTCCheckAlreadyCalled( EFalse ),
   139     iChargingOrAlarmBoot( EFalse ),
    82     iChargingOrAlarmBoot( EFalse ),
   140     iFirstBoot( ETrue ),
    83     iFirstBoot( ETrue ),
   141     iCleanBoot( EStartupNormalBoot ),
    84     iCleanBoot( EStartupNormalBoot ),
   142     iOfflineModeSupported( EFalse ),
    85     iOfflineModeSupported( EFalse ),
   143     iOfflineModeQueryShown( EFalse ),
    86     iOfflineModeQueryShown( EFalse ),
   144     iCriticalBlockEnded( EFalse ),
    87     iCriticalBlockEnded( EFalse ),
   145     iSwStateFatalStartupError( EFalse ),
    88     iSwStateFatalStartupError( EFalse ),
   146     iStartupWaitingShowStartupAnimation( EFalse ),
    89     iStartupWaitingShowStartupAnimation( EFalse ),
   147     iSimSupported( ETrue ),
    90     iSimSupported( ETrue )
   148     iStartupMediatorObserver( NULL ),
    91 
   149     iCoverUISupported( EFalse ),
       
   150     iCounryListIndex( 0 )
       
   151     , iTime( 0 )
       
   152 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   153     , iTouchScreenCalibSupport( EFalse )
       
   154     , iTouchScreenCalibrationDone( EFalse )
       
   155 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   156     {
    92     {
   157     TRACES("CStartupAppUi::CStartupAppUi");
    93     TRACES("CStartupAppUi::CStartupAppUi");
   158     }
    94     }
   159 
    95 
   160 // ---------------------------------------------------------------------------
    96 // ---------------------------------------------------------------------------
   161 // CStartupAppUi::ConstructL()
    97 // CStartupAppUi::ConstructL()
   162 // ---------------------------------------------------------------------------
    98 // ---------------------------------------------------------------------------
   163 void CStartupAppUi::ConstructL()
    99 void CStartupAppUi::ConstructL()
   164     {
   100     {
   165     TRACES("CStartupAppUi::ConstructL()");
   101     TRACES("CStartupAppUi::ConstructL()");
   166     TInt flags = EStandardApp|EAknEnableSkin|EAknEnableMSK ;
   102     TInt flags = EStandardApp;
   167 
   103    BaseConstructL( flags );
   168     BaseConstructL(flags);
   104         
   169 
       
   170     iAvkonAppUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort |
       
   171                                    CAknAppUiBase::EDisableSendKeyLong );
       
   172 
       
   173 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   174     iMainView = CStartupView::NewL( ApplicationRect() );
   105     iMainView = CStartupView::NewL( ApplicationRect() );
       
   106     
       
   107    
   175     iAnimation = CStartupAnimationWrapper::NewL( *iMainView );
   108     iAnimation = CStartupAnimationWrapper::NewL( *iMainView );
   176 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   109 
   177 
   110 
   178     TInt err = RProperty::Define( KPSUidStartupApp,
   111     TInt err = RProperty::Define( KPSUidStartupApp,
   179                                   KPSStartupAppState,
   112                                   KPSStartupAppState,
   180                                   RProperty::EInt,
   113                                   RProperty::EInt,
   181                                   KReadDeviceDataPolicy,
   114                                   KReadDeviceDataPolicy,
   196         TRACES1("CStartupAppUi::ConstructL(): KPSStartupAppState set err %d", err);
   129         TRACES1("CStartupAppUi::ConstructL(): KPSStartupAppState set err %d", err);
   197         }
   130         }
   198 
   131 
   199     iStartupPubSubObserver = CStartupPubSubObserver::NewL( this );
   132     iStartupPubSubObserver = CStartupPubSubObserver::NewL( this );
   200 
   133 
   201 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   134 
   202     err = RProperty::Define( KPSUidStartup,
   135 
   203                              KStartupBootIntoOffline,
   136 
   204                              RProperty::EInt,
       
   205                              KReadDeviceDataPolicy,
       
   206                              KWriteDeviceDataPolicy );
       
   207 
       
   208     if( KErrNone != err &&
       
   209         KErrAlreadyExists != err )
       
   210         {
       
   211         TRACES1("CStartupAppUi::ConstructL(): KStartupBootIntoOffline define err %d", err);
       
   212         }
       
   213 
       
   214     err = RProperty::Define( KPSUidStartup,
       
   215                              KStartupSecurityCodeQueryStatus,
       
   216                              RProperty::EInt,
       
   217                              KReadDeviceDataPolicy,
       
   218                              KWriteDeviceDataPolicy );
       
   219     if( KErrNone != err &&
       
   220         KErrAlreadyExists != err )
       
   221         {
       
   222         TRACES1("CStartupAppUi::ConstructL(): KStartupSecurityCodeQueryStatus define err %d", err);
       
   223         }
       
   224     err = RProperty::Define( KPSUidStartup,
       
   225                              KStartupCleanBoot,
       
   226                              RProperty::EInt,
       
   227                              KReadDeviceDataPolicy,
       
   228                              KWriteDeviceDataPolicy );
       
   229     if( KErrNone != err &&
       
   230         KErrAlreadyExists != err )
       
   231         {
       
   232         TRACES1("CStartupAppUi::ConstructL(): KStartupCleanBoot define err %d", err);
       
   233         }
       
   234 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   235 
       
   236 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   237     err = RProperty::Define( KPSUidStartup,
   137     err = RProperty::Define( KPSUidStartup,
   238                              KPSStartupUiPhase,
   138                              KPSStartupUiPhase,
   239                              RProperty::EInt, 
   139                              RProperty::EInt, 
   240                              KAlwaysPassPolicy,
   140                              KAlwaysPassPolicy,
   241                              KWriteDeviceDataPolicy );
   141                              KWriteDeviceDataPolicy );
   245         {
   145         {
   246         TRACES1("CStartupAppUi::ConstructL(): KPSStartupUiPhase define err %d", err);       
   146         TRACES1("CStartupAppUi::ConstructL(): KPSStartupUiPhase define err %d", err);       
   247         }
   147         }
   248     
   148     
   249     UpdateStartupUiPhase( EStartupUiPhaseUninitialized );
   149     UpdateStartupUiPhase( EStartupUiPhaseUninitialized );
   250 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   150 
   251 
   151 
   252     FeatureManager::InitializeLibL();
   152     FeatureManager::InitializeLibL();
   253     if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
   153     if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
   254         {
   154         {
   255         iOfflineModeSupported = ETrue;
   155         iOfflineModeSupported = ETrue;
   256         }
   156         }
   257     if ( !FeatureManager::FeatureSupported( KFeatureIdSimCard ) )
   157     if ( !FeatureManager::FeatureSupported( KFeatureIdSimCard ) )
   258         {
   158         {
   259         iSimSupported = EFalse;
   159         iSimSupported = EFalse;
   260         }
   160         }
   261     if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) )
   161     
   262         {
       
   263         iCoverUISupported = ETrue;
       
   264         }
       
   265 
   162 
   266     TRACES1("CStartupAppUi::ConstructL(): Offline mode supported: %d", iOfflineModeSupported );
   163     TRACES1("CStartupAppUi::ConstructL(): Offline mode supported: %d", iOfflineModeSupported );
   267     TRACES1("CStartupAppUi::ConstructL(): SIM card supported:     %d", iSimSupported );
   164     TRACES1("CStartupAppUi::ConstructL(): SIM card supported:     %d", iSimSupported );
   268     TRACES1("CStartupAppUi::ConstructL(): CoverUI supported:      %d", iCoverUISupported );
   165     
   269 
       
   270 #if defined (RD_SCALABLE_UI_V2) && !defined(RD_STARTUP_ANIMATION_CUSTOMIZATION)
       
   271     if ( FeatureManager::FeatureSupported(KFeatureIdPenSupport) &&
       
   272          FeatureManager::FeatureSupported(KFeatureIdPenSupportCalibration) )
       
   273         {
       
   274         iTouchScreenCalibSupport = ETrue;
       
   275         }
       
   276 #endif // RD_SCALABLE_UI_V2 && !RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   277 
       
   278     if (iCoverUISupported)
       
   279         {
       
   280         iStartupMediatorObserver = CStartupMediatorObserver::NewL( this );
       
   281         }
       
   282 
   166 
   283     iFirstBoot = FirstBoot();
   167     iFirstBoot = FirstBoot();
   284     TRACES1("CStartupAppUi::ConstructL(): First boot:             %d", iFirstBoot );
   168     TRACES1("CStartupAppUi::ConstructL(): First boot:             %d", iFirstBoot );
   285 
   169 
   286 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   170 
   287     iWelcomeAnimation = CStartupWelcomeAnimation::NewL( this, ClientRect());
   171     CEikonEnv* eikEnv = CEikonEnv::Static();
   288     AddToStackL( iWelcomeAnimation );
       
   289 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   290 
   172 
   291     // Set Startup application to be system application
   173     // Set Startup application to be system application
   292     iEikonEnv->SetSystem( ETrue );
   174     eikEnv->SetSystem( ETrue );
   293 
   175 
   294     iEikonEnv->RootWin().SetOrdinalPosition(0,0);
   176     eikEnv->RootWin().SetOrdinalPosition(0,0);
   295 
   177 
   296     // Disable priority changes of window server
   178     // Disable priority changes of window server
   297     iEikonEnv->WsSession().ComputeMode(
   179     eikEnv->WsSession().ComputeMode(
   298         RWsSession::EPriorityControlDisabled );
   180         RWsSession::EPriorityControlDisabled );
   299 
   181    iNoteTimer = CPeriodic::NewL( EPriorityNormal );
   300     iNoteTimer = CPeriodic::NewL( EPriorityNormal );
   182 
   301 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   302     iAnimTimer = CPeriodic::NewL( EPriorityNormal );
       
   303 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   304     iExitTimer = CPeriodic::NewL( EPriorityNormal );
   183     iExitTimer = CPeriodic::NewL( EPriorityNormal );
   305 
   184 
   306 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   307     TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialising");
       
   308     iStartupTone = CStartupTone::NewL( this, EStartupTone );
       
   309     TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialised");
       
   310 
       
   311     TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialising");
       
   312     iOpStartupTone = CStartupTone::NewL( this, EStartupOpTone );
       
   313     TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialised");
       
   314 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   315 
   185 
   316     if ( iSwStateFatalStartupError )
   186     if ( iSwStateFatalStartupError )
   317         {
   187         {
   318         TRACES("CStartupAppUi::ConstructL(): ESWStateFatalStartupError");
   188         TRACES("CStartupAppUi::ConstructL(): ESWStateFatalStartupError");
   319         DoNextStartupPhaseL( EStartupSystemFatalError );
   189         DoNextStartupPhaseL( EStartupSystemFatalError );
   331 // ---------------------------------------------------------------------------
   201 // ---------------------------------------------------------------------------
   332 CStartupAppUi::~CStartupAppUi()
   202 CStartupAppUi::~CStartupAppUi()
   333     {
   203     {
   334     TRACES("CStartupAppUi::~CStartupAppUi()");
   204     TRACES("CStartupAppUi::~CStartupAppUi()");
   335 
   205 
   336 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   337     if (iWelcomeAnimation)
       
   338         {
       
   339         RemoveFromStack( iWelcomeAnimation );
       
   340         delete iWelcomeAnimation;
       
   341         }
       
   342 
       
   343     if (iOperatorAnimation)
       
   344         {
       
   345         RemoveFromStack( iOperatorAnimation);
       
   346         delete iOperatorAnimation;
       
   347         }
       
   348 
       
   349     if (iUserWelcomeNote)
       
   350         {
       
   351         RemoveFromStack( iUserWelcomeNote );
       
   352         delete iUserWelcomeNote;
       
   353         iUserWelcomeNote = NULL;
       
   354         }
       
   355 
       
   356     if (iStartupPubSubObserver)
       
   357         {
       
   358         delete iStartupPubSubObserver;
       
   359         }
       
   360     if (iStartupMediatorObserver)
       
   361         {
       
   362         delete iStartupMediatorObserver;
       
   363         }
       
   364     if (iStartupTone)
       
   365         {
       
   366         delete iStartupTone;
       
   367         }
       
   368     if (iOpStartupTone)
       
   369         {
       
   370         delete iOpStartupTone;
       
   371         }
       
   372 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   373 
   206 
   374     if( iExitTimer )
   207     if( iExitTimer )
   375         {
   208         {
   376         iExitTimer->Cancel();
   209         iExitTimer->Cancel();
   377         delete iExitTimer;
   210         delete iExitTimer;
   378         }
   211         }
   379 
   212 
   380 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   213 
   381     if( iAnimTimer )
       
   382         {
       
   383         iAnimTimer->Cancel();
       
   384         delete iAnimTimer;
       
   385         }
       
   386 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   387 
   214 
   388     if( iNoteTimer )
   215     if( iNoteTimer )
   389         {
   216         {
   390         iNoteTimer->Cancel();
   217         iNoteTimer->Cancel();
   391         delete iNoteTimer;
   218         delete iNoteTimer;
   392         }
   219         }
   393 
   220 
   394 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   221 
   395     delete iUserWelcomeNote;
   222  
   396     delete iAnimation;
   223     delete iAnimation;
   397     delete iStartupPubSubObserver;
   224     delete iStartupPubSubObserver;
   398     delete iStartupMediatorObserver;
   225    
   399     delete iMainView;
   226     delete iMainView;
   400 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   227 
   401 
   228 
   402     FeatureManager::UnInitializeLib();
   229     FeatureManager::UnInitializeLib();
   403 
   230 
   404     TRACES("CStartupAppUi::~CStartupAppUi(): End");
   231     TRACES("CStartupAppUi::~CStartupAppUi(): End");
   405     }
   232     }
   409 // ---------------------------------------------------------------------------
   236 // ---------------------------------------------------------------------------
   410 void CStartupAppUi::PrepareToExit()
   237 void CStartupAppUi::PrepareToExit()
   411     {
   238     {
   412     TRACES("CStartupAppUi::PrepareToExit()");
   239     TRACES("CStartupAppUi::PrepareToExit()");
   413 
   240 
   414 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
   241 
   415     // Start the custom exit effect at boot time.
   242 
   416     // Note: Not allowed to call GfxTransEffect::EndFullScreen() as AVKON takes care of that when
   243  
   417     // EApplicationExit context is used!
   244 	CEikAppUi::PrepareToExit();
   418 
   245 
   419 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   420     if ( !( iAnimation->WasCancelled() ) )
       
   421 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   422     if( !iWelcomeAnimation->IsAnimationCancelled() )
       
   423 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   424         {
       
   425         TRACES("CStartupAppUi::PrepareToExit(): Starting transition effect");
       
   426 
       
   427         GfxTransEffect::BeginFullScreen( AknTransEffect::EApplicationExit, TRect(),
       
   428             AknTransEffect::EParameterType,
       
   429             AknTransEffect::GfxTransParam( KUidStartUp, AknTransEffect::TParameter::EAllowAtBoot ) );
       
   430         }
       
   431 #endif
       
   432 
       
   433     CEikAppUi::PrepareToExit();
       
   434 #ifndef RD_BOOT_CUSTOMIZABLE_AI
   246 #ifndef RD_BOOT_CUSTOMIZABLE_AI
   435     if( !iChargingOrAlarmBoot )
   247     if( !iChargingOrAlarmBoot )
   436         {
   248         {
   437         TRACES("CStartupAppUi::PrepareToExit(): NOT Charger/alarm boot");
   249         TRACES("CStartupAppUi::PrepareToExit(): NOT Charger/alarm boot");
   438 
   250 
   471     TRACES("CStartupAppUi::DoExitApplication()");
   283     TRACES("CStartupAppUi::DoExitApplication()");
   472     STATIC_CAST( CStartupAppUi*, aObject )->ExitApplication(); // cast, and call non-static function
   284     STATIC_CAST( CStartupAppUi*, aObject )->ExitApplication(); // cast, and call non-static function
   473     TRACES("CStartupAppUi::DoExitApplication(): End");
   285     TRACES("CStartupAppUi::DoExitApplication(): End");
   474     return KErrNone;
   286     return KErrNone;
   475     }
   287     }
       
   288 
   476 
   289 
   477 // ---------------------------------------------------------------------------
   290 // ---------------------------------------------------------------------------
   478 // CStartupAppUi::HandleKeyEventL
   291 // CStartupAppUi::HandleKeyEventL
   479 // ---------------------------------------------------------------------------
   292 // ---------------------------------------------------------------------------
   480 TKeyResponse CStartupAppUi::HandleKeyEventL(
   293 TKeyResponse CStartupAppUi::HandleKeyEventL(
   510             TRACES("CStartupAppUi::HandleKeyEventL(): First key event comes from Offline Mode Query");
   323             TRACES("CStartupAppUi::HandleKeyEventL(): First key event comes from Offline Mode Query");
   511             // first key event comes from Offline Mode Query
   324             // first key event comes from Offline Mode Query
   512             iOfflineModeQueryShown = EFalse;
   325             iOfflineModeQueryShown = EFalse;
   513             response = EKeyWasConsumed;
   326             response = EKeyWasConsumed;
   514             }
   327             }
   515         else if ( iUserWelcomeNote )
   328 		
   516             {
       
   517             TRACES("CStartupAppUi::HandleKeyEventL(): This key event is used to stop UserWelcomeAnimation");
       
   518             //this is used to stop User Welcome note showing
       
   519             StopTimingL();
       
   520             response = EKeyWasConsumed;
       
   521             }
       
   522         else if ( ( iInternalState == EStartupShowingWelcomeAnimation ||
   329         else if ( ( iInternalState == EStartupShowingWelcomeAnimation ||
   523                     iInternalState == EStartupShowingOperatorAnimation ) &&
   330                     iInternalState == EStartupShowingOperatorAnimation ) &&
   524                    !( iAnimation->WasCancelled() ) )
   331                    !( iAnimation->WasCancelled() ) )
   525             {
   332             {
   526             TRACES("CStartupAppUi::HandleKeyEventL(): This key event is used to cancel animations");
   333             TRACES("CStartupAppUi::HandleKeyEventL(): This key event is used to cancel animations");
   532 
   339 
   533     TRACES1("CStartupAppUi::HandleKeyEventL(): End, return %d", response);
   340     TRACES1("CStartupAppUi::HandleKeyEventL(): End, return %d", response);
   534     return response;
   341     return response;
   535     }
   342     }
   536 
   343 
   537 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   344 /*
       
   345  * Qt Support Not available..
   538 // ---------------------------------------------------------------------------
   346 // ---------------------------------------------------------------------------
   539 // CStartupAppUi::HandleResourceChangeL
   347 // CStartupAppUi::HandleResourceChangeL
   540 //
   348 //
   541 // ---------------------------------------------------------------------------
   349 // ---------------------------------------------------------------------------
   542 //
   350 //
   543 void CStartupAppUi::HandleResourceChangeL( TInt aType )
   351 void CStartupAppUi::HandleResourceChangeL( TInt aType )
   544     {
   352     {
   545     TRACES("CStartupAppUi::HandleResourceChangeL()");
   353     TRACES("CStartupAppUi::HandleResourceChangeL()");
   546     TRACES1("CStartupAppUi::HandleResourceChangeL Type: %d", aType);
   354     TRACES1("CStartupAppUi::HandleResourceChangeL Type: %d", aType);
   547 
   355   
       
   356     
       
   357      * No equivalent in Qt. 
   548     CAknAppUi::HandleResourceChangeL( aType );
   358     CAknAppUi::HandleResourceChangeL( aType );
   549 
   359 
   550     if ( aType == KEikDynamicLayoutVariantSwitch )
   360     if ( aType == KEikDynamicLayoutVariantSwitch )
   551         {
   361         {
   552         iMainView->SetRect( ApplicationRect() );
   362         iMainView->SetRect( ApplicationRect() );
   553         }
   363         }
   554 
   364      
   555     TRACES("CStartupAppUi::HandleResourceChangeL(): End");
   365     TRACES("CStartupAppUi::HandleResourceChangeL(): End");
   556     }
   366     }
   557 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   367 
       
   368 */
   558 
   369 
   559 
   370 
   560 // ---------------------------------------------------------------------------
   371 // ---------------------------------------------------------------------------
   561 // CStartupAppUi::HandleCommandL(TInt aCommand)
   372 // CStartupAppUi::HandleCommandL(TInt aCommand)
   562 // ---------------------------------------------------------------------------
   373 // ---------------------------------------------------------------------------
   566     switch (aCommand)
   377     switch (aCommand)
   567         {
   378         {
   568         case EEikCmdExit:
   379         case EEikCmdExit:
   569             {
   380             {
   570             TRACES("CStartupAppUi::HandleCommandL(): EEikCmdExit");
   381             TRACES("CStartupAppUi::HandleCommandL(): EEikCmdExit");
   571             Exit();
   382 
       
   383 			Exit();
   572             }
   384             }
   573             break;
   385             break;
   574         default:
   386         default:
   575             break;
   387             break;
   576         }//End of switch-clause
   388         }//End of switch-clause
   581 // CStartupAppUi::DoStartupStartPartL()
   393 // CStartupAppUi::DoStartupStartPartL()
   582 // ---------------------------------------------------------------------------
   394 // ---------------------------------------------------------------------------
   583 void CStartupAppUi::DoStartupStartPartL()
   395 void CStartupAppUi::DoStartupStartPartL()
   584     {
   396     {
   585     TRACES("CStartupAppUi::DoStartupStartPartL()");
   397     TRACES("CStartupAppUi::DoStartupStartPartL()");
   586 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   398 
   587     TryPreLoadAnimation();
   399     TryPreLoadAnimation();
   588 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   400 
   589     DoNextStartupPhaseL( EStartupWaitingCriticalBlock );
   401     DoNextStartupPhaseL( EStartupWaitingCriticalBlock );
   590     TRACES("CStartupAppUi::DoStartupStartPartL(): End");
   402     TRACES("CStartupAppUi::DoStartupStartPartL(): End");
   591     }
   403     }
   592 
   404 
   593 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   594 // ---------------------------------------------------------------------------
   405 // ---------------------------------------------------------------------------
   595 // CStartupAppUi::TryPreLoadAnimation()
   406 // CStartupAppUi::TryPreLoadAnimation()
   596 // ---------------------------------------------------------------------------
   407 // ---------------------------------------------------------------------------
   597 void CStartupAppUi::TryPreLoadAnimation()
   408 void CStartupAppUi::TryPreLoadAnimation()
   598     {
   409     {
   619            mode == EStartupModeNormal ) || // Not going to charging or alarm mode
   430            mode == EStartupModeNormal ) || // Not going to charging or alarm mode
   620          state == ESwStateSecurityCheck ) )
   431          state == ESwStateSecurityCheck ) )
   621         {
   432         {
   622         iAnimation->PreLoad(
   433         iAnimation->PreLoad(
   623             ClientRect(),
   434             ClientRect(),
   624             *iMainView,
   435 			*iMainView,
   625             KStartupAnimationParams,
   436             KStartupAnimationParams,
   626             ETrue,
   437             ETrue,
   627             SecondaryDisplay::EStartWelcomeAnimation );
   438             SecondaryDisplay::EStartWelcomeAnimation );
   628         }
   439         }
   629 
   440 
   630     TRACES("CStartupAppUi::TryPreLoadAnimation(): End");
   441     TRACES("CStartupAppUi::TryPreLoadAnimation(): End");
   631     }
   442     }
   632 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   443 
   633 
   444 
   634 
   445 
   635 // ---------------------------------------------------------------------------
   446 // ---------------------------------------------------------------------------
   636 // CStartupAppUi::DoStartupShowWelcomeAnimationL()
   447 // CStartupAppUi::DoStartupShowWelcomeAnimationL()
   637 // ---------------------------------------------------------------------------
   448 // ---------------------------------------------------------------------------
   642         {
   453         {
   643         //skip the welcome animation and user welcome note and continue with
   454         //skip the welcome animation and user welcome note and continue with
   644         //the same way like in the end of ShowUserWelcomeNoteL()
   455         //the same way like in the end of ShowUserWelcomeNoteL()
   645         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Skip the animation and UWN because it's hidden reset");
   456         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Skip the animation and UWN because it's hidden reset");
   646         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck");
   457         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck");
   647 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   458 
   648         iWelcomeAnimation->RemoveSplashScreen();
       
   649 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   650         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
   459         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
   651 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   460 
   652         return;
   461         }
   653 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   462 
   654         }
       
   655 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   656     else
   463     else
   657         {
   464         {
   658         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Show animation");
   465         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Show animation");
   659 
   466 
   660         iAnimation->Play(
   467         iAnimation->Play(
   661             ClientRect(),
   468             ClientRect(),
   662             *iMainView,
   469 			*iMainView,
   663             KStartupAnimationParams,
   470             KStartupAnimationParams,
   664             ETrue,
   471             ETrue,
   665             SecondaryDisplay::EStartWelcomeAnimation,
   472             SecondaryDisplay::EStartWelcomeAnimation,
   666             TCallBack( AnimationFinishedFunc, this ) );
   473             TCallBack( AnimationFinishedFunc, this ) );
   667         }
   474         }
   668 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
   475 
   669 
       
   670     TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Play startup tone.");
       
   671 
       
   672     // Play startup tone
       
   673     if (iStartupTone->Play() != KErrNone)
       
   674         {
       
   675         // Play startup beep.
       
   676         TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): Play startup beep");
       
   677         static_cast<CAknAppUi*>(iEikonEnv->
       
   678                                 EikAppUi())->
       
   679                                 KeySounds()->
       
   680                                 PlaySound( EAvkonSIDPowerOnTone );
       
   681         }
       
   682     iWelcomeAnimation->SetAnimationShowing(ETrue);
       
   683     ShowWelcomeAnimationL();
       
   684 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   685 
   476 
   686     TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): End");
   477     TRACES("CStartupAppUi::DoStartupShowWelcomeAnimationL(): End");
   687     }
   478     }
   688 
   479 
   689 // ---------------------------------------------------------------------------
   480 // ---------------------------------------------------------------------------
   697         //skip the operator animation and user welcome note and continue with
   488         //skip the operator animation and user welcome note and continue with
   698         //the same way like in the end of ShowUserWelcomeNoteL()
   489         //the same way like in the end of ShowUserWelcomeNoteL()
   699         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Skip the animation and UWN because it's hidden reset");
   490         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Skip the animation and UWN because it's hidden reset");
   700         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck");
   491         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): and change internal state directly to EStartupFirstBootAndRTCCheck");
   701         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
   492         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
   702 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   493 
   703         return;
   494         }
   704 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   495 
   705         }
       
   706 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   707     else
   496     else
   708         {
   497         {
   709         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Show animation");
   498         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Show animation");
   710 
   499 
   711         CSAnimStartupCtrl::TAnimationParams params;
   500         CSAnimStartupCtrl::TAnimationParams params;
   715         params.iEnableScalingKey = KStartupOperatorAnimationScaling;
   504         params.iEnableScalingKey = KStartupOperatorAnimationScaling;
   716         params.iTonePathKey = KStartupOperatorTonePath;
   505         params.iTonePathKey = KStartupOperatorTonePath;
   717         params.iVolumeKey = KStartupOperatorToneVolume;
   506         params.iVolumeKey = KStartupOperatorToneVolume;
   718         iAnimation->Play(
   507         iAnimation->Play(
   719             ClientRect(),
   508             ClientRect(),
       
   509 	
   720             *iMainView,
   510             *iMainView,
   721             params,
   511             params,
   722             EFalse,
   512             EFalse,
   723             SecondaryDisplay::EStartOperatorAnimation,
   513             SecondaryDisplay::EStartOperatorAnimation,
   724             TCallBack( AnimationFinishedFunc, this ) );
   514             TCallBack( AnimationFinishedFunc, this ) );
   725         }
   515         }
   726 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
   516 
   727     if ( iOperatorAnimation->ShowingTime() )
       
   728         {
       
   729         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Operator animation time defined properly");
       
   730         iOperatorAnimation->SetAnimationShowing(ETrue);
       
   731         iOpStartupTone->Play();
       
   732         ShowOperatorAnimationL();
       
   733         }
       
   734     else
       
   735         {
       
   736         TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): Operator animation not defined. Skip it.");
       
   737         iOperatorAnimation->SetAnimationShowing(EFalse);
       
   738         DoNextStartupPhaseL( EStartupShowingUserWelcomeNote );
       
   739         }
       
   740 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   741 
   517 
   742     TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): End");
   518     TRACES("CStartupAppUi::DoStartupShowOperatorAnimationL(): End");
   743     }
   519     }
   744 
   520 
   745 // ---------------------------------------------------------------------------
   521 
   746 // CStartupAppUi::DoStartupShowUserWelcomeNoteL()
   522 // ---------------------------------------------------------------------------
   747 // ---------------------------------------------------------------------------
   523 // CStartupAppUi::PredictiveTimeEnabled()
   748 void CStartupAppUi::DoStartupShowUserWelcomeNoteL()
   524 // ---------------------------------------------------------------------------
   749     {
   525 TBool CStartupAppUi::PredictiveTimeEnabled()
   750     TRACES("CStartupAppUi::DoStartupShowUserWelcomeNoteL()");
   526     {
   751     ShowUserWelcomeNoteL();
   527     TRACES("CStartupAppUi::PredictiveTimeEnabled()");
   752     TRACES("CStartupAppUi::DoStartupShowUserWelcomeNoteL(): End");
   528 
   753     }
   529     TInt value( EPredictiveTimeEnabled );
   754 
       
   755 // ---------------------------------------------------------------------------
       
   756 // CStartupAppUi::StartupQueriesEnabled()
       
   757 // ---------------------------------------------------------------------------
       
   758 TBool CStartupAppUi::StartupQueriesEnabled()
       
   759     {
       
   760     TRACES("CStartupAppUi::StartupQueriesEnabled()");
       
   761 
       
   762     TInt value( EStartupQueriesEnabled );
       
   763     CRepository* repository(NULL);
   530     CRepository* repository(NULL);
   764 
   531 
   765     TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) );
   532     TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) );
   766     if ( err == KErrNone )
   533     if ( err == KErrNone )
   767         {
   534         {
   768         err = repository->Get( KStartupQueries, value );
       
   769         }
       
   770     delete repository;
       
   771 
       
   772     TRACES1("CStartupAppUi::StartupQueriesEnabled(): returns %d", value);
       
   773     return value;
       
   774     }
       
   775 
       
   776 // ---------------------------------------------------------------------------
       
   777 // CStartupAppUi::PredictiveTimeEnabled()
       
   778 // ---------------------------------------------------------------------------
       
   779 TBool CStartupAppUi::PredictiveTimeEnabled()
       
   780     {
       
   781     TRACES("CStartupAppUi::PredictiveTimeEnabled()");
       
   782 
       
   783     TInt value( EPredictiveTimeEnabled );
       
   784     CRepository* repository(NULL);
       
   785 
       
   786     TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) );
       
   787     if ( err == KErrNone )
       
   788         {
       
   789         err = repository->Get( KPredictiveTimeAndCountrySelection, value );
   535         err = repository->Get( KPredictiveTimeAndCountrySelection, value );
   790         }
   536         }
   791     delete repository;
   537     delete repository;
   792 
   538 
   793     TRACES1("CStartupAppUi::PredictiveTimeEnabled(): returns %d", value);
   539     TRACES1("CStartupAppUi::PredictiveTimeEnabled(): returns %d", value);
   799 // ---------------------------------------------------------------------------
   545 // ---------------------------------------------------------------------------
   800 void CStartupAppUi::DoStartupFirstBootAndRTCCheckL()
   546 void CStartupAppUi::DoStartupFirstBootAndRTCCheckL()
   801     {
   547     {
   802     TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL()");
   548     TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL()");
   803 
   549 
   804 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   550 
   805     RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot );
   551     RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot );
   806     RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown );
   552     RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown );
   807 
   553 
   808     delete iUserWelcomeNote;
       
   809     iUserWelcomeNote = NULL;
       
   810     iMainView->DrawDeferred();
   554     iMainView->DrawDeferred();
   811 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   555 
   812 
   556 
   813     // When Predictive Time and Country Selection is enabled, no queries are
   557     // When Predictive Time and Country Selection is enabled, no queries are
   814     // shown to user during first boot. Instead, Clock application gets the
   558     // shown to user during first boot. Instead, Clock application gets the
   815     // time and location from the network and marks the first boot as done.
   559     // time and location from the network and marks the first boot as done.
   816     if( !PredictiveTimeEnabled() )
   560     if( !PredictiveTimeEnabled() )
   817         {
   561         {
   818         if( iFirstBoot && !HiddenReset() && StartupQueriesEnabled() )
   562         if( iFirstBoot && !HiddenReset() ) //&& StartupQueriesEnabled() )
   819             {
   563             {
   820             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot. Show city, time and date queries.");
   564             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot. Show city, time and date queries.");
   821     
   565 		    TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot");
   822     
       
   823 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   824             iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries );
       
   825             iWelcomeAnimation->DrawNow();
       
   826     
       
   827             if (iOperatorAnimation)
       
   828                 {
       
   829                 RemoveFromStack( iOperatorAnimation );
       
   830                 delete iOperatorAnimation;
       
   831                 iOperatorAnimation = NULL;
       
   832                 }
       
   833             if (iUserWelcomeNote)
       
   834                 {
       
   835                 RemoveFromStack( iUserWelcomeNote );
       
   836                 delete iUserWelcomeNote;
       
   837                 iUserWelcomeNote = NULL;
       
   838                 }
       
   839 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   840             
       
   841             ShowStartupQueriesL();
       
   842             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot");
       
   843             MarkFirstBoot();    
   566             MarkFirstBoot();    
   844                 
   567                 
   845             }
   568             }
   846         else if( !RTCStatus() && !HiddenReset() && StartupQueriesEnabled())
   569 		else if( !RTCStatus() && !HiddenReset() ) // && StartupQueriesEnabled())
   847             {
   570             {
   848             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): No first boot but RTCStatus is corrupted. Ask time and date");
   571             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): No first boot but RTCStatus is corrupted. Ask time and date");
   849     #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   572 		     }
   850             iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries );
   573 		if( iFirstBoot )  // && !StartupQueriesEnabled() )
   851             if (iUserWelcomeNote)
       
   852                 {
       
   853                 RemoveFromStack( iUserWelcomeNote );
       
   854                 delete iUserWelcomeNote;
       
   855                 iUserWelcomeNote = NULL;
       
   856                 }
       
   857     #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   858     
       
   859             ShowStartupQueriesL(); // Not first boot, so skips Country/City query
       
   860             }
       
   861         if( iFirstBoot && !StartupQueriesEnabled() )
       
   862             {
   574             {
   863             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot ongoing and queries are disabled.");
   575             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot ongoing and queries are disabled.");
   864             MarkFirstBoot();
   576             MarkFirstBoot();
   865             }
   577             }
   866         }
   578         }
   873             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot");
   585             TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot");
   874             MarkFirstBoot();
   586             MarkFirstBoot();
   875 			}
   587 			}
   876 		// End of temporary fix.
   588 		// End of temporary fix.
   877 		}
   589 		}
       
   590 
   878     TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Setting KPSStartupAppState = EStartupAppStateFinished");
   591     TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Setting KPSStartupAppState = EStartupAppStateFinished");
   879     TInt err = RProperty::Set( KPSUidStartupApp, KPSStartupAppState, EStartupAppStateFinished );
   592     TInt err = RProperty::Set( KPSUidStartupApp, KPSStartupAppState, EStartupAppStateFinished );
   880     if( KErrNone != err )
   593     if( KErrNone != err )
   881         {
   594         {
   882         TRACES1("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): KPSStartupAppState set err %d"
   595         TRACES1("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): KPSStartupAppState set err %d"
   883                 , err);
   596                 , err);
   884         }
   597         }
   885 
   598 
   886     DoNextStartupPhaseL( EStartupWaitingCUIStartupReady );
   599     DoNextStartupPhaseL( EStartupStartupOK );
   887     }
   600     }
   888 
   601 
   889 // ---------------------------------------------------------------------------
   602 
   890 // CStartupAppUi::ShowStartupQueriesL()
   603 
   891 // ---------------------------------------------------------------------------
       
   892 void CStartupAppUi::ShowStartupQueriesL()
       
   893     {
       
   894     TRACES("CStartupAppUi::ShowStartupQueriesL()");
       
   895 
       
   896     TBool citysaved(EFalse);
       
   897     TBool timesaved(EFalse);
       
   898     TBool datesaved(EFalse);
       
   899 
       
   900     // Get default time ( to be used only in date query )
       
   901     GetDefaultTimeAndDate( iTime );
       
   902 
       
   903     // Show Country, Date and Time queries ( with possibility to go back ).
       
   904     // Country query is shown only in the first boot.
       
   905 
       
   906     while (!timesaved)
       
   907         {
       
   908         while (!datesaved)
       
   909             {
       
   910             while (!citysaved && iFirstBoot)
       
   911                 {
       
   912                 // 1. Select time zone
       
   913                 ShowCountryAndCityListsL();
       
   914                 citysaved = ETrue;
       
   915                 TRACES1("CStartupAppUi::ShowStartupQueriesL(): citysaved = %d", citysaved );
       
   916                 }
       
   917             // 2. Set date
       
   918             datesaved = ShowDateQueryL();
       
   919             TRACES1("CStartupAppUi::ShowStartupQueriesL(): datesaved = %d", datesaved );
       
   920             if (!datesaved)
       
   921                 {
       
   922                 citysaved = EFalse;
       
   923                 }
       
   924             }
       
   925         // 3. Set time
       
   926         timesaved = ShowTimeQueryL();
       
   927         TRACES1("CStartupAppUi::ShowStartupQueriesL(): timesaved = %d", timesaved );
       
   928         if (!timesaved)
       
   929             {
       
   930             datesaved = EFalse;
       
   931             }
       
   932         }
       
   933 
       
   934     // All the queries completed.
       
   935 
       
   936     TRACES("CStartupAppUi::ShowStartupQueriesL() - END");
       
   937     }
       
   938 
   604 
   939 // ---------------------------------------------------------------------------
   605 // ---------------------------------------------------------------------------
   940 // CStartupAppUi::DoStartupEndPart()
   606 // CStartupAppUi::DoStartupEndPart()
   941 // ---------------------------------------------------------------------------
   607 // ---------------------------------------------------------------------------
   942 void CStartupAppUi::DoStartupEndPart()
   608 void CStartupAppUi::DoStartupEndPart()
   943     {
   609     {
   944     TRACES("CStartupAppUi::DoStartupEndPart()");
   610     TRACES("CStartupAppUi::DoStartupEndPart()");
   945     TRACES("CStartupAppUi::DoStartupEndPart(): STARTUP OK");
   611     TRACES("CStartupAppUi::DoStartupEndPart(): STARTUP OK");
   946 
   612 
   947 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
   613 
   948     RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot );
   614 
   949 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   615   
   950 
       
   951 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION    
       
   952     UpdateStartupUiPhase( EStartupUiPhaseAllDone );
   616     UpdateStartupUiPhase( EStartupUiPhaseAllDone );
   953 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   617 
   954 
   618 
   955     TRACES("CStartupAppUi::DoStartupEndPart(): Exit application.");
   619     TRACES("CStartupAppUi::DoStartupEndPart(): Exit application.");
   956     iExitTimer->Start( 100000, 100000, TCallBack( DoExitApplication, this ) );
   620     iExitTimer->Start( 100000, 100000, TCallBack( DoExitApplication, this ) );
   957     TRACES("CStartupAppUi::DoStartupEndPart(): DoExitApplication-timer called.");
   621     TRACES("CStartupAppUi::DoStartupEndPart(): DoExitApplication-timer called.");
   958     TRACES("CStartupAppUi::DoStartupEndPart(): End");
   622     TRACES("CStartupAppUi::DoStartupEndPart(): End");
   959     }
   623     }
   960 
       
   961 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   962 // ---------------------------------------------------------------------------
       
   963 // CStartupAppUi::ContinueStartupAfterToneL()
       
   964 // ---------------------------------------------------------------------------
       
   965 void CStartupAppUi::ContinueStartupAfterToneL(TToneType aToneType)
       
   966     {
       
   967     TRACES("CStartupAppUi::ContinueStartupAfterToneL()");
       
   968 
       
   969     if (aToneType == EStartupTone)
       
   970         {
       
   971         TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupTone");
       
   972         DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim );
       
   973         }
       
   974     else if (aToneType == EStartupOpTone)
       
   975         {
       
   976         TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupOpTone");
       
   977         DoNextStartupPhaseL( EStartupShowingUserWelcomeNote );
       
   978         }
       
   979     else
       
   980         {
       
   981         TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone interrupted");
       
   982         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
   983         }
       
   984     TRACES("CStartupAppUi::ContinueStartupAfterToneL(): End");
       
   985     }
       
   986 
       
   987 // ---------------------------------------------------------------------------
       
   988 // CStartupAppUi::BringToForeground()
       
   989 // ---------------------------------------------------------------------------
       
   990 void CStartupAppUi::BringToForeground()
       
   991     {
       
   992     TRACES("CStartupAppUi::BringToForeground()");
       
   993     if ((iInternalState != EStartupWaitingTouchScreenCalib) ||
       
   994         (iTouchScreenCalibrationDone))
       
   995         {
       
   996         TRACES("CStartupAppUi::BringToForeground(): Bring to foreground");
       
   997         TApaTask self(iCoeEnv->WsSession());
       
   998         self.SetWgId(iCoeEnv->RootWin().Identifier());
       
   999         self.BringToForeground();
       
  1000         }
       
  1001     TRACES("CStartupAppUi::BringToForeground(): End");
       
  1002     }
       
  1003 
       
  1004 // ---------------------------------------------------------------------------
       
  1005 // CStartupAppUi::SendToBackground()
       
  1006 // ---------------------------------------------------------------------------
       
  1007 void CStartupAppUi::SendToBackground()
       
  1008     {
       
  1009     TRACES("CStartupAppUi::SendToBackground()");
       
  1010     TApaTask self(iCoeEnv->WsSession());
       
  1011     self.SetWgId(iCoeEnv->RootWin().Identifier());
       
  1012     self.SendToBackground();
       
  1013     TRACES("CStartupAppUi::SendToBackground(): End");
       
  1014     }
       
  1015 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1016 
   624 
  1017 // ---------------------------------------------------------------------------
   625 // ---------------------------------------------------------------------------
  1018 // CStartupAppUi::StopTimingL()
   626 // CStartupAppUi::StopTimingL()
  1019 // ---------------------------------------------------------------------------
   627 // ---------------------------------------------------------------------------
  1020 void CStartupAppUi::StopTimingL()
   628 void CStartupAppUi::StopTimingL()
  1027             //telling that timer has expired in appui so that
   635             //telling that timer has expired in appui so that
  1028             //key pressed are not handled any more...
   636             //key pressed are not handled any more...
  1029             TRACES("CStartupAppUi::StopTimingL(): Stopping UWN");
   637             TRACES("CStartupAppUi::StopTimingL(): Stopping UWN");
  1030             iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue;
   638             iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue;
  1031             iNoteTimer->Cancel();
   639             iNoteTimer->Cancel();
  1032 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   640 
  1033             UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone );
   641             UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone );
  1034             DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
   642             DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
  1035 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
   643 
  1036        iUserWelcomeNote->CancelNoteCancelTimer();
       
  1037             iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeNoteEnd );
       
  1038             iWelcomeAnimation->DrawNow();
       
  1039             iUserWelcomeNote->SetUserWelcomeNoteShowing(EFalse);
       
  1040             TRACES("CStartupAppUi::StopTimingL(): UWN stopped");
       
  1041 
       
  1042             if (iStartupTone->Playing())
       
  1043                 {
       
  1044                 TRACES("CStartupAppUi::StopTimingL(): Startup tone playing. Cannot continue to next phase");
       
  1045                 iStartupTone->StartupWaiting(ETrue);
       
  1046                 }
       
  1047             else
       
  1048                 {
       
  1049                 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
  1050                 }
       
  1051             }
       
  1052         else if (iInternalState == EStartupShowingOperatorAnimation)  // EStartupShowingOperatorAnimation
       
  1053             {
       
  1054             TRACES("CStartupAppUi::StopTimingL(): Stopping animation");
       
  1055             iAnimTimer->Cancel();
       
  1056             iWelcomeAnimation->CancelAnimCancelTimer();
       
  1057             iOperatorAnimation->UpdateDrawInfo( EStartupDIOperatorAnimEnd );
       
  1058             iOperatorAnimation->SetAnimationShowing(EFalse);
       
  1059             TRACES("CStartupAppUi::StopTimingL(): operator animation showing stopped");
       
  1060             if ( iOperatorAnimation->IsAnimationCancelled())
       
  1061                 {
       
  1062                 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore UWN is not shown");
       
  1063                 StopOperatorTone();
       
  1064                 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue;
       
  1065                 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
  1066                 }
       
  1067             else
       
  1068                 {
       
  1069                 // If tone is still playing wait until it completes.
       
  1070                 if (iOpStartupTone->Playing())
       
  1071                     {
       
  1072                     TRACES("CStartupAppUi::StopTimingL(): Operator startup tone is still playing. Wait until it completes.");
       
  1073                     iOpStartupTone->StartupWaiting(ETrue);
       
  1074                     }
       
  1075                 else
       
  1076                     {
       
  1077                     TRACES("CStartupAppUi::StopTimingL(): Lets display UWN");
       
  1078                     DoNextStartupPhaseL( EStartupShowingUserWelcomeNote );
       
  1079                     }
       
  1080                 }
       
  1081             TRACES("CStartupAppUi::StopTimingL(): Operator Animation stopped");
       
  1082             }
       
  1083         else // EStartupShowingWelcomeAnimation
       
  1084             {
       
  1085             TRACES("CStartupAppUi::StopTimingL(): Stopping animation");
       
  1086             iAnimTimer->Cancel();
       
  1087             iWelcomeAnimation->CancelAnimCancelTimer();
       
  1088             iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimEnd );
       
  1089             iWelcomeAnimation->SetAnimationShowing(EFalse);
       
  1090             TRACES("CStartupAppUi::StopTimingL(): Welcome animation showing stopped");
       
  1091 
       
  1092             if ( iWelcomeAnimation->IsAnimationCancelled())
       
  1093                 {
       
  1094                 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore operator animation and UWN is not shown");
       
  1095                 StopStartupTone();
       
  1096                 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue;
       
  1097                 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
  1098                 }
       
  1099             else
       
  1100                 {
       
  1101                 if (iStartupTone->Playing())
       
  1102                     {
       
  1103                     // If tone is still playing wait until it completes.
       
  1104                     iStartupTone->StartupWaiting(ETrue);
       
  1105                     }
       
  1106                 else
       
  1107                     {
       
  1108                     DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim );
       
  1109                     }
       
  1110                 }
       
  1111             TRACES("CStartupAppUi::StopTimingL(): Animation stopped");
       
  1112 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1113             }
   644             }
  1114         }
   645         }
  1115 
   646 
  1116     TRACES("CStartupAppUi::StopTimingL(): End");
   647     TRACES("CStartupAppUi::StopTimingL(): End");
  1117     }
   648     }
  1125     iExitTimer->Cancel();
   656     iExitTimer->Cancel();
  1126     Exit();
   657     Exit();
  1127     TRACES("CStartupAppUi::ExitApplication(): End");
   658     TRACES("CStartupAppUi::ExitApplication(): End");
  1128     }
   659     }
  1129 
   660 
  1130 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1131 // ---------------------------------------------------------------------------
       
  1132 // CStartupAppUi::ShowWelcomeAnimationL()
       
  1133 // ---------------------------------------------------------------------------
       
  1134 void CStartupAppUi::ShowWelcomeAnimationL()
       
  1135     {
       
  1136     TRACES("CStartupAppUi::ShowWelcomeAnimationL()");
       
  1137     __ASSERT_DEBUG( iWelcomeAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) );
       
  1138     TInt showtime = iWelcomeAnimation->ShowingTime();
       
  1139     iAnimation = ETrue;
       
  1140     TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Animation timer started");
       
  1141     iAnimTimer->Start(
       
  1142             showtime*KOneMilliSecondInMicroSeconds,
       
  1143             showtime*KOneMilliSecondInMicroSeconds,
       
  1144             TCallBack( DoStopTimingL, this ) );
       
  1145     iWelcomeAnimation->StartL();
       
  1146     TRACES("CStartupAppUi::ShowWelcomeAnimationL(): End");
       
  1147     }
       
  1148 
       
  1149 // ---------------------------------------------------------------------------
       
  1150 // CStartupAppUi::ShowOperatorAnimationL()
       
  1151 // ---------------------------------------------------------------------------
       
  1152 void CStartupAppUi::ShowOperatorAnimationL()
       
  1153     {
       
  1154     TRACES("CStartupAppUi::ShowOperatorAnimationL()");
       
  1155     __ASSERT_DEBUG( iOperatorAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) );
       
  1156     TInt showtime = iOperatorAnimation->ShowingTime();
       
  1157     iAnimation = ETrue;
       
  1158     TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Operator Animation timer started");
       
  1159     iAnimTimer->Start(
       
  1160         showtime*KOneMilliSecondInMicroSeconds,
       
  1161         showtime*KOneMilliSecondInMicroSeconds,
       
  1162         TCallBack( DoStopTimingL, this ) );
       
  1163     iOperatorAnimation->StartL();
       
  1164     TRACES("CStartupAppUi::ShowOperatorAnimationL(): End");
       
  1165     }
       
  1166 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1167 
       
  1168 // ---------------------------------------------------------------------------
       
  1169 // CStartupAppUi::ShowUserWelcomeNoteL()
       
  1170 // ---------------------------------------------------------------------------
       
  1171 void CStartupAppUi::ShowUserWelcomeNoteL()
       
  1172     {
       
  1173     TRACES("CStartupAppUi::ShowUserWelcomeNoteL()");
       
  1174 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1175     iUserWelcomeNote = CStartupUserWelcomeNote::NewL( *this, ClientRect(), *iMainView );
       
  1176     TStartupNoteTypeInformation type = iUserWelcomeNote->NoteTypeInformation();
       
  1177 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1178     __ASSERT_DEBUG( iUserWelcomeNote , PANIC( EStartupPanicClassMemberVariableIsNull ) );
       
  1179     TStartupNoteTypeInformation type;
       
  1180     type = iUserWelcomeNote->NoteTypeInformation();
       
  1181 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1182     if( type == EStartupImage )
       
  1183         {
       
  1184         // UserWelcomeNote type is EStartupImage
       
  1185         // This type of note is shown fixed (KUserWelcomeNoteShowPeriodTime) time
       
  1186         TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): UWNTimer started (graphic)");
       
  1187 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1188         iAnimation = EFalse;
       
  1189 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1190         iNoteTimer->Start(
       
  1191             KUserWelcomeNoteShowPeriodTime,
       
  1192             KUserWelcomeNoteShowPeriodTime,
       
  1193             TCallBack( DoStopTimingL, this ) );
       
  1194 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1195         iUserWelcomeNote->StartL();
       
  1196 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1197         }
       
  1198 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1199     else if ( type == EStartupText )
       
  1200         {
       
  1201         TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): Text UWN");
       
  1202 
       
  1203         iUserWelcomeNote->StartL();
       
  1204         
       
  1205         UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone );
       
  1206                 
       
  1207         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
  1208         }
       
  1209     else
       
  1210         {
       
  1211         TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN");
       
  1212 
       
  1213         DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck );
       
  1214 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1215     else
       
  1216         {
       
  1217         //if User Welcome Note type is ETextWelcomeNote nothing to do here,
       
  1218         //because it is implemented with Avkon globalnote
       
  1219         //or if type is EDefaultWelcomeNote no User Welcome Note is shown.
       
  1220         TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN to show or UWN is text");
       
  1221         }
       
  1222     //invoke welcome note container to show note
       
  1223     iUserWelcomeNote->StartL();
       
  1224 
       
  1225     if( type == EStartupText || type == EStartupNoNote)
       
  1226         {
       
  1227         //this is called already here because timer not activated in text uwn case
       
  1228         //and so DoStopTimingL() is never called and should be called here.
       
  1229         StopTimingL();
       
  1230 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1231         }
       
  1232 
       
  1233     TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): End");
       
  1234     }
       
  1235 
       
  1236 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1237 // ---------------------------------------------------------------------------
       
  1238 // CStartupAppUi::WaitingTouchScreenCalibL()
       
  1239 // ---------------------------------------------------------------------------
       
  1240 void CStartupAppUi::WaitingTouchScreenCalibL()
       
  1241     {
       
  1242     TRACES("CStartupAppUi::WaitingTouchScreenCalibL()");
       
  1243 #ifdef RD_SCALABLE_UI_V2
       
  1244 
       
  1245     if( iFirstBoot && iTouchScreenCalibSupport )
       
  1246         {
       
  1247         if (iTouchScreenCalibrationDone)
       
  1248             {
       
  1249             TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration already done. Continue boot up");
       
  1250             DoNextStartupPhaseL( EStartupOfflineModeQuery );
       
  1251             }
       
  1252         else
       
  1253             {
       
  1254             SendToBackground();
       
  1255 
       
  1256             iWelcomeAnimation->UpdateDrawInfo( EStartupDITouchScreenCalib );
       
  1257             iWelcomeAnimation->DrawNow();
       
  1258             TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Startup sequence halted until Touch Screen Calibration is done");
       
  1259             }
       
  1260         }
       
  1261     else
       
  1262         {
       
  1263         TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Not first boot or calibration not supported. Continue boot up");
       
  1264         DoNextStartupPhaseL( EStartupOfflineModeQuery );
       
  1265         }
       
  1266 
       
  1267 #else // !RD_SCALABLE_UI_V2
       
  1268     TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration not supported. Continue boot up");
       
  1269     DoNextStartupPhaseL( EStartupOfflineModeQuery );
       
  1270 
       
  1271 #endif // RD_SCALABLE_UI_V2
       
  1272     TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): End");
       
  1273     }
       
  1274 
       
  1275 #ifdef RD_SCALABLE_UI_V2
       
  1276 // ---------------------------------------------------------------------------
       
  1277 // CStartupAppUi::TouchScreenCalibrationDoneL()
       
  1278 // ---------------------------------------------------------------------------
       
  1279 void CStartupAppUi::TouchScreenCalibrationDoneL()
       
  1280     {
       
  1281     TRACES("CStartupAppUi::TouchScreenCalibrationDoneL()");
       
  1282     if (iInternalState == EStartupWaitingTouchScreenCalib)
       
  1283         {
       
  1284         iTouchScreenCalibrationDone = ETrue;
       
  1285         BringToForeground();
       
  1286         DoNextStartupPhaseL( EStartupOfflineModeQuery );
       
  1287         }
       
  1288     else
       
  1289         {
       
  1290         iTouchScreenCalibrationDone = ETrue;
       
  1291         }
       
  1292     TRACES("CStartupAppUi::TouchScreenCalibrationDoneL(): End");
       
  1293     }
       
  1294 #endif // RD_SCALABLE_UI_V2
       
  1295 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1296 
       
  1297 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1298 // ---------------------------------------------------------------------------
       
  1299 // CStartupAppUi::CoverUIWelcomeAnimationSyncOKL()
       
  1300 // ---------------------------------------------------------------------------
       
  1301 void CStartupAppUi::CoverUIWelcomeAnimationSyncOKL()
       
  1302     {
       
  1303     TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL()");
       
  1304     DoNextStartupPhaseL( EStartupWaitingStartupTone );
       
  1305     TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL(): End");
       
  1306     }
       
  1307 
       
  1308 // ---------------------------------------------------------------------------
       
  1309 // CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL()
       
  1310 // ---------------------------------------------------------------------------
       
  1311 void CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL()
       
  1312     {
       
  1313     TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL()");
       
  1314     if (iCoverUISupported)
       
  1315         {
       
  1316         iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync,
       
  1317                                                SecondaryDisplay::EStartWelcomeAnimation);
       
  1318         }
       
  1319     else
       
  1320         {
       
  1321         DoNextStartupPhaseL( EStartupWaitingStartupTone );
       
  1322         }
       
  1323     TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL(): End");
       
  1324     }
       
  1325 
       
  1326 // ---------------------------------------------------------------------------
       
  1327 // CStartupAppUi::CoverUIOperatorAnimationSyncOKL()
       
  1328 // ---------------------------------------------------------------------------
       
  1329 void CStartupAppUi::CoverUIOperatorAnimationSyncOKL()
       
  1330     {
       
  1331     TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL()");
       
  1332     DoNextStartupPhaseL( EStartupShowingOperatorAnimation );
       
  1333     TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL(): End");
       
  1334     }
       
  1335 
       
  1336 // ---------------------------------------------------------------------------
       
  1337 // CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL()
       
  1338 // ---------------------------------------------------------------------------
       
  1339 void CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL()
       
  1340     {
       
  1341     TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL()");
       
  1342     if (iCoverUISupported)
       
  1343         {
       
  1344         if (iOperatorAnimation->ShowingTime())
       
  1345             {
       
  1346             iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync,
       
  1347                                                    SecondaryDisplay::EStartOperatorAnimation );
       
  1348             }
       
  1349         else
       
  1350             {
       
  1351             DoNextStartupPhaseL( EStartupShowingOperatorAnimation );
       
  1352             }
       
  1353         }
       
  1354     else
       
  1355         {
       
  1356         DoNextStartupPhaseL( EStartupShowingOperatorAnimation );
       
  1357         }
       
  1358     TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL(): End");
       
  1359     }
       
  1360 
       
  1361 // ---------------------------------------------------------------------------
       
  1362 // CStartupAppUi::WaitingStartupToneL()
       
  1363 // ---------------------------------------------------------------------------
       
  1364 void CStartupAppUi::WaitingStartupToneL()
       
  1365     {
       
  1366     if( iStartupTone->ToneFound() && !iStartupTone->AudioReady() )
       
  1367         {
       
  1368         TRACES("CStartupAppUi::WaitingStartupToneL(): Startup tone found but not ready. Waiting tone to init");
       
  1369         iToneInitTimer = CPeriodic::NewL( EPriorityNormal );
       
  1370         iToneInitTimer->Start( KOneMilliSecondInMicroSeconds,
       
  1371                                KOneMilliSecondInMicroSeconds,
       
  1372                                TCallBack( ToneInitTimerTimeoutL, this ) );
       
  1373         }
       
  1374     else
       
  1375         {
       
  1376         TRACES("CStartupAppUi::WaitingStartupToneL(): Audio ready");
       
  1377         DoNextStartupPhaseL( EStartupShowingWelcomeAnimation );
       
  1378         }
       
  1379     }
       
  1380 
       
  1381 // ---------------------------------------------------------------------------
       
  1382 // CStartupAppUi::ToneInitTimerTimeoutL()
       
  1383 // ---------------------------------------------------------------------------
       
  1384 TInt CStartupAppUi::ToneInitTimerTimeoutL(TAny* aObject)
       
  1385     {
       
  1386     STATIC_CAST( CStartupAppUi*, aObject )->StartupToneWaitStatusL(); // cast, and call non-static function
       
  1387     return KErrNone;
       
  1388     }
       
  1389 
       
  1390 // ---------------------------------------------------------------------------
       
  1391 // CStartupAppUi::StartupToneWaitStatusL()
       
  1392 // ---------------------------------------------------------------------------
       
  1393 void CStartupAppUi::StartupToneWaitStatusL()
       
  1394     {
       
  1395     iToneInitWaitTime++;
       
  1396     TRACES1("CStartupAppUi::StartupToneWaitStatusL(): Total tone init wait time = %d ms", iToneInitWaitTime );
       
  1397     TBool audioReady = iStartupTone->AudioReady();
       
  1398     if ( audioReady || (iToneInitWaitTime>=KMaxToneInitWait) )
       
  1399         {
       
  1400         iToneInitTimer->Cancel();
       
  1401         delete iToneInitTimer;
       
  1402         iToneInitTimer = NULL;
       
  1403 
       
  1404         TRACES1("CStartupAppUi::StartupToneWaitStatusL(): AudioReady: %d, proceed", audioReady );
       
  1405         DoNextStartupPhaseL( EStartupShowingWelcomeAnimation );
       
  1406         }
       
  1407     }
       
  1408 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1409 
       
  1410 // ---------------------------------------------------------------------------
       
  1411 // CStartupAppUi::CoverUIStartupReadySyncOKL()
       
  1412 // ---------------------------------------------------------------------------
       
  1413 void CStartupAppUi::CoverUIStartupReadySyncOKL()
       
  1414     {
       
  1415     TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL()");
       
  1416     DoNextStartupPhaseL( EStartupStartupOK );
       
  1417     TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL(): End");
       
  1418     }
       
  1419 
       
  1420 // ---------------------------------------------------------------------------
       
  1421 // CStartupAppUi::WaitingCoverUIStartupReadySyncL()
       
  1422 // ---------------------------------------------------------------------------
       
  1423 void CStartupAppUi::WaitingCoverUIStartupReadySyncL()
       
  1424     {
       
  1425     TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL()");
       
  1426     if (iCoverUISupported)
       
  1427         {
       
  1428         iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync,
       
  1429                                                SecondaryDisplay::EStartStartupReady);
       
  1430         }
       
  1431     else
       
  1432         {
       
  1433         DoNextStartupPhaseL( EStartupStartupOK );
       
  1434         }
       
  1435     TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL(): End");
       
  1436     }
       
  1437 
       
  1438 // ---------------------------------------------------------------------------
       
  1439 // CStartupAppUi::RaiseCoverUIEvent()
       
  1440 // ---------------------------------------------------------------------------
       
  1441 void CStartupAppUi::RaiseCoverUIEvent( TUid aCategory,
       
  1442                                        TInt aEventId,
       
  1443                                        const TDesC8& aData )
       
  1444     {
       
  1445     TRACES("CStartupAppUi::RaiseCoverUIEvent()");
       
  1446     if (iCoverUISupported)
       
  1447         {
       
  1448         iStartupMediatorObserver->RaiseEvent( aCategory,
       
  1449                                               aEventId,
       
  1450                                               aData );
       
  1451         }
       
  1452     TRACES("CStartupAppUi::RaiseCoverUIEvent(): End");
       
  1453     }
       
  1454 
       
  1455 // ---------------------------------------------------------------------------
   661 // ---------------------------------------------------------------------------
  1456 // CStartupAppUi::SetCriticalBlockEndedL()
   662 // CStartupAppUi::SetCriticalBlockEndedL()
  1457 // ---------------------------------------------------------------------------
   663 // ---------------------------------------------------------------------------
  1458 void CStartupAppUi::SetCriticalBlockEndedL()
   664 void CStartupAppUi::SetCriticalBlockEndedL()
  1459     {
   665     {
  1474     TRACES("CStartupAppUi::WaitingCriticalBlockEndingL()");
   680     TRACES("CStartupAppUi::WaitingCriticalBlockEndingL()");
  1475 
   681 
  1476     if( iCriticalBlockEnded )
   682     if( iCriticalBlockEnded )
  1477         {
   683         {
  1478         TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): CriticalBlock has ended. Continue.");
   684         TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): CriticalBlock has ended. Continue.");
  1479 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   685 
  1480         DoNextStartupPhaseL( EStartupOfflineModeQuery );
   686         DoNextStartupPhaseL( EStartupOfflineModeQuery );
  1481 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1482         DoNextStartupPhaseL( EStartupWaitingTouchScreenCalib );
       
  1483 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1484         }
   687         }
  1485     TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): End");
   688     TRACES("CStartupAppUi::WaitingCriticalBlockEndingL(): End");
  1486     }
   689     }
  1487 
   690 
  1488 // ---------------------------------------------------------------------------
   691 // ---------------------------------------------------------------------------
  1523     iCriticalBlockEnded = ETrue;
   726     iCriticalBlockEnded = ETrue;
  1524     if ( iInternalState == EStartupWaitingCriticalBlock )
   727     if ( iInternalState == EStartupWaitingCriticalBlock )
  1525         {
   728         {
  1526         TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): Entered emergency calls only state.");
   729         TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): Entered emergency calls only state.");
  1527 
   730 
  1528         DoNextStartupPhaseL( EStartupWaitingCUIStartupReady );
   731         DoNextStartupPhaseL( EStartupStartupOK );
  1529         }
   732         }
  1530     TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): End");
   733     TRACES("CStartupAppUi::SetEmergencyCallsOnlyL(): End");
  1531     }
   734     }
  1532 
   735 
  1533 // ---------------------------------------------------------------------------
   736 // ---------------------------------------------------------------------------
  1545         DoNextStartupPhaseL( EStartupSystemFatalError );
   748         DoNextStartupPhaseL( EStartupSystemFatalError );
  1546         }
   749         }
  1547 
   750 
  1548     TRACES("CStartupAppUi::SwStateFatalStartupErrorL(): End");
   751     TRACES("CStartupAppUi::SwStateFatalStartupErrorL(): End");
  1549     }
   752     }
  1550 
       
  1551 
       
  1552 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1553 // ---------------------------------------------------------------------------
       
  1554 // CStartupAppUi::GetOfflineModeQueryShown()
       
  1555 // ---------------------------------------------------------------------------
       
  1556 TBool CStartupAppUi::GetOfflineModeQueryShown()
       
  1557     {
       
  1558     TRACES1("CStartupAppUi::GetOfflineModeQueryShown(): iOfflineModeQueryShown == %d ", iOfflineModeQueryShown );
       
  1559     return iOfflineModeQueryShown;
       
  1560     }
       
  1561 
       
  1562 // ---------------------------------------------------------------------------
       
  1563 // CStartupAppUi::SetOfflineModeQueryShown()
       
  1564 // ---------------------------------------------------------------------------
       
  1565 void CStartupAppUi::SetOfflineModeQueryShown(TBool aValue)
       
  1566     {
       
  1567     TRACES1("CStartupAppUi::SetOfflineModeQueryShown(): iOfflineModeQueryShown == %d ", iOfflineModeQueryShown );
       
  1568     iOfflineModeQueryShown = aValue;
       
  1569     }
       
  1570 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1571 
       
  1572 // ----------------------------------------------------------------------------
   753 // ----------------------------------------------------------------------------
  1573 // CStartAppUi::DosInOfflineModeL()
   754 // CStartAppUi::DosInOfflineModeL()
  1574 // ----------------------------------------------------------------------------
   755 // ----------------------------------------------------------------------------
  1575 
   756 
  1576 TBool CStartupAppUi::DosInOfflineModeL()
   757 TBool CStartupAppUi::DosInOfflineModeL()
  1649             reply = 1;
   830             reply = 1;
  1650             }
   831             }
  1651         else if ( iOfflineModeSupported && DosInOfflineModeL() )
   832         else if ( iOfflineModeSupported && DosInOfflineModeL() )
  1652             {
   833             {
  1653             TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline mode query needed");
   834             TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline mode query needed");
  1654 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1655             RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown );
   835             RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown );
  1656             iAnimation->BringToForeground();
   836             iAnimation->BringToForeground();
  1657             iMainView->DrawDeferred();
   837             iMainView->DrawDeferred();
  1658 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1659             iWelcomeAnimation->UpdateDrawInfo( EStartupDIQueriesOn );
       
  1660             iWelcomeAnimation->DrawNow();
       
  1661 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1662             iOfflineModeQueryShown = ETrue;
   838             iOfflineModeQueryShown = ETrue;
  1663             CAknQueryDialog* dlg = new (ELeave) CAknQueryDialog( CAknQueryDialog::ENoTone );
   839             CHbDeviceMessageBoxSymbian *aMessageBox = NULL;
  1664             TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Publish dialog for Secondary UI");
   840         	aMessageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EQuestion);
  1665             dlg->PublishDialogL(SecondaryDisplay::ECmdShowOfflineQuery,
   841        	 	_LIT(KText, "Continue using phone in Offline mode?");
  1666                                 SecondaryDisplay::KCatStartup);
   842         	aMessageBox->SetTextL(KText);
  1667             if ( dlg->ExecuteLD( R_STARTUP_OFFLINE_MODE_QUERY ) )
   843         	_LIT(KAcceptText, "Yes");
       
   844         	aMessageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KAcceptText);
       
   845         	_LIT(KRejectText, "No");
       
   846         	aMessageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, KRejectText);
       
   847         	//aMessageBox->SetDismissPolicy(HbPopup::NoDismiss);
       
   848         	//define the selection button to hold user's option choice
       
   849         	CHbDeviceMessageBoxSymbian::TButtonId selection;
       
   850         	selection = aMessageBox->ExecL();
       
   851             if ( selection == CHbDeviceMessageBoxSymbian::EAcceptButton )
  1668                 {
   852                 {
  1669                 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode query: YES -> Boot to Offline");
   853                 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): Offline Mode query: YES -> Boot to Offline");
  1670                 reply = 1;
   854                 reply = 1;
  1671                 }
   855                 }
  1672             else
   856             else
  1696 
   880 
  1697     if( KErrNone != err )
   881     if( KErrNone != err )
  1698         {
   882         {
  1699         TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): KStartupBootIntoOffline set err %d", err);
   883         TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): KStartupBootIntoOffline set err %d", err);
  1700         }
   884         }
  1701 
   885    
  1702     TRACES("CStartupAppUi::ShowOfflineModeQueryL(): End");
   886     TRACES("CStartupAppUi::ShowOfflineModeQueryL(): End");
  1703     }
   887     }
  1704 
   888 
  1705 // ---------------------------------------------------------------------------
   889 // ---------------------------------------------------------------------------
  1706 // CStartupAppUi::CancelAnimation(...)
   890 // CStartupAppUi::CancelAnimation(...)
  1707 // ---------------------------------------------------------------------------
   891 // ---------------------------------------------------------------------------
  1708 void CStartupAppUi::CancelAnimation()
   892 void CStartupAppUi::CancelAnimation()
  1709     {
   893     {
  1710     TRACES("CStartupAppUi::CancelAnimation()");
   894     TRACES("CStartupAppUi::CancelAnimation()");
  1711 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
   895 
  1712     iAnimation->Cancel();
   896     iAnimation->Cancel();
  1713 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
   897 
  1714     iWelcomeAnimation->CancelAnimation();
       
  1715 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  1716     TRACES("CStartupAppUi::CancelAnimation(): End");
   898     TRACES("CStartupAppUi::CancelAnimation(): End");
  1717     }
   899     }
  1718 
   900 
  1719 // ---------------------------------------------------------------------------
   901 
  1720 // CStartupAppUi::ShowCountryAndCityListsL()
       
  1721 // ---------------------------------------------------------------------------
       
  1722 void CStartupAppUi::ShowCountryAndCityListsL()
       
  1723     {
       
  1724     TRACES("CStartupAppUi::ShowCountryAndCityListsL()");
       
  1725 
       
  1726     TInt cityselected( EFalse );
       
  1727     while ( !cityselected )
       
  1728         {
       
  1729         TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City item to focus: %d", iCounryListIndex);
       
  1730         TInt cityGroupId = ShowCountryListL();
       
  1731         TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City group id: %d", cityGroupId);
       
  1732         if ( cityGroupId != KErrCancel )
       
  1733             {
       
  1734             cityselected = ShowCityListL(cityGroupId);
       
  1735             }
       
  1736         else
       
  1737             {
       
  1738             cityselected = ETrue;
       
  1739             }
       
  1740         }
       
  1741     TRACES("CStartupAppUi::ShowCountryAndCityListsL(): End");
       
  1742     }
       
  1743 
       
  1744 // ---------------------------------------------------------------------------
       
  1745 // CStartupAppUi::ShowCountryListL()
       
  1746 // ---------------------------------------------------------------------------
       
  1747 TInt CStartupAppUi::ShowCountryListL()
       
  1748     {
       
  1749     TRACES("CStartupAppUi::ShowCountryListL()");
       
  1750 
       
  1751     CAknSinglePopupMenuStyleListBox* listBox =
       
  1752         new(ELeave) CAknSinglePopupMenuStyleListBox;
       
  1753     CleanupStack::PushL(listBox);
       
  1754 
       
  1755     CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT,
       
  1756                                                            AknPopupLayouts::EMenuGraphicHeadingWindow );
       
  1757 
       
  1758     CleanupStack::PushL(popupList);
       
  1759 
       
  1760     listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded);
       
  1761     listBox->CreateScrollBarFrameL( ETrue );
       
  1762     listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
       
  1763                                                         CEikScrollBarFrame::EAuto );
       
  1764 
       
  1765     listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
       
  1766 
       
  1767     CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1);
       
  1768 
       
  1769     CleanupStack::PushL(items);
       
  1770 
       
  1771     CTzLocalizer* tzLocalizer = CTzLocalizer::NewL();
       
  1772     CleanupStack::PushL(tzLocalizer);
       
  1773 
       
  1774     CTzLocalizedCityGroupArray* countryList;
       
  1775     countryList = tzLocalizer->GetAllCityGroupsL(CTzLocalizer::ETzAlphaNameAscending);
       
  1776     CleanupStack::PushL(countryList);
       
  1777 
       
  1778     TRACES("CStartupAppUi::ShowCountryListL(): Create list of cities");
       
  1779     for(TInt i = 0; i <countryList->Count(); i++)
       
  1780         {
       
  1781         CTzLocalizedCityGroup& cityGroup = countryList->At(i);
       
  1782 
       
  1783         // Check if the country name is blank.
       
  1784         // If it is blank, ignore it. Empty name shouldn't be shown in the list.
       
  1785         if(cityGroup.Name().Compare(KEmpty) != 0)
       
  1786             {
       
  1787             TBuf<KMaxCountryLength> countryitem;
       
  1788             countryitem.Insert(0,cityGroup.Name());
       
  1789             TRACES1("CStartupAppUi::ShowCountryListL(): Create country to list: %S", &countryitem);
       
  1790             items->AppendL(countryitem);
       
  1791             }
       
  1792         }
       
  1793 
       
  1794     CleanupStack::PopAndDestroy( countryList );
       
  1795 
       
  1796     CTextListBoxModel* model=listBox->Model();
       
  1797     model->SetItemTextArray(items);
       
  1798     model->SetOwnershipType(ELbmOwnsItemArray);
       
  1799 
       
  1800     TRACES("CStartupAppUi::ShowCountryListL(): Set title");
       
  1801     // Set title
       
  1802     HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_COUNTRY );
       
  1803     popupList->SetTitleL(title->Des());
       
  1804     CleanupStack::PopAndDestroy( title );
       
  1805 
       
  1806     popupList->EnableAdaptiveFind();
       
  1807     listBox->SetCurrentItemIndex(iCounryListIndex);
       
  1808 
       
  1809     TInt cityGroupId;
       
  1810 
       
  1811     if (iCoverUISupported)
       
  1812         {
       
  1813         TRACES("CStartupAppUi::ShowCountryListL(): Publish country list for Secondary UI");
       
  1814         TPckgBuf<TInt> data( SecondaryDisplay::EShowCountryQuery );
       
  1815         iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup,
       
  1816                                               SecondaryDisplay::EMsgStartupEvent,
       
  1817                                               data );
       
  1818         }
       
  1819 
       
  1820     TRACES("CStartupAppUi::ShowCountryListL(): Show the list");
       
  1821     if (popupList->ExecuteLD())
       
  1822         {
       
  1823         iCounryListIndex = listBox->CurrentItemIndex();
       
  1824         TRACES1("CStartupAppUi::ShowCountryListL(): CurrentItemIndex: %d", iCounryListIndex);
       
  1825         TPtrC countryName = listBox->Model()->ItemText(iCounryListIndex);
       
  1826 
       
  1827         CTzLocalizedCityGroup* tzLocalizedCityGroup = tzLocalizer->FindCityGroupByNameL(countryName);
       
  1828         CleanupStack::PushL(tzLocalizedCityGroup);
       
  1829 
       
  1830         cityGroupId = tzLocalizedCityGroup->Id();
       
  1831         CleanupStack::PopAndDestroy( tzLocalizedCityGroup );
       
  1832 
       
  1833         TRACES1("CStartupAppUi::ShowCountryListL(): Selected country %S", &countryName);
       
  1834         }
       
  1835     else
       
  1836         {
       
  1837         TRACES("CStartupAppUi::ShowCountryListL(): Country list cancelled");
       
  1838         cityGroupId = KErrCancel;
       
  1839         }
       
  1840 
       
  1841     CleanupStack::PopAndDestroy( tzLocalizer );
       
  1842     CleanupStack::Pop( items );
       
  1843     CleanupStack::Pop( popupList );
       
  1844     CleanupStack::PopAndDestroy( listBox ); 
       
  1845 
       
  1846     TRACES1("CStartupAppUi::ShowCountryListL(): End. Return city group id: %d", cityGroupId);
       
  1847     return cityGroupId;
       
  1848     }
       
  1849 
       
  1850 // ---------------------------------------------------------------------------
       
  1851 // CStartupAppUi::ShowCityListL()
       
  1852 // ---------------------------------------------------------------------------
       
  1853 TBool CStartupAppUi::ShowCityListL(TUint8 cityGroupId)
       
  1854     {
       
  1855     TRACES("CStartupAppUi::ShowCityListL()");
       
  1856 
       
  1857     TBool retval( ETrue );
       
  1858 
       
  1859     CTzLocalizer* tzLocalizer = CTzLocalizer::NewL();
       
  1860     CleanupStack::PushL(tzLocalizer);
       
  1861 
       
  1862     CTzLocalizedCityArray* cityList;
       
  1863 
       
  1864     TRACES1("CStartupAppUi::ShowCityListL(): Create list of cities in group %d", cityGroupId);
       
  1865 
       
  1866     cityList = tzLocalizer->GetCitiesInGroupL(cityGroupId,//cityGroup.Id(),
       
  1867                                                   CTzLocalizer::ETzAlphaNameAscending );
       
  1868     CleanupStack::PushL(cityList);
       
  1869 
       
  1870     if ( cityList->Count() == 1 )
       
  1871         {
       
  1872         TRACES("CStartupAppUi::ShowCityListL(): Only one city in citygroup. This can be selected automatically.");
       
  1873 
       
  1874         CTzLocalizedCity& city = cityList->At(0);
       
  1875 
       
  1876         CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(city.Name());
       
  1877         CleanupStack::PushL(tzLocalizedCity);
       
  1878 
       
  1879         TInt timeZoneId = tzLocalizedCity->TimeZoneId();
       
  1880 
       
  1881         tzLocalizer->SetTimeZoneL(timeZoneId);
       
  1882         tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone);
       
  1883 
       
  1884         CleanupStack::PopAndDestroy( tzLocalizedCity );
       
  1885         CleanupStack::PopAndDestroy( cityList );
       
  1886         CleanupStack::PopAndDestroy( tzLocalizer );
       
  1887 
       
  1888         TRACES1("CStartupAppUi::ShowCityListL(): End, returns %d", retval);
       
  1889         return retval;
       
  1890         }
       
  1891 
       
  1892     CAknSinglePopupMenuStyleListBox* listBox =
       
  1893         new(ELeave) CAknSinglePopupMenuStyleListBox;
       
  1894     CleanupStack::PushL(listBox);
       
  1895 
       
  1896     CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT,
       
  1897                                                            AknPopupLayouts::EMenuGraphicHeadingWindow );
       
  1898 
       
  1899     CleanupStack::PushL(popupList);
       
  1900 
       
  1901     CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1);
       
  1902 
       
  1903     CleanupStack::PushL(items);
       
  1904 
       
  1905     for(TInt j = 0; j < cityList->Count(); j++)
       
  1906         {
       
  1907         CTzLocalizedCity& city = cityList->At(j);
       
  1908 
       
  1909         // Check if the city name is blank.
       
  1910         // If it is blank, ignore it. Empty name shouldn't be shown in the list.
       
  1911         if(city.Name().Compare(KEmpty) != 0)
       
  1912             {
       
  1913             TBuf<KMaxCityLength> homecityitem;
       
  1914             homecityitem.Insert(0,city.Name());
       
  1915             TRACES1("CStartupAppUi::ShowCityListL(): Create to list: %S", &homecityitem);
       
  1916             items->AppendL(homecityitem);
       
  1917             }
       
  1918         }
       
  1919 
       
  1920     listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded);
       
  1921     listBox->CreateScrollBarFrameL( ETrue );
       
  1922     listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
       
  1923                                                         CEikScrollBarFrame::EAuto );
       
  1924 
       
  1925     listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
       
  1926 
       
  1927     CTextListBoxModel* model=listBox->Model();
       
  1928     model->SetItemTextArray(items);
       
  1929     model->SetOwnershipType(ELbmOwnsItemArray);
       
  1930 
       
  1931     TRACES("CStartupAppUi::ShowCityListL(): Set title");
       
  1932     // Set title
       
  1933     HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_CITY );
       
  1934     popupList->SetTitleL(title->Des());
       
  1935     CleanupStack::PopAndDestroy(title);
       
  1936 
       
  1937     popupList->EnableAdaptiveFind();
       
  1938 
       
  1939     if (iCoverUISupported)
       
  1940         {
       
  1941         TRACES("CStartupAppUi::ShowCountryListL(): Publish city list for Secondary UI");
       
  1942         TPckgBuf<TInt> data( SecondaryDisplay::EShowCityQuery );
       
  1943         iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup,
       
  1944                                               SecondaryDisplay::EMsgStartupEvent,
       
  1945                                               data );
       
  1946         }
       
  1947 
       
  1948     TRACES("CStartupAppUi::ShowCityListL(): Show the list");
       
  1949     if (popupList->ExecuteLD())
       
  1950         {
       
  1951         TInt index(listBox->CurrentItemIndex());
       
  1952         TRACES1("CStartupAppUi::ShowCityListL(): CurrentItemIndex: %d", index);
       
  1953         TPtrC cityName = listBox->Model()->ItemText(index);
       
  1954 
       
  1955         CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(cityName);
       
  1956         CleanupStack::PushL(tzLocalizedCity);
       
  1957 
       
  1958         TInt timeZoneId = tzLocalizedCity->TimeZoneId();
       
  1959 
       
  1960         tzLocalizer->SetTimeZoneL(timeZoneId);
       
  1961         tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone);
       
  1962 
       
  1963         CleanupStack::PopAndDestroy(tzLocalizedCity);
       
  1964 
       
  1965         TRACES1("CStartupAppUi::ShowCityListL(): Selected city    %S", &cityName);
       
  1966         }
       
  1967     else
       
  1968         {
       
  1969         TRACES("CStartupAppUi::ShowCityListL(): City list cancelled");
       
  1970         retval = EFalse;
       
  1971         }
       
  1972 
       
  1973     CleanupStack::Pop(items);
       
  1974     CleanupStack::Pop(popupList);
       
  1975     CleanupStack::PopAndDestroy(listBox);
       
  1976     CleanupStack::PopAndDestroy(cityList);
       
  1977     CleanupStack::PopAndDestroy(tzLocalizer);
       
  1978 
       
  1979 
       
  1980     TRACES("CStartupAppUi::ShowCityListL(): Home city selected");
       
  1981     TRACES1("CStartupAppUi::ShowCityListL(): End, return %d", retval);
       
  1982     return retval;
       
  1983     }
       
  1984 
       
  1985 // ---------------------------------------------------------------------------
       
  1986 // CStartupAppUi::ShowTimeQueryL()
       
  1987 // ---------------------------------------------------------------------------
       
  1988 TBool CStartupAppUi::ShowTimeQueryL()
       
  1989     {
       
  1990     TRACES("CStartupAppUi::ShowTimeQueryL()");
       
  1991 
       
  1992     TTime time;
       
  1993     GetDefaultTimeAndDate( time );
       
  1994 
       
  1995     CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(time, CAknQueryDialog::ENoTone);
       
  1996     TRACES("CStartupAppUi::ShowTimeQueryL(): Publish dialog for Secondary UI");
       
  1997     dlg->PublishDialogL(SecondaryDisplay::ECmdShowTimeQuery, SecondaryDisplay::KCatStartup);
       
  1998     if( dlg->ExecuteLD( R_STARTUP_TIME_SETTING_QUERY ) )
       
  1999         {
       
  2000         TTime current;
       
  2001         current.HomeTime();
       
  2002         TDateTime cTime = current.DateTime();
       
  2003         TDateTime atime = time.DateTime();
       
  2004         atime.SetYear(cTime.Year());
       
  2005         atime.SetMonth(cTime.Month());
       
  2006         atime.SetDay(cTime.Day());
       
  2007         time = atime;
       
  2008 
       
  2009         RTz rtz;
       
  2010         User::LeaveIfError(rtz.Connect());
       
  2011         User::LeaveIfError(rtz.SetHomeTime(time));
       
  2012         rtz.Close();
       
  2013 
       
  2014         TRACES("CStartupAppUi::ShowTimeQueryL(): End, return ETrue");
       
  2015         return ETrue;
       
  2016         }
       
  2017     else
       
  2018         {
       
  2019         //in case of poweroff key was pressed and shutdown is occuring
       
  2020         TRACES("CStartupAppUi::ShowTimeQueryL(): End, return EFalse");
       
  2021         return EFalse;
       
  2022         }
       
  2023     }
       
  2024 
       
  2025 // ---------------------------------------------------------------------------
       
  2026 // CStartupAppUi::ShowDateQueryL()
       
  2027 // ---------------------------------------------------------------------------
       
  2028 TBool CStartupAppUi::ShowDateQueryL()
       
  2029     {
       
  2030     TRACES("CStartupAppUi::ShowDateQueryL()");
       
  2031 
       
  2032 
       
  2033     CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(iTime, CAknQueryDialog::ENoTone);
       
  2034     TRACES("CStartupAppUi::ShowDateQueryL(): Publish dialog for Secondary UI");
       
  2035     dlg->PublishDialogL(SecondaryDisplay::ECmdShowDateQuery, SecondaryDisplay::KCatStartup);
       
  2036 
       
  2037     TInt query( R_STARTUP_DATE_SETTING_QUERY_NOBACK );
       
  2038     if ( iFirstBoot ) 
       
  2039         {
       
  2040         query = R_STARTUP_DATE_SETTING_QUERY;
       
  2041         }
       
  2042 
       
  2043     if( dlg->ExecuteLD( query ) )
       
  2044         {
       
  2045         TTime current;
       
  2046         current.HomeTime();
       
  2047         TDateTime cTime = current.DateTime();
       
  2048         TDateTime atime = iTime.DateTime();
       
  2049         atime.SetHour(cTime.Hour());
       
  2050         atime.SetMinute(cTime.Minute());
       
  2051         atime.SetSecond(cTime.Second());
       
  2052         atime.SetMicroSecond(cTime.MicroSecond());
       
  2053         iTime = atime;
       
  2054 
       
  2055         RTz rtz;
       
  2056         User::LeaveIfError(rtz.Connect());
       
  2057         User::LeaveIfError(rtz.SetHomeTime(iTime));
       
  2058         rtz.Close();
       
  2059 
       
  2060         TRACES("CStartupAppUi::ShowDateQueryL(): End, return ETrue");
       
  2061         return ETrue;
       
  2062         }
       
  2063     else
       
  2064         {
       
  2065         // Back key pressed. ( Or poweroff key was pressed and shutdown is occuring )
       
  2066         TRACES("CStartupAppUi::ShowDateQueryL(): End, return EFalse");
       
  2067         return EFalse;
       
  2068         }
       
  2069     }
       
  2070 
       
  2071 // ---------------------------------------------------------------------------
       
  2072 // CStartupAppUi::GetDefaultTimeAndDate()
       
  2073 // ---------------------------------------------------------------------------
       
  2074 void CStartupAppUi::GetDefaultTimeAndDate( TTime& aTime )
       
  2075     {
       
  2076     TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Get Time and Date from CenRep");
       
  2077 
       
  2078     CRepository* repository(NULL);
       
  2079 
       
  2080     TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) );
       
  2081     if ( !err )
       
  2082         {
       
  2083         TBuf<KTimeFormatLength> buf;
       
  2084         err = repository->Get( KStartupDefaultTime, buf );
       
  2085         if( !err )
       
  2086             {
       
  2087             err = aTime.Set(buf); // returns error if cenrep time format not valid
       
  2088             }
       
  2089         }
       
  2090 
       
  2091     if ( err )
       
  2092         {
       
  2093         TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Failed to get valid data from CenRep. Using default");
       
  2094         aTime.Set(KDefaultDateTimeValue);
       
  2095         }
       
  2096 
       
  2097     delete repository;
       
  2098     TRACES("CStartupAppUi::GetDefaultTimeAndDate(): End");
       
  2099     }
       
  2100 
   902 
  2101 // ---------------------------------------------------------------------------
   903 // ---------------------------------------------------------------------------
  2102 // CStartupAppUi::FirstBoot()
   904 // CStartupAppUi::FirstBoot()
  2103 // ---------------------------------------------------------------------------
   905 // ---------------------------------------------------------------------------
  2104 TBool CStartupAppUi::FirstBoot()
   906 TBool CStartupAppUi::FirstBoot()
  2196     delete repository;
   998     delete repository;
  2197     TRACES("CStartupAppUi::MarkFirstBoot(): End");
   999     TRACES("CStartupAppUi::MarkFirstBoot(): End");
  2198     }
  1000     }
  2199 
  1001 
  2200 
  1002 
  2201 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1003 
  2202 // ---------------------------------------------------------------------------
  1004 // ---------------------------------------------------------------------------
  2203 // CStartupAppUi::AnimationFinished()
  1005 // CStartupAppUi::AnimationFinished()
  2204 // ---------------------------------------------------------------------------
  1006 // ---------------------------------------------------------------------------
  2205 void CStartupAppUi::AnimationFinished()
  1007 void CStartupAppUi::AnimationFinished()
  2206     {
  1008     {
  2238         {
  1040         {
  2239         TRAP(err, DoNextStartupPhaseL( EStartupShowingOperatorAnimation ));
  1041         TRAP(err, DoNextStartupPhaseL( EStartupShowingOperatorAnimation ));
  2240         }
  1042         }
  2241     else if ( iInternalState == EStartupShowingOperatorAnimation )
  1043     else if ( iInternalState == EStartupShowingOperatorAnimation )
  2242         {
  1044         {
  2243         TRAP(err, DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ));
  1045         TRAP(err, DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck));
  2244         }
  1046         }
  2245 
  1047 
  2246     if ( err != KErrNone )
  1048     if ( err != KErrNone )
  2247         {
  1049         {
  2248         TRAP_IGNORE( DoNextStartupPhaseL(EStartupSystemFatalError) );
  1050         TRAP_IGNORE( DoNextStartupPhaseL(EStartupSystemFatalError) );
  2249         }
  1051         }
  2250 
  1052 
  2251     TRACES("CStartupAppUi::AnimationFinished(): End");
  1053     TRACES("CStartupAppUi::AnimationFinished(): End");
  2252     }
  1054     }
  2253 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2254 // ---------------------------------------------------------------------------
       
  2255 // CStartupAppUi::StopStartupTone()
       
  2256 // ---------------------------------------------------------------------------
       
  2257 void CStartupAppUi::StopStartupTone()
       
  2258     {
       
  2259     TRACES("CStartupAppUi::StopStartupTone()");
       
  2260     if ((iStartupTone) && (iStartupTone->Playing()))
       
  2261         {
       
  2262         iStartupTone->Stop();
       
  2263         }
       
  2264     TRACES("CStartupAppUi::StopStartupTone(): End");
       
  2265     }
       
  2266 
       
  2267 // ---------------------------------------------------------------------------
       
  2268 // CStartupAppUi::StopOperatorTone()
       
  2269 // ---------------------------------------------------------------------------
       
  2270 void CStartupAppUi::StopOperatorTone()
       
  2271     {
       
  2272     TRACES("CStartupAppUi::StopOperatorTone()");
       
  2273     if ((iOpStartupTone) && (iOpStartupTone->Playing()))
       
  2274         {
       
  2275         iOpStartupTone->Stop();
       
  2276         }
       
  2277     TRACES("CStartupAppUi::StopOperatorTone(): End");
       
  2278     }
       
  2279 
       
  2280 // ---------------------------------------------------------------------------
       
  2281 // CStartupAppUi::StartupTonePlaying()
       
  2282 // ---------------------------------------------------------------------------
       
  2283 TBool CStartupAppUi::StartupTonePlaying()
       
  2284     {
       
  2285     TRACES("CStartupAppUi::StartupTonePlaying()");
       
  2286     return iStartupTone->Playing();
       
  2287     }
       
  2288 
       
  2289 // ---------------------------------------------------------------------------
       
  2290 // CStartupAppUi::OperatorTonePlaying()
       
  2291 // ---------------------------------------------------------------------------
       
  2292 TBool CStartupAppUi::OperatorTonePlaying()
       
  2293     {
       
  2294     TRACES("CStartupAppUi::OperatorTonePlaying()");
       
  2295     return iOpStartupTone->Playing();
       
  2296     }
       
  2297 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2298 
  1055 
  2299 // ---------------------------------------------------------------------------
  1056 // ---------------------------------------------------------------------------
  2300 // CStartupAppUi::SetCleanBoot()
  1057 // CStartupAppUi::SetCleanBoot()
  2301 // ---------------------------------------------------------------------------
  1058 // ---------------------------------------------------------------------------
  2302 void CStartupAppUi::SetCleanBoot()
  1059 void CStartupAppUi::SetCleanBoot()
  2313     {
  1070     {
  2314     TRACES("CStartupAppUi::SimSupported()");
  1071     TRACES("CStartupAppUi::SimSupported()");
  2315     return iSimSupported;
  1072     return iSimSupported;
  2316     }
  1073     }
  2317 
  1074 
  2318 // ----------------------------------------------------------------------------
  1075 
  2319 // CStartupAppUi::CoverUISupported()
       
  2320 // ----------------------------------------------------------------------------
       
  2321 TBool CStartupAppUi::CoverUISupported()
       
  2322     {
       
  2323     TRACES("CStartupAppUi::CoverUISupported()");
       
  2324     return iCoverUISupported;
       
  2325     }
       
  2326 
  1076 
  2327 // ---------------------------------------------------------------------------
  1077 // ---------------------------------------------------------------------------
  2328 // CStartupAppUi::DoNextStartupPhaseL( TStartupInternalState toState )
  1078 // CStartupAppUi::DoNextStartupPhaseL( TStartupInternalState toState )
  2329 // State#                                Possible next states
  1079 // State#                                Possible next states
  2330 
  1080 
  2332 // 0    EStartupStartingUp               1, 18
  1082 // 0    EStartupStartingUp               1, 18
  2333 // 1    EStartupWaitingCriticalBlock     5, 18
  1083 // 1    EStartupWaitingCriticalBlock     5, 18
  2334 // 5    EStartupWaitingTouchScreenCalib
  1084 // 5    EStartupWaitingTouchScreenCalib
  2335 // 6    EStartupWaitingPhoneLightIdle    8, 18
  1085 // 6    EStartupWaitingPhoneLightIdle    8, 18
  2336 // 8    EStartupOfflineModeQuery         9, 18
  1086 // 8    EStartupOfflineModeQuery         9, 18
  2337 // 9    EStartupWaitingCUIWelcomeAnim    10, 18
  1087 // 9    EStartupWaitingCUIWelcomeAnim    10, 18 Removed
  2338 // 10   EStartupWaitingStartupTone       11, 18
  1088 // 10   EStartupWaitingStartupTone       11, 18
  2339 // 11   EStartupShowingWelcomeAnimation  12, 14, 18
  1089 // 11   EStartupShowingWelcomeAnimation  12, 14, 18
  2340 // 12   EStartupWaitingCUIOperatorAnim   13, 18
  1090 // 12   EStartupWaitingCUIOperatorAnim   13, 18
  2341 // 13   EStartupShowingOperatorAnimation 14, 14, 18
  1091 // 13   EStartupShowingOperatorAnimation 14, 14, 18
  2342 // 14   EStartupShowingUserWelcomeNote   15, 18
  1092 // 14   EStartupShowingUserWelcomeNote   15, 18 Removed
  2343 // 15   EStartupFirstBootAndRTCCheck     16, 18
  1093 // 15   EStartupFirstBootAndRTCCheck     16, 18
  2344 // 16   EStartupWaitingCUIStartupReady   17, 18
  1094 // 16   EStartupWaitingCUIStartupReady   17, 18 Removed
  2345 // 17   EStartupStartupOK                -
  1095 // 17   EStartupStartupOK                -
  2346 // 18   EStartupSystemFatalError         -
  1096 // 18   EStartupSystemFatalError         -
  2347 
  1097 
  2348 // ---------------------------------------------------------------------------
  1098 // ---------------------------------------------------------------------------
  2349 
  1099 
  2375             break;
  1125             break;
  2376         case EStartupWaitingCriticalBlock:
  1126         case EStartupWaitingCriticalBlock:
  2377             {
  1127             {
  2378             switch( toState )
  1128             switch( toState )
  2379                 {
  1129                 {
  2380                 case EStartupWaitingCUIStartupReady:
  1130                 case EStartupStartupOK:
  2381                     iInternalState = EStartupWaitingCUIStartupReady;
  1131                     iInternalState = EStartupStartupOK;
  2382                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIStartupReady");
  1132                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupStartupOK");
  2383                     WaitingCoverUIStartupReadySyncL();
  1133                     DoStartupEndPart();
  2384                     break;
  1134                     break;
  2385 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1135 
  2386                 case EStartupWaitingTouchScreenCalib:
  1136                 case EStartupOfflineModeQuery:
  2387                     iInternalState = EStartupWaitingTouchScreenCalib;
  1137                     iInternalState = EStartupOfflineModeQuery;
  2388                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingTouchScreenCalib");
  1138                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupOfflineModeQuery");
  2389                     WaitingTouchScreenCalibL();
  1139                     ShowOfflineModeQueryL();
       
  1140 
       
  1141                     DoNextStartupPhaseL( EStartupWaitingShowStartupAnimation );
  2390                     break;
  1142                     break;
  2391                 case EStartupSystemFatalError:
  1143                 case EStartupSystemFatalError:
  2392                     SystemFatalErrorL();
  1144                     SystemFatalErrorL();
  2393                     break;
  1145                     break;
  2394                 default:
  1146                 default:
  2397                         PANIC( EStartupInvalidInternalStateChange ) );
  1149                         PANIC( EStartupInvalidInternalStateChange ) );
  2398                     break;
  1150                     break;
  2399                 }
  1151                 }
  2400             }
  1152             }
  2401             break;
  1153             break;
  2402         case EStartupWaitingTouchScreenCalib:
  1154         case EStartupOfflineModeQuery:
  2403             {
  1155             {
  2404             switch( toState )
  1156             switch( toState )
  2405                 {
  1157                 {
  2406 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
  1158 
  2407                 case EStartupOfflineModeQuery:
  1159                 case EStartupWaitingShowStartupAnimation:
  2408                     iInternalState = EStartupOfflineModeQuery;
  1160                     iInternalState = EStartupWaitingShowStartupAnimation;
  2409                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupOfflineModeQuery");
  1161                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingShowStartupAnimation");
  2410                     ShowOfflineModeQueryL();
  1162                     WaitingStartupAnimationStartL();
  2411 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1163                     break;
  2412                     DoNextStartupPhaseL( EStartupWaitingShowStartupAnimation );
  1164               case EStartupSystemFatalError:
  2413 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2414                     DoNextStartupPhaseL( EStartupWaitingCUIWelcomeAnim );
       
  2415 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2416                     break;
       
  2417                 case EStartupSystemFatalError:
       
  2418                     SystemFatalErrorL();
  1165                     SystemFatalErrorL();
  2419                     break;
  1166                     break;
  2420                 default:
  1167                 default:
  2421                     __ASSERT_DEBUG(
  1168                     __ASSERT_DEBUG(
  2422                         EFalse,
  1169                         EFalse,
  2423                         PANIC( EStartupInvalidInternalStateChange ) );
  1170                         PANIC( EStartupInvalidInternalStateChange ) );
  2424                     break;
  1171                     break;
  2425                 }
  1172                 }
  2426             }
  1173             }
  2427             break;
  1174             break;
  2428         case EStartupOfflineModeQuery:
       
  2429             {
       
  2430             switch( toState )
       
  2431                 {
       
  2432 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2433                 case EStartupWaitingShowStartupAnimation:
       
  2434                     iInternalState = EStartupWaitingShowStartupAnimation;
       
  2435                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingShowStartupAnimation");
       
  2436                     WaitingStartupAnimationStartL();
       
  2437                     break;
       
  2438 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2439                 case EStartupWaitingCUIWelcomeAnim:
       
  2440                     iInternalState = EStartupWaitingCUIWelcomeAnim;
       
  2441                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIWelcomeAnim");
       
  2442                     WaitingCoverUIWelcomeAnimationSyncL();
       
  2443                     break;
       
  2444 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2445                 case EStartupSystemFatalError:
       
  2446                     SystemFatalErrorL();
       
  2447                     break;
       
  2448                 default:
       
  2449                     __ASSERT_DEBUG(
       
  2450                         EFalse,
       
  2451                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2452                     break;
       
  2453                 }
       
  2454             }
       
  2455             break;
       
  2456 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2457         case EStartupWaitingCUIWelcomeAnim:
       
  2458             {
       
  2459             switch( toState )
       
  2460                 {
       
  2461                 case EStartupWaitingStartupTone:
       
  2462                     iInternalState = EStartupWaitingStartupTone;
       
  2463                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingStartupTone");
       
  2464                     WaitingStartupToneL();
       
  2465                     break;
       
  2466                 case EStartupSystemFatalError:
       
  2467                     SystemFatalErrorL();
       
  2468                     break;
       
  2469                 default:
       
  2470                     __ASSERT_DEBUG( EFalse,
       
  2471                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2472                     break;
       
  2473                 }
       
  2474             }
       
  2475             break;
       
  2476         case EStartupWaitingStartupTone:
       
  2477             {
       
  2478             switch( toState )
       
  2479                 {
       
  2480                 case EStartupShowingWelcomeAnimation:
       
  2481                     iInternalState = EStartupShowingWelcomeAnimation;
       
  2482                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupShowingWelcomeAnimation");
       
  2483                     iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimStart );
       
  2484                     iWelcomeAnimation->DrawNow();
       
  2485                     DoStartupShowWelcomeAnimationL();
       
  2486                     iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimEnd );
       
  2487                     iWelcomeAnimation->DrawNow();
       
  2488                     break;
       
  2489                 case EStartupSystemFatalError:
       
  2490                     SystemFatalErrorL();
       
  2491                     break;
       
  2492                 default:
       
  2493                     __ASSERT_DEBUG( EFalse,
       
  2494                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2495                     break;
       
  2496                 }
       
  2497             }
       
  2498             break;
       
  2499 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2500         case EStartupWaitingShowStartupAnimation:
  1175         case EStartupWaitingShowStartupAnimation:
  2501             {
  1176             {
  2502             switch( toState )
  1177             switch( toState )
  2503                 {
  1178                 {
  2504                 case EStartupShowingWelcomeAnimation:
  1179                 case EStartupShowingWelcomeAnimation:
  2519             break;
  1194             break;
  2520         case EStartupShowingWelcomeAnimation:
  1195         case EStartupShowingWelcomeAnimation:
  2521             {
  1196             {
  2522             switch( toState )
  1197             switch( toState )
  2523                 {
  1198                 {
  2524 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1199 
  2525                 case EStartupShowingOperatorAnimation:
  1200                 case EStartupShowingOperatorAnimation:
  2526                     iInternalState = EStartupShowingOperatorAnimation;
  1201                     iInternalState = EStartupShowingOperatorAnimation;
  2527                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingOperatorAnimation");
  1202                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingOperatorAnimation");
  2528                     DoStartupShowOperatorAnimationL();
  1203                     DoStartupShowOperatorAnimationL();
  2529 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2530                 case EStartupWaitingCUIOperatorAnim:
       
  2531                     iOperatorAnimation = CStartupOperatorAnimation::NewL( this, ClientRect());
       
  2532                     AddToStackL( iOperatorAnimation);
       
  2533                     iInternalState = EStartupWaitingCUIOperatorAnim;
       
  2534                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupWaitingCUIOperatorAnim");
       
  2535                     WaitingCoverUIOperatorAnimationSyncL();
       
  2536 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2537                     break;
  1204                     break;
  2538                 case EStartupFirstBootAndRTCCheck:
  1205                 case EStartupFirstBootAndRTCCheck:
  2539                     iInternalState = EStartupFirstBootAndRTCCheck;
  1206                     iInternalState = EStartupFirstBootAndRTCCheck;
  2540                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck");
  1207                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck");
  2541                     DoStartupFirstBootAndRTCCheckL();
  1208                     DoStartupFirstBootAndRTCCheckL();
  2548                         PANIC( EStartupInvalidInternalStateChange ) );
  1215                         PANIC( EStartupInvalidInternalStateChange ) );
  2549                     break;
  1216                     break;
  2550                 }
  1217                 }
  2551             }
  1218             }
  2552             break;
  1219             break;
  2553 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1220         case EStartupShowingOperatorAnimation:
  2554         case EStartupWaitingCUIOperatorAnim:
       
  2555             {
  1221             {
  2556             switch( toState )
  1222             switch( toState )
  2557                 {
  1223                 {
  2558                 case EStartupShowingOperatorAnimation:
  1224                 
  2559                     iInternalState = EStartupShowingOperatorAnimation;
  1225                  
  2560                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingOperatorAnimation");
       
  2561                     iOperatorAnimation->UpdateDrawInfo( EStartupDIOperatorAnimStart );
       
  2562                     DoStartupShowOperatorAnimationL();
       
  2563                     break;
       
  2564                 case EStartupSystemFatalError:
       
  2565                     SystemFatalErrorL();
       
  2566                     break;
       
  2567                 default:
       
  2568                     __ASSERT_DEBUG( EFalse,
       
  2569                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2570                     break;
       
  2571                 }
       
  2572             }
       
  2573             break;
       
  2574 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2575         case EStartupShowingOperatorAnimation:
       
  2576             {
       
  2577             switch( toState )
       
  2578                 {
       
  2579                 case EStartupShowingUserWelcomeNote:
       
  2580 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2581                     iUserWelcomeNote = CStartupUserWelcomeNote::NewL( *this, ClientRect());
       
  2582                     AddToStackL( iUserWelcomeNote );
       
  2583 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2584                     iInternalState = EStartupShowingUserWelcomeNote;
       
  2585                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState: EStartupShowingUserWelcomeNote");
       
  2586 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2587                     iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeNoteStart );
       
  2588                     iUserWelcomeNote->SetUserWelcomeNoteShowing(ETrue);
       
  2589 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
  2590                     DoStartupShowUserWelcomeNoteL();
       
  2591                     break;
       
  2592                 case EStartupFirstBootAndRTCCheck:
  1226                 case EStartupFirstBootAndRTCCheck:
  2593                     iInternalState = EStartupFirstBootAndRTCCheck;
  1227                     iInternalState = EStartupFirstBootAndRTCCheck;
  2594                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck");
  1228                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck");
  2595                     DoStartupFirstBootAndRTCCheckL();
  1229                     DoStartupFirstBootAndRTCCheckL();
  2596                     break;
  1230                     break;
  2602                         PANIC( EStartupInvalidInternalStateChange ) );
  1236                         PANIC( EStartupInvalidInternalStateChange ) );
  2603                     break;
  1237                     break;
  2604                 }
  1238                 }
  2605             }
  1239             }
  2606             break;
  1240             break;
  2607         case EStartupShowingUserWelcomeNote:
  1241       
  2608             {
       
  2609             switch( toState )
       
  2610                 {
       
  2611                 case EStartupFirstBootAndRTCCheck:
       
  2612                     iInternalState = EStartupFirstBootAndRTCCheck;
       
  2613                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupFirstBootAndRTCCheck");
       
  2614                     DoStartupFirstBootAndRTCCheckL();
       
  2615                     break;
       
  2616                 case EStartupSystemFatalError:
       
  2617                     SystemFatalErrorL();
       
  2618                     break;
       
  2619                 default:
       
  2620                     __ASSERT_DEBUG( EFalse,
       
  2621                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2622                     break;
       
  2623                 }
       
  2624             }
       
  2625             break;
       
  2626         case EStartupFirstBootAndRTCCheck:
  1242         case EStartupFirstBootAndRTCCheck:
  2627             {
       
  2628             switch( toState )
       
  2629                 {
       
  2630                 case EStartupWaitingCUIStartupReady:
       
  2631                     iInternalState = EStartupWaitingCUIStartupReady;
       
  2632                     TRACES("CStartupAppUi::DoNextStartupPhaseL(): InternalState : EStartupWaitingCUIStartupReady");
       
  2633                     WaitingCoverUIStartupReadySyncL();
       
  2634                     break;
       
  2635                 case EStartupSystemFatalError:
       
  2636                     SystemFatalErrorL();
       
  2637                     break;
       
  2638                 default:
       
  2639                     __ASSERT_DEBUG( EFalse,
       
  2640                         PANIC( EStartupInvalidInternalStateChange ) );
       
  2641                     break;
       
  2642                 }
       
  2643             }
       
  2644             break;
       
  2645         case EStartupWaitingCUIStartupReady:
       
  2646             {
  1243             {
  2647             switch( toState )
  1244             switch( toState )
  2648                 {
  1245                 {
  2649                 case EStartupStartupOK:
  1246                 case EStartupStartupOK:
  2650                     iInternalState = EStartupStartupOK;
  1247                     iInternalState = EStartupStartupOK;
  2667                 {
  1264                 {
  2668                 case EStartupStartingUp:
  1265                 case EStartupStartingUp:
  2669                 case EStartupOfflineModeQuery:
  1266                 case EStartupOfflineModeQuery:
  2670                 case EStartupShowingWelcomeAnimation:
  1267                 case EStartupShowingWelcomeAnimation:
  2671                 case EStartupShowingOperatorAnimation:
  1268                 case EStartupShowingOperatorAnimation:
  2672                 case EStartupShowingUserWelcomeNote:
       
  2673                 case EStartupFirstBootAndRTCCheck:
  1269                 case EStartupFirstBootAndRTCCheck:
  2674                 case EStartupWaitingCUIStartupReady:
  1270                 case EStartupWaitingCUIStartupReady:
  2675                 case EStartupStartupOK:
  1271                 case EStartupStartupOK:
  2676                 case EStartupSystemFatalError:
  1272                 case EStartupSystemFatalError:
  2677                     //no need to continue, because state is
  1273                     //no need to continue, because state is
  2723         }
  1319         }
  2724     TRACES1( "CStartupAppUi::SimStatusChangedReset(): End, return %d", ret_val );
  1320     TRACES1( "CStartupAppUi::SimStatusChangedReset(): End, return %d", ret_val );
  2725     return ret_val;
  1321     return ret_val;
  2726     }
  1322     }
  2727 
  1323 
  2728 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
  1324 
  2729 // ---------------------------------------------------------------------------
  1325 // ---------------------------------------------------------------------------
  2730 // CStartupAppUi::UpdateStartupUiPhase()
  1326 // CStartupAppUi::UpdateStartupUiPhase()
  2731 // ---------------------------------------------------------------------------
  1327 // ---------------------------------------------------------------------------
  2732 void CStartupAppUi::UpdateStartupUiPhase( TInt aValue )
  1328 void CStartupAppUi::UpdateStartupUiPhase( TInt aValue )
  2733     {
  1329     {
  2738     if( KErrNone != err )
  1334     if( KErrNone != err )
  2739         {
  1335         {
  2740         TRACES1("CStartupAppUi::UpdateStartupUiPhase(): KPSStartupUiPhase set err %d", err);
  1336         TRACES1("CStartupAppUi::UpdateStartupUiPhase(): KPSStartupUiPhase set err %d", err);
  2741         }                          
  1337         }                          
  2742     }
  1338     }
  2743 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
  1339 
  2744 // End of file
  1340 // End of file