phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
branchRCL_3
changeset 25 91c2fb4b78df
parent 19 544e34b3255a
child 31 ba54057fe027
equal deleted inserted replaced
19:544e34b3255a 25:91c2fb4b78df
   135 
   135 
   136 #include <dialingextensioninterface.h>
   136 #include <dialingextensioninterface.h>
   137 #include <easydialingcommands.hrh>
   137 #include <easydialingcommands.hrh>
   138 
   138 
   139 // Kastor effect IDs, aknskincontent/101f84b9.sel
   139 // Kastor effect IDs, aknskincontent/101f84b9.sel
       
   140 // These effects cannot be used for internal transitions (Call UI<->Dialer)
   140 const TInt KTouchDialerOpenEffect  = 3;
   141 const TInt KTouchDialerOpenEffect  = 3;
   141 const TInt KTouchDialerCloseEffect = 5;
   142 const TInt KTouchDialerCloseEffect = 5;
   142 
   143 
   143 // ================= MEMBER FUNCTIONS =======================
   144 // ================= MEMBER FUNCTIONS =======================
   144 
   145 
  1398             {
  1399             {
  1399             if ( iDialer )
  1400             if ( iDialer )
  1400                 {
  1401                 {
  1401                 TPhoneTransEffectType type =
  1402                 TPhoneTransEffectType type =
  1402                     static_cast<TPhoneCmdParamTransEffect*>( aCommandParam )->Type();
  1403                     static_cast<TPhoneCmdParamTransEffect*>( aCommandParam )->Type();
  1403                 TBool isForeground = iAppui->IsForeground();
  1404                 if ( CanTransEffectBeUsed( type ) )
  1404 
       
  1405                 // Check whether the idle is on foreground
       
  1406                 TBool idleInFore = ForegroundApplicationWindowGroupId() ==  IdleWindowGroupId() ?
       
  1407                         ETrue : EFalse;
       
  1408                 
       
  1409                 if ( ( isForeground && // Newer run effect if not at front
       
  1410                      ( ( type == EPhoneTransEffectDialerCreate && !iDialerActive ) ||
       
  1411                        ( type == EPhoneTransEffectDialerOpen && !iDialerActive &&
       
  1412                          iBubbleWrapper->IsNumberEntryUsed() )) ||
       
  1413                        ( type == EPhoneTransEffectDialerClose && iDialerActive ) ) )
       
  1414                     {
  1405                     {
  1415                     HandleTransitionEffect( type );
  1406                     HandleTransitionEffect( type,
  1416                     }
  1407                         static_cast<TPhoneCmdParamTransEffect*>( aCommandParam )->AppUid());
  1417                 // In case transition is from idle to dialer show transition effects as well.                 
       
  1418                  else if ( idleInFore && !iDialerActive &&
       
  1419                           type == EPhoneTransEffectDialerOpen )
       
  1420                     {
       
  1421                     HandleTransitionEffect( type );
       
  1422                     }
  1408                     }
  1423                 }
  1409                 }
  1424             break;
  1410             break;
  1425             }
  1411             }
  1426 
  1412 
  1613 
  1599 
  1614     // Dialer handles these commands.
  1600     // Dialer handles these commands.
  1615     // ** TODO Here we need just to flag if functionality creates blocking dialog.
  1601     // ** TODO Here we need just to flag if functionality creates blocking dialog.
  1616         case EPhoneDialerCmdLog:
  1602         case EPhoneDialerCmdLog:
  1617             {
  1603             {
       
  1604             BeginTransEffectForAppStartFromDialerLC( LogsUiCmdStarterConsts::KLogsUID3 );
  1618             LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView());
  1605             LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView());
  1619             }
  1606             EndTransEffect();
  1620             break;
  1607             }
       
  1608             break;
       
  1609             
       
  1610         case EPhoneDialerCmdContacts:
       
  1611             {
       
  1612             // Launch Phonebook application
       
  1613             TPhoneCmdParamAppInfo appInfoParam;
       
  1614             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
       
  1615             BeginTransEffectForAppStartFromDialerLC( appInfoParam.AppUid() );
       
  1616             ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
       
  1617             EndTransEffect();
       
  1618             }
       
  1619             break;           
  1621 
  1620 
  1622         case EPhoneDialerCmdSpeedDial:
  1621         case EPhoneDialerCmdSpeedDial:
  1623             {
  1622             {
  1624             // Launch speeddial application.
  1623             // Launch speeddial application.
  1625             TPhoneCmdParamAppInfo appInfoParam;
  1624             TPhoneCmdParamAppInfo appInfoParam;
  3710 // ---------------------------------------------------------------------------
  3709 // ---------------------------------------------------------------------------
  3711 // CPhoneViewController::HandleTransitionEffect
  3710 // CPhoneViewController::HandleTransitionEffect
  3712 // ---------------------------------------------------------------------------
  3711 // ---------------------------------------------------------------------------
  3713 //
  3712 //
  3714 void CPhoneViewController::HandleTransitionEffect(
  3713 void CPhoneViewController::HandleTransitionEffect(
  3715     TPhoneTransEffectType aType )
  3714     TPhoneTransEffectType aType, const TUid& aAppUidEffectParam )
  3716     {
  3715     {
  3717     __LOGMETHODSTARTEND(EPhoneUIView,
  3716     __LOGMETHODSTARTEND(EPhoneUIView,
  3718         "CPhoneViewController::HandleTransitionEffect()" );
  3717         "CPhoneViewController::HandleTransitionEffect()" );
  3719 
  3718 
  3720     switch ( aType )
  3719    switch ( aType )
  3721         {
  3720         {
  3722         case EPhoneTransEffectDialerCreate:
  3721         case EPhoneTransEffectDialerCreate:
  3723         case EPhoneTransEffectDialerOpen:
  3722         case EPhoneTransEffectDialerOpen:
  3724             {
  3723             {
  3725             GfxTransEffect::BeginFullScreen(
  3724             GfxTransEffect::BeginFullScreen(
  3726                 KTouchDialerOpenEffect,
  3725                 KTouchDialerOpenEffect,
  3727                 TRect(),
  3726                 TRect(),
  3728                 AknTransEffect::EParameterType,
  3727                 AknTransEffect::EParameterType,
  3729                 AknTransEffect::GfxTransParam( KUidPhoneApplication ) );
  3728                 AknTransEffect::GfxTransParam( KUidPhoneApplication,
       
  3729                         AknTransEffect::TParameter::EActivateExplicitCancel ) );
  3730             iEffectOngoing = ETrue;
  3730             iEffectOngoing = ETrue;
  3731             break;
  3731             break;
  3732             }
  3732             }
  3733         case EPhoneTransEffectDialerClose:
  3733         case EPhoneTransEffectDialerClose:
  3734             {
  3734             {
  3735             GfxTransEffect::BeginFullScreen(
  3735             GfxTransEffect::BeginFullScreen(
  3736                 KTouchDialerCloseEffect,
  3736                 KTouchDialerCloseEffect,
  3737                 TRect(),
  3737                 TRect(),
  3738                 AknTransEffect::EParameterType,
  3738                 AknTransEffect::EParameterType,
  3739                 AknTransEffect::GfxTransParam( KUidPhoneApplication ) );
  3739                 AknTransEffect::GfxTransParam( KUidPhoneApplication,
       
  3740                         AknTransEffect::TParameter::EActivateExplicitCancel ) );
  3740             iEffectOngoing = ETrue;
  3741             iEffectOngoing = ETrue;
  3741             break;
  3742             break;
  3742             }
  3743             }
       
  3744         case EPhoneTransEffectAppStartFromDialer:
       
  3745             {
       
  3746             GfxTransEffect::BeginFullScreen(
       
  3747                 AknTransEffect::EApplicationStart, 
       
  3748                 TRect(), 
       
  3749                 AknTransEffect::EParameterType, 
       
  3750                 AknTransEffect::GfxTransParam( aAppUidEffectParam,
       
  3751                     AknTransEffect::TParameter::EActivateExplicitCancel ) );
       
  3752             iEffectOngoing = ETrue;
       
  3753             }
       
  3754             break;
  3743         case EPhoneTransEffectStop:
  3755         case EPhoneTransEffectStop:
  3744             {
  3756             {
  3745             if ( iEffectOngoing )
  3757             if ( iEffectOngoing )
  3746                 {
  3758                 {
  3747                 GfxTransEffect::EndFullScreen();
  3759                 GfxTransEffect::EndFullScreen();
  3969                 curController != iDtmfDialerController );
  3981                 curController != iDtmfDialerController );
  3970         }
  3982         }
  3971     return ret;
  3983     return ret;
  3972     }
  3984     }
  3973 
  3985 
       
  3986 // -----------------------------------------------------------
       
  3987 // CPhoneViewController::CanTransEffectBeUsed
       
  3988 // -----------------------------------------------------------
       
  3989 //
       
  3990 TBool CPhoneViewController::CanTransEffectBeUsed( 
       
  3991     TPhoneTransEffectType aType )
       
  3992     {
       
  3993     TBool okToUseEffect( EFalse );
       
  3994     
       
  3995     TBool isForeground = iAppui->IsForeground();
       
  3996     // Check whether the idle is on foreground
       
  3997     TBool idleInFore = ForegroundApplicationWindowGroupId() ==  IdleWindowGroupId() ?
       
  3998             ETrue : EFalse;
       
  3999     
       
  4000     if ( isForeground && // Newer run effect if not at front
       
  4001          ( ( aType == EPhoneTransEffectDialerCreate && !iDialerActive ) ||
       
  4002            ( aType == EPhoneTransEffectDialerOpen && !iDialerActive &&
       
  4003              iBubbleWrapper->IsNumberEntryUsed() ) ||
       
  4004            ( aType == EPhoneTransEffectDialerClose && iDialerActive ) ) )
       
  4005         {
       
  4006         okToUseEffect = ETrue;
       
  4007         }
       
  4008     // In case transition is from idle to dialer show transition effects as well.                 
       
  4009     else if ( idleInFore && !iDialerActive &&
       
  4010               aType == EPhoneTransEffectDialerOpen )
       
  4011         {
       
  4012         okToUseEffect = ETrue;
       
  4013         }
       
  4014     else if ( isForeground && iDialerActive && 
       
  4015               aType == EPhoneTransEffectAppStartFromDialer )
       
  4016         {
       
  4017         okToUseEffect = ETrue;
       
  4018         }
       
  4019     
       
  4020     return okToUseEffect;
       
  4021     }
       
  4022 
       
  4023 // -----------------------------------------------------------
       
  4024 // CPhoneViewController::BeginTransEffectForAppStartFromDialerLC
       
  4025 // -----------------------------------------------------------
       
  4026 //
       
  4027 void CPhoneViewController::BeginTransEffectForAppStartFromDialerLC( 
       
  4028     const TUid& aAppUid )
       
  4029     {
       
  4030     TPhoneCmdParamTransEffect effectParam;
       
  4031     effectParam.SetType( EPhoneTransEffectAppStartFromDialer );
       
  4032     effectParam.SetAppUid( aAppUid );
       
  4033     
       
  4034     ExecuteCommand( EPhoneViewBeginTransEffect,  &effectParam );
       
  4035 
       
  4036     TCleanupItem operation( EffectCleanup, this );
       
  4037     CleanupStack::PushL( operation );
       
  4038     }
       
  4039 
       
  4040 // -----------------------------------------------------------
       
  4041 // CPhoneViewController::EndTransEffect
       
  4042 // -----------------------------------------------------------
       
  4043 //
       
  4044 void CPhoneViewController::EndTransEffect()
       
  4045     {
       
  4046     CleanupStack::PopAndDestroy(); // Call EffectCleanup
       
  4047     }
       
  4048 
       
  4049 // -----------------------------------------------------------------------------
       
  4050 // CPhoneViewController::EffectCleanup
       
  4051 // -----------------------------------------------------------------------------
       
  4052 //
       
  4053 void CPhoneViewController::EffectCleanup(TAny* aThis )
       
  4054     {
       
  4055     TPhoneCmdParamTransEffect effectParam;
       
  4056     effectParam.SetType( EPhoneTransEffectStop );
       
  4057 
       
  4058     static_cast<CPhoneViewController*>( aThis )->ExecuteCommand(
       
  4059         EPhoneViewEndTransEffect, &effectParam );
       
  4060     }
       
  4061 
  3974 // ---------------------------------------------------------------------------
  4062 // ---------------------------------------------------------------------------
  3975 // CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall
  4063 // CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall
  3976 // ---------------------------------------------------------------------------
  4064 // ---------------------------------------------------------------------------
  3977 //
  4065 //
  3978 void CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall(
  4066 void CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall(