phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
branchRCL_3
changeset 4 24062c24fe38
parent 3 8871b09be73b
child 5 2a26698d78ba
equal deleted inserted replaced
3:8871b09be73b 4:24062c24fe38
    71 #include "mphoneviewcustomization.h"
    71 #include "mphoneviewcustomization.h"
    72 #include "tphonecmdparamcustomdialer.h"
    72 #include "tphonecmdparamcustomdialer.h"
    73 #include "tphonecmdparampointer.h"
    73 #include "tphonecmdparampointer.h"
    74 #include "dialer.hrh"
    74 #include "dialer.hrh"
    75 #include "phoneui.hrh"
    75 #include "phoneui.hrh"
       
    76 #include "musmanager.h"
    76 #include <apgtask.h>
    77 #include <apgtask.h>
    77 #include <apgwgnam.h>
    78 #include <apgwgnam.h>
    78 #include <apacmdln.h>
    79 #include <apacmdln.h>
    79 #include <coedef.h>  // TKeyResponse
    80 #include <coedef.h>  // TKeyResponse
    80 #include <eikenv.h>
    81 #include <eikenv.h>
   131 #include <akntranseffect.h>
   132 #include <akntranseffect.h>
   132 
   133 
   133 #include <gslauncher.h> // Call Settings launch.
   134 #include <gslauncher.h> // Call Settings launch.
   134 
   135 
   135 #include <dialingextensioninterface.h>
   136 #include <dialingextensioninterface.h>
       
   137 #include <easydialingcommands.hrh>
   136 
   138 
   137 // Kastor effect IDs, aknskincontent/101f84b9.sel
   139 // Kastor effect IDs, aknskincontent/101f84b9.sel
   138 const TInt KTouchDialerOpenEffect  = 1505;
   140 const TInt KTouchDialerOpenEffect  = 1505;
   139 const TInt KTouchDialerCloseEffect = 1506;
   141 const TInt KTouchDialerCloseEffect = 1506;
   140 
   142 
   146 // might leave.
   148 // might leave.
   147 // ---------------------------------------------------------------------------
   149 // ---------------------------------------------------------------------------
   148 //
   150 //
   149 CPhoneViewController::CPhoneViewController() :
   151 CPhoneViewController::CPhoneViewController() :
   150     iEikEnv( *CEikonEnv::Static() ),
   152     iEikEnv( *CEikonEnv::Static() ),
   151     iNeedToSendToBackground( EFalse ),
   153     iNeedToReturnToForegroundAppAfterCall( EFalse ),
   152     iHelpCommand( KINCAL_HLP_CALL_HANDLING ),
   154     iHelpCommand( KINCAL_HLP_CALL_HANDLING ),
   153     iBlockingDialogIsDisplayed( EFalse ),
   155     iBlockingDialogIsDisplayed( EFalse ),
   154     iIdleUid( KErrNotFound ),
   156     iIdleUid( KErrNotFound ),
   155     iFetchContent( KNullDesC ),
   157     iFetchContent( KNullDesC ),
   156     iEffectOngoing( EFalse ),
   158     iEffectOngoing( EFalse ),
   635             {
   637             {
   636             DisableKeyLock();
   638             DisableKeyLock();
   637             }
   639             }
   638             break;
   640             break;
   639 
   641 
       
   642         case EPhoneViewLaunchMultimediaSharing:
       
   643             {
       
   644             LaunchMultimediaSharingL();
       
   645             }
       
   646             break;
       
   647 
   640         default:
   648         default:
   641             __PHONELOG( EBasic, EPhonePhoneapp,
   649             __PHONELOG( EBasic, EPhonePhoneapp,
   642                 "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !");
   650                 "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !");
   643             break;
   651             break;
   644         }
   652         }
   833                 BringAppToForeground( aCommandParam );
   841                 BringAppToForeground( aCommandParam );
   834                 }
   842                 }
   835             }
   843             }
   836             break;
   844             break;
   837 
   845 
   838         case EPhoneViewSetNeedToSendToBackgroundStatus:
   846         case EPhoneViewSetNeedToReturnToForegroundAppStatus:
   839             SetNeedToSendToBackground( aCommandParam );
   847             SetNeedToReturnToForegroundAppAfterCall( aCommandParam );
   840             break;
   848             break;
   841 
   849 
   842        case EPhoneViewSetBlockingDialogStatus:
   850        case EPhoneViewSetBlockingDialogStatus:
   843             {
   851             {
   844             TPhoneCmdParamBoolean* booleanParam =
   852             TPhoneCmdParamBoolean* booleanParam =
  1190         case EPhoneViewGetEasyDialingCbaId:
  1198         case EPhoneViewGetEasyDialingCbaId:
  1191                 {
  1199                 {
  1192                 iEasyDialingController->ExecuteCommandL( aCmdId, aCommandParam );
  1200                 iEasyDialingController->ExecuteCommandL( aCmdId, aCommandParam );
  1193                 }
  1201                 }
  1194             break;
  1202             break;
  1195 
  1203         case EPhoneViewSetConferenceAndWaitingVideo:
       
  1204             {
       
  1205             TPhoneCmdParamBoolean*  booleanParam =
       
  1206                             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
       
  1207             iMenuController->SetConferenceAndWaitingVideoFlag( booleanParam->Boolean() );
       
  1208 			}
       
  1209             break;
  1196         default:
  1210         default:
  1197             __PHONELOG( EBasic, EPhonePhoneapp,
  1211             __PHONELOG( EBasic, EPhonePhoneapp,
  1198              "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
  1212              "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
  1199             break;
  1213             break;
  1200         }
  1214         }
  1464             {
  1478             {
  1465             iBubbleWrapper->SetNumberEntryChangedCallBack( aCommandParam );
  1479             iBubbleWrapper->SetNumberEntryChangedCallBack( aCommandParam );
  1466             break;
  1480             break;
  1467             }
  1481             }
  1468         case EPhoneViewGetSingleItemFetchType:
  1482         case EPhoneViewGetSingleItemFetchType:
       
  1483             {
  1469             static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( SingleItemFetchType() );
  1484             static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( SingleItemFetchType() );
  1470             break;
  1485             break;
  1471 
  1486             }
  1472         case EPhoneViewSetPhoneCustomization:
  1487         case EPhoneViewSetPhoneCustomization:
  1473             {
  1488             {
  1474             TPhoneCmdParamPointer* pointerParam =
  1489             TPhoneCmdParamPointer* pointerParam =
  1475                 static_cast<TPhoneCmdParamPointer*>( aCommandParam );
  1490                 static_cast<TPhoneCmdParamPointer*>( aCommandParam );
  1476             MPhoneCustomization* phoneCustomization =
  1491             MPhoneCustomization* phoneCustomization =
  1571             viewResponse = iBubbleWrapper->IsNENumericMode() ?
  1586             viewResponse = iBubbleWrapper->IsNENumericMode() ?
  1572                 EPhoneViewResponseSuccess :
  1587                 EPhoneViewResponseSuccess :
  1573                 EPhoneViewResponseFailed;
  1588                 EPhoneViewResponseFailed;
  1574             break;
  1589             break;
  1575 
  1590 
  1576         case EPhoneViewGetNeedToSendToBackgroundStatus:
  1591         case EPhoneViewGetNeedToReturnToForegroundAppStatus:
  1577             viewResponse = NeedToSendToBackground() ?
  1592             viewResponse = GetNeedToReturnToForegroundAppAfterCall() ?
  1578                 EPhoneViewResponseSuccess :
  1593                 EPhoneViewResponseSuccess :
  1579                 EPhoneViewResponseFailed;
  1594                 EPhoneViewResponseFailed;
  1580             break;
  1595             break;
  1581 
  1596 
  1582         case EPhoneViewGetTopApplicationIsDisplayedStatus:
  1597         case EPhoneViewGetTopApplicationIsDisplayedStatus:
  1735         case EPhoneViewSetDialerControlVisible:
  1750         case EPhoneViewSetDialerControlVisible:
  1736             {
  1751             {
  1737             // If dialer was not active and needtosendback is false
  1752             // If dialer was not active and needtosendback is false
  1738             // then check if dialer view is to be opened.
  1753             // then check if dialer view is to be opened.
  1739             if ( !iDialerActive &&
  1754             if ( !iDialerActive &&
  1740                  !iNeedToSendToBackground &&
  1755                  !iNeedToReturnToForegroundAppAfterCall &&
  1741                  iPhoneView->PhoneAppViewToDialer() )
  1756                  iPhoneView->PhoneAppViewToDialer() )
  1742                 {
  1757                 {
  1743                 SetControltoDialerL();
  1758                 SetControltoDialerL();
  1744                 // Reset flag.
  1759                 // Reset flag.
  1745                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  1760                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  2187 // CPhoneViewController::NumberEntryStateChanged
  2202 // CPhoneViewController::NumberEntryStateChanged
  2188 // ---------------------------------------------------------------------------
  2203 // ---------------------------------------------------------------------------
  2189 //
  2204 //
  2190 void CPhoneViewController::NumberEntryStateChanged( TBool aEntryHasText )
  2205 void CPhoneViewController::NumberEntryStateChanged( TBool aEntryHasText )
  2191     {
  2206     {
       
  2207     iMenuController->SetNumberEntryEmptyFlag( !aEntryHasText );
  2192     iBubbleWrapper->HandleNumberEntryChanged();
  2208     iBubbleWrapper->HandleNumberEntryChanged();
  2193     iMenuController->SetNumberEntryEmptyFlag( !aEntryHasText );
       
  2194     ExecuteCommandL( EPhoneViewUpdateToolbar );
  2209     ExecuteCommandL( EPhoneViewUpdateToolbar );
  2195     }
  2210     }
  2196 
  2211 
  2197 // ---------------------------------------------------------------------------
  2212 // ---------------------------------------------------------------------------
  2198 // CPhoneViewController::GetBlockingDialogIsDisplayed
  2213 // CPhoneViewController::GetBlockingDialogIsDisplayed
  2220         {
  2235         {
  2221         TPhoneCmdParamBoolean* booleanValue =
  2236         TPhoneCmdParamBoolean* booleanValue =
  2222             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  2237             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  2223         booleanValue->SetBoolean( iPhoneView->IsSecurityMode() );
  2238         booleanValue->SetBoolean( iPhoneView->IsSecurityMode() );
  2224         }
  2239         }
  2225     }
       
  2226 
       
  2227 // ---------------------------------------------------------------------------
       
  2228 // CPhoneViewController::SetNeedToSendToBackground
       
  2229 // ---------------------------------------------------------------------------
       
  2230 //
       
  2231 void CPhoneViewController::SetNeedToSendToBackground(
       
  2232     TPhoneCommandParam* aCommandParam )
       
  2233     {
       
  2234     TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
       
  2235         aCommandParam );
       
  2236 
       
  2237     iNeedToSendToBackground = booleanParam->Boolean();
       
  2238     __PHONELOG1( EBasic, EPhoneUIView,
       
  2239         "CPhoneViewController::SetNeedToSendToBackground(%d)",
       
  2240         iNeedToSendToBackground );
       
  2241     }
       
  2242 
       
  2243 // ---------------------------------------------------------------------------
       
  2244 // CPhoneViewController::NeedToSendToBackground
       
  2245 // ---------------------------------------------------------------------------
       
  2246 //
       
  2247 TBool CPhoneViewController::NeedToSendToBackground()
       
  2248     {
       
  2249     return iNeedToSendToBackground;
       
  2250     }
  2240     }
  2251 
  2241 
  2252 // ---------------------------------------------------------------------------
  2242 // ---------------------------------------------------------------------------
  2253 // CPhoneViewController::SendToBackgroundL
  2243 // CPhoneViewController::SendToBackgroundL
  2254 // ---------------------------------------------------------------------------
  2244 // ---------------------------------------------------------------------------
  2299                                     ESgcMoveAppToBackground );
  2289                                     ESgcMoveAppToBackground );
  2300             }
  2290             }
  2301         }
  2291         }
  2302 
  2292 
  2303     // Clear the send to background flag
  2293     // Clear the send to background flag
  2304     iNeedToSendToBackground = EFalse;
  2294     iNeedToReturnToForegroundAppAfterCall = EFalse;
  2305     }
  2295     }
  2306 
  2296 
  2307 // ---------------------------------------------------------------------------
  2297 // ---------------------------------------------------------------------------
  2308 // CPhoneViewController::FindAppByWgIDL
  2298 // CPhoneViewController::FindAppByWgIDL
  2309 // ---------------------------------------------------------------------------
  2299 // ---------------------------------------------------------------------------
  2588     {
  2578     {
  2589     if ( !iApaLsSession.Handle() )
  2579     if ( !iApaLsSession.Handle() )
  2590         {
  2580         {
  2591         User::LeaveIfError( iApaLsSession.Connect() );
  2581         User::LeaveIfError( iApaLsSession.Connect() );
  2592         }
  2582         }
       
  2583     }
       
  2584 
       
  2585 // ---------------------------------------------------------------------------
       
  2586 // CPhoneViewController::LaunchMultimediaSharingL (static)
       
  2587 // ---------------------------------------------------------------------------
       
  2588 //
       
  2589 void CPhoneViewController::LaunchMultimediaSharingL()
       
  2590     {
       
  2591     CMusManager* manager = CMusManager::NewLC();
       
  2592     manager->StartApplicationL( MultimediaSharing::EMusLiveVideo );
       
  2593     CleanupStack::PopAndDestroy( manager );
  2593     }
  2594     }
  2594 
  2595 
  2595 // ---------------------------------------------------------------------------
  2596 // ---------------------------------------------------------------------------
  2596 // CPhoneViewController::LaunchApplicationL
  2597 // CPhoneViewController::LaunchApplicationL
  2597 // ---------------------------------------------------------------------------
  2598 // ---------------------------------------------------------------------------
  3028         static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  3029         static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  3029 
  3030 
  3030     // Indicate that the contact operation is blocking key
  3031     // Indicate that the contact operation is blocking key
  3031     // events from the Phone
  3032     // events from the Phone
  3032     iBlockingDialogIsDisplayed = ETrue;
  3033     iBlockingDialogIsDisplayed = ETrue;
  3033     TBool numberAssigned;
  3034     TBool numberAssigned = EFalse;
  3034     TRAPD( err,
  3035     TRAP_IGNORE( numberAssigned = AssignSpeedDialLocationL(locationParam->Integer()) );
  3035         numberAssigned = AssignSpeedDialLocationL(
       
  3036         locationParam->Integer()))
       
  3037 
  3036 
  3038     // Reset the flag
  3037     // Reset the flag
  3039     iBlockingDialogIsDisplayed = EFalse;
  3038     iBlockingDialogIsDisplayed = EFalse;
  3040 
  3039 
  3041     return err ? EFalse : numberAssigned;
  3040     return numberAssigned;
  3042     }
  3041     }
  3043 
  3042 
  3044 // ---------------------------------------------------------------------------
  3043 // ---------------------------------------------------------------------------
  3045 // CPhoneViewController::AssignSpeedDialLocationL
  3044 // CPhoneViewController::AssignSpeedDialLocationL
  3046 // ---------------------------------------------------------------------------
  3045 // ---------------------------------------------------------------------------
  3700         if ( currentLayout == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
  3699         if ( currentLayout == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
  3701              currentLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
  3700              currentLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
  3702             {
  3701             {
  3703             SwapEmptyIndicatorPaneInSecureStateL( EFalse );
  3702             SwapEmptyIndicatorPaneInSecureStateL( EFalse );
  3704 
  3703 
  3705             iStatusPane->NaviPane().Pop();
  3704             //  do Pop for navipane
       
  3705             iAudioController->DeactivateVolumeControl();
  3706 
  3706 
  3707             if ( !Layout_Meta_Data::IsLandscapeOrientation() )
  3707             if ( !Layout_Meta_Data::IsLandscapeOrientation() )
  3708                 {
  3708                 {
  3709                 iStatusPane->StatusPane().SwitchLayoutL
  3709                 iStatusPane->StatusPane().SwitchLayoutL
  3710                         ( R_AVKON_STATUS_PANE_LAYOUT_IDLE );
  3710                         ( R_AVKON_STATUS_PANE_LAYOUT_IDLE );
  3854 void CPhoneViewController::SetControltoCallHandlingL()
  3854 void CPhoneViewController::SetControltoCallHandlingL()
  3855     {
  3855     {
  3856     __PHONELOG1( EBasic, EPhoneUIView,
  3856     __PHONELOG1( EBasic, EPhoneUIView,
  3857         "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
  3857         "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
  3858 
  3858 
  3859     // If securitymode or emergency call not show toolbar
  3859     // Do not show toolbar if securitymode or emergency call active
  3860     if ( !iPhoneView->IsSecurityMode() && 
  3860     if ( !iPhoneView->IsSecurityMode() && 
  3861      !iIncallIndicator->IsEmergencyCall() )
  3861          !iIncallIndicator->IsEmergencyCall() )
  3862      {
  3862         {
  3863          iToolbarController->ShowToolbar();
  3863         iToolbarController->ShowToolbar();
  3864      }
  3864         }
  3865     if ( iDialerActive )
  3865     if ( iDialerActive )
  3866         {
  3866         {
  3867         iDialerActive = EFalse;
  3867         iDialerActive = EFalse;
  3868         // Hide dialer view. Do this before resizing status pane to prevent unnecessary
  3868         // Hide dialer view. Do this before resizing status pane to prevent unnecessary
  3869         // resizing of dialer components. Hiding dialer view already before showing
  3869         // resizing of dialer components. Hiding dialer view already before showing
  4018                 curController != iDtmfDialerController );
  4018                 curController != iDtmfDialerController );
  4019         }
  4019         }
  4020     return ret;
  4020     return ret;
  4021     }
  4021     }
  4022 
  4022 
       
  4023 // ---------------------------------------------------------------------------
       
  4024 // CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall
       
  4025 // ---------------------------------------------------------------------------
       
  4026 //
       
  4027 void CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall(
       
  4028     TPhoneCommandParam* aCommandParam )
       
  4029     {
       
  4030     TPhoneCmdParamBoolean* booleanParam = static_cast<TPhoneCmdParamBoolean*>(
       
  4031         aCommandParam );
       
  4032 
       
  4033     iNeedToReturnToForegroundAppAfterCall = booleanParam->Boolean();
       
  4034     __PHONELOG1( EBasic, EPhoneUIView,
       
  4035         "CPhoneViewController::SetNeedToReturnToForegroundAppAfterCall(%d)",
       
  4036         iNeedToReturnToForegroundAppAfterCall );
       
  4037     }
       
  4038 
       
  4039 // ---------------------------------------------------------------------------
       
  4040 // CPhoneViewController::GetNeedToReturnToForegroundAppAfterCall
       
  4041 // ---------------------------------------------------------------------------
       
  4042 //
       
  4043 TBool CPhoneViewController::GetNeedToReturnToForegroundAppAfterCall() const
       
  4044     {
       
  4045     return iNeedToReturnToForegroundAppAfterCall;
       
  4046     }
       
  4047 
  4023 // End of File
  4048 // End of File