56 |
58 |
57 // Constants |
59 // Constants |
58 _LIT8( KEmptyWidgetUid, "0x2001f47f" ); |
60 _LIT8( KEmptyWidgetUid, "0x2001f47f" ); |
59 _LIT8( KTemplateViewUID, "0x20026f50" ); |
61 _LIT8( KTemplateViewUID, "0x20026f50" ); |
60 |
62 |
61 const TInt KPSCategoryUid = 0x200286E3; |
63 const TInt KPSCategoryUid( 0x200286E3 ); |
62 const TInt KPSCrashCountKey = 1; |
64 const TInt KPSCrashCountKey( 1 ); |
63 const TInt KStabilityInterval = 60000000; // 1 minute |
65 const TInt KStabilityInterval( 60000000 ); // 1 minute |
64 const TInt KCrashRestoreThreshold = 3; |
66 const TInt KCrashRestoreThreshold( 3 ); |
65 |
67 |
66 // ============================ LOCAL FUNCTIONS =============================== |
68 // ============================ LOCAL FUNCTIONS =============================== |
67 // ----------------------------------------------------------------------------- |
69 // ----------------------------------------------------------------------------- |
68 // BuildTriggerL |
70 // BuildTriggerL |
69 // Builds a trigger node |
71 // Builds a trigger node |
312 // |
309 // |
313 void CXnViewManager::PropertyChangedL( const TUint32 aKey, const TInt aValue ) |
310 void CXnViewManager::PropertyChangedL( const TUint32 aKey, const TInt aValue ) |
314 { |
311 { |
315 if ( aKey == KPSStartupUiPhase && aValue == EStartupUiPhaseAllDone ) |
312 if ( aKey == KPSStartupUiPhase && aValue == EStartupUiPhaseAllDone ) |
316 { |
313 { |
317 if ( iRootData ) |
314 iUiStartupPhaseAllDone = ETrue; |
318 { |
315 |
319 iRootData->LoadRemainingViews(); |
316 iAppUiAdapter.ViewAdapter().ActivateContainerL( ActiveViewData() ); |
320 } |
317 } |
321 } |
318 |
322 } |
319 iUiStartupPhaseAllDone = ETrue; |
323 |
320 } |
|
321 |
|
322 // ----------------------------------------------------------------------------- |
|
323 // CXnViewManager::UiStartupPhaseAllDone() |
|
324 // |
|
325 // ----------------------------------------------------------------------------- |
|
326 // |
|
327 TBool CXnViewManager::UiStartupPhaseAllDone() const |
|
328 { |
|
329 return iUiStartupPhaseAllDone; |
|
330 } |
|
331 |
324 // ----------------------------------------------------------------------------- |
332 // ----------------------------------------------------------------------------- |
325 // CXnViewManager::ConstructL() |
333 // CXnViewManager::ConstructL() |
326 // 2nd phase constructor |
334 // 2nd phase constructor |
327 // ----------------------------------------------------------------------------- |
335 // ----------------------------------------------------------------------------- |
328 // |
336 // |
894 // |
904 // |
895 CXnViewData& CXnViewManager::NextViewData() const |
905 CXnViewData& CXnViewManager::NextViewData() const |
896 { |
906 { |
897 return iRootData->NextViewData(); |
907 return iRootData->NextViewData(); |
898 } |
908 } |
899 |
909 |
900 // ----------------------------------------------------------------------------- |
910 // ----------------------------------------------------------------------------- |
901 // CXnViewManager::ActivateNextViewL() |
911 // CXnViewManager::ActivateNextViewL() |
902 // Activates the next view |
912 // Activates the next view |
903 // ----------------------------------------------------------------------------- |
913 // ----------------------------------------------------------------------------- |
904 // |
914 // |
905 void CXnViewManager::ActivateNextViewL( TInt aEffectId ) |
915 void CXnViewManager::ActivateNextViewL( TInt /*aEffectId*/ ) |
906 { |
916 { |
907 CXnViewData& next( NextViewData() ); |
917 CXnViewData& next( NextViewData() ); |
908 |
918 |
909 if ( !next.Occupied() ) |
919 if ( !next.Occupied() ) |
910 { |
920 { |
911 if ( next.Load() == KErrNoMemory ) |
921 if ( next.Load() == KErrNoMemory ) |
912 { |
922 { |
913 next.ShowOutOfMemError(); |
923 next.ShowOutOfMemError(); |
|
924 |
|
925 return; |
914 } |
926 } |
915 } |
927 } |
916 |
928 |
917 // Activate view |
929 // Activate view |
918 if ( next.Occupied() && !next.Active() ) |
930 if ( next.Occupied() && !next.Active() ) |
919 { |
931 { |
920 if( aEffectId ) |
932 CXnControlAdapter* thisView( |
921 { |
933 ActiveViewData().ViewNode()->Control() ); |
922 iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL( |
934 |
923 aEffectId, iUiEngine->ViewManager()->ActiveViewData() ); |
935 CXnControlAdapter* nextView( |
924 } |
936 next.ViewNode()->Control() ); |
925 iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); |
937 |
|
938 GfxTransEffect::Register( thisView, KGfxContextActivateNextView ); |
|
939 GfxTransEffect::Register( nextView, KGfxContextActivateNextView ); |
|
940 |
|
941 TInt ret( GfxTransEffect::BeginGroup() ); |
|
942 |
|
943 CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); |
|
944 |
|
945 GfxTransEffect::Begin( bg, KGfxControlActionAppear ); |
|
946 |
|
947 GfxTransEffect::SetDemarcation( bg, bg->Position() ); |
|
948 GfxTransEffect::End( bg ); |
|
949 |
|
950 GfxTransEffect::Begin( thisView, KGfxControlActionDisappear ); |
|
951 |
|
952 iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); |
|
953 |
|
954 GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); |
|
955 GfxTransEffect::End( thisView ); |
|
956 |
|
957 GfxTransEffect::Begin( nextView, KGfxControlActionAppear ); |
|
958 GfxTransEffect::SetDemarcation( nextView, nextView->Position() ); |
|
959 GfxTransEffect::End( nextView ); |
|
960 |
|
961 GfxTransEffect::EndGroup( ret ); |
|
962 |
|
963 GfxTransEffect::Deregister( thisView ); |
|
964 GfxTransEffect::Deregister( nextView ); |
926 } |
965 } |
927 } |
966 } |
928 |
967 |
929 // ----------------------------------------------------------------------------- |
968 // ----------------------------------------------------------------------------- |
930 // CXnViewManager::ActivatePreviousViewL() |
969 // CXnViewManager::ActivatePreviousViewL() |
931 // Activates the previous view |
970 // Activates the previous view |
932 // ----------------------------------------------------------------------------- |
971 // ----------------------------------------------------------------------------- |
933 // |
972 // |
934 void CXnViewManager::ActivatePreviousViewL( TInt aEffectId ) |
973 void CXnViewManager::ActivatePreviousViewL( TInt /*aEffectId*/ ) |
935 { |
974 { |
936 CXnViewData& prev( PreviousViewData() ); |
975 CXnViewData& prev( PreviousViewData() ); |
937 |
976 |
938 if ( !prev.Occupied() ) |
977 if ( !prev.Occupied() ) |
939 { |
978 { |
940 if ( prev.Load() == KErrNoMemory ) |
979 if ( prev.Load() == KErrNoMemory ) |
941 { |
980 { |
942 prev.ShowOutOfMemError(); |
981 prev.ShowOutOfMemError(); |
|
982 |
|
983 return; |
943 } |
984 } |
944 } |
985 } |
945 |
986 |
946 // Activate view |
987 // Activate view |
947 if ( prev.Occupied() && !prev.Active() ) |
988 if ( prev.Occupied() && !prev.Active() ) |
948 { |
989 { |
949 if( aEffectId ) |
990 CXnControlAdapter* thisView( |
950 { |
991 ActiveViewData().ViewNode()->Control() ); |
951 iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL( |
992 |
952 aEffectId, iUiEngine->ViewManager()->ActiveViewData() ); |
993 CXnControlAdapter* prevView( |
953 } |
994 prev.ViewNode()->Control() ); |
|
995 |
|
996 GfxTransEffect::Register( thisView, KGfxContextActivatePrevView ); |
|
997 GfxTransEffect::Register( prevView, KGfxContextActivatePrevView ); |
|
998 |
|
999 TInt ret( GfxTransEffect::BeginGroup() ); |
|
1000 |
|
1001 CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); |
|
1002 |
|
1003 GfxTransEffect::Begin( bg, KGfxControlActionAppear ); |
|
1004 |
|
1005 GfxTransEffect::SetDemarcation( bg, bg->Position() ); |
|
1006 GfxTransEffect::End( bg ); |
|
1007 |
|
1008 GfxTransEffect::Begin( thisView, KGfxControlActionDisappear ); |
|
1009 |
954 iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); |
1010 iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ); |
|
1011 |
|
1012 GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); |
|
1013 GfxTransEffect::End( thisView ); |
|
1014 |
|
1015 GfxTransEffect::Begin( prevView, KGfxControlActionAppear ); |
|
1016 |
|
1017 GfxTransEffect::SetDemarcation( prevView, prevView->Position() ); |
|
1018 GfxTransEffect::End( prevView ); |
|
1019 |
|
1020 GfxTransEffect::EndGroup( ret ); |
|
1021 |
|
1022 GfxTransEffect::Deregister( thisView ); |
|
1023 GfxTransEffect::Deregister( prevView ); |
955 } |
1024 } |
956 } |
1025 } |
957 |
1026 |
958 // ----------------------------------------------------------------------------- |
1027 // ----------------------------------------------------------------------------- |
959 // CXnViewManager::AddViewL() |
1028 // CXnViewManager::AddViewL() |
1371 // CXnViewManager::NotifyContainerChangedL() |
1440 // CXnViewManager::NotifyContainerChangedL() |
1372 // Notifies container is changed, this is called always by CXnViewAdapter |
1441 // Notifies container is changed, this is called always by CXnViewAdapter |
1373 // ----------------------------------------------------------------------------- |
1442 // ----------------------------------------------------------------------------- |
1374 void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate ) |
1443 void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate ) |
1375 { |
1444 { |
1376 #ifdef _XN_PERFORMANCE_TEST_ |
|
1377 RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - start" ) ); |
|
1378 #endif //_XN_PERFORMANCE_TEST_ |
|
1379 |
|
1380 CXnViewData& viewToDeactivate( ActiveViewData() ); |
1445 CXnViewData& viewToDeactivate( ActiveViewData() ); |
1381 |
1446 |
1382 if ( &aViewToActivate != &viewToDeactivate ) |
1447 if ( &aViewToActivate != &viewToDeactivate ) |
1383 { |
1448 { |
1384 NotifyViewDeactivatedL( viewToDeactivate ); |
1449 NotifyViewDeactivatedL( viewToDeactivate ); |
1385 |
1450 |
1386 viewToDeactivate.SetActive( EFalse ); |
1451 viewToDeactivate.SetActive( EFalse ); |
1387 aViewToActivate.SetActive( ETrue ); |
1452 aViewToActivate.SetActive( ETrue ); |
1388 |
1453 |
1389 iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); |
1454 iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); |
1390 |
1455 |
1391 // Cache update is needed after view activation |
1456 // Cache update is needed after view activation |
1392 UpdateCachesL(); |
1457 UpdateCachesL(); |
1393 UpdateWallpaperL( viewToDeactivate, aViewToActivate ); |
|
1394 } |
1458 } |
1395 else |
1459 else |
1396 { |
1460 { |
1397 // Activate first view |
1461 // Activate first view |
1398 aViewToActivate.SetActive( ETrue ); |
1462 aViewToActivate.SetActive( ETrue ); |
1399 |
1463 |
1400 // Cache update is needed after view activation |
1464 // Cache update is needed after view activation |
1401 UpdateCachesL(); |
1465 UpdateCachesL(); |
|
1466 |
|
1467 // Schedule remaining views loading |
|
1468 iRootData->LoadRemainingViews(); |
1402 } |
1469 } |
1403 |
1470 |
1404 NotifyViewActivatedL( aViewToActivate ); |
1471 NotifyViewActivatedL( aViewToActivate ); |
1405 UpdatePageManagementInformationL(); |
1472 UpdatePageManagementInformationL(); |
1406 |
|
1407 #ifdef _XN_PERFORMANCE_TEST_ |
|
1408 RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - end" ) ); |
|
1409 #endif //_XN_PERFORMANCE_TEST_ |
|
1410 } |
1473 } |
1411 |
1474 |
1412 // ----------------------------------------------------------------------------- |
1475 // ----------------------------------------------------------------------------- |
1413 // CXnViewManager::NotifyViewActivatedL() |
1476 // CXnViewManager::NotifyViewActivatedL() |
1414 // Notifies view is activated |
1477 // Notifies view is activated |