phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
branchRCL_3
changeset 22 94dc1107e8b2
parent 20 3c221667e687
child 23 40a3f856b14d
equal deleted inserted replaced
20:3c221667e687 22:94dc1107e8b2
   185     iStatusPane->StatusPane().SetDimmed( iSecurityMode );
   185     iStatusPane->StatusPane().SetDimmed( iSecurityMode );
   186 
   186 
   187     iAppui = (CAknAppUi*)iEikEnv.EikAppUi();
   187     iAppui = (CAknAppUi*)iEikEnv.EikAppUi();
   188     iCba = iEikEnv.AppUiFactory()->Cba();
   188     iCba = iEikEnv.AppUiFactory()->Cba();
   189 
   189 
   190 	iPhoneView = CPhoneView::NewL( aRect, *iCba, this );
   190     iPhoneView = CPhoneView::NewL( aRect, *iCba, this );
   191 
   191 
   192     iBubbleWrapper = CPhoneBubbleWrapper::NewL( iPhoneView, aRect  );
   192     iBubbleWrapper = CPhoneBubbleWrapper::NewL( iPhoneView, aRect  );
   193 
   193 
   194     iPhoneView->SetControl( iBubbleWrapper->Control() );
   194     iPhoneView->SetControl( iBubbleWrapper->Control() );
   195     iPhoneView->ActivateL(); // We're ready to activate view after the bubble is initialized
   195     iPhoneView->ActivateL(); // We're ready to activate view after the bubble is initialized
   222         this,
   222         this,
   223         iEikEnv.WsSession(),
   223         iEikEnv.WsSession(),
   224         iEikEnv.WsSession().FindWindowGroupIdentifier( 0, KPhoneEikonServer ) );
   224         iEikEnv.WsSession().FindWindowGroupIdentifier( 0, KPhoneEikonServer ) );
   225 
   225 
   226     CCoeEnv* coeEnv = CCoeEnv::Static();
   226     CCoeEnv* coeEnv = CCoeEnv::Static();
   227     
   227 
   228     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
   228     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
   229         {
   229         {
   230         iButtonsController = CPhoneButtonsController::NewL( iBubbleWrapper->TouchPane() );
   230         iButtonsController = CPhoneButtonsController::NewL( iBubbleWrapper->TouchPane() );
   231         iToolbarController = CPhoneToolbarController::NewL( *coeEnv );
   231         iToolbarController = CPhoneToolbarController::NewL( *coeEnv );
   232         }
   232         }
   247         iBubbleWrapper->SetNumberEntry( iDialer->NumberEntry() );
   247         iBubbleWrapper->SetNumberEntry( iDialer->NumberEntry() );
   248         iBubbleWrapper->SetNumberEntryObserver( *this );
   248         iBubbleWrapper->SetNumberEntryObserver( *this );
   249         // Finalise dialer view
   249         // Finalise dialer view
   250         iDialerView->SetControl( iDialer );
   250         iDialerView->SetControl( iDialer );
   251         iDialerView->ActivateL();
   251         iDialerView->ActivateL();
   252         
   252 
   253         // Create controller for Easy Dialing
   253         // Create controller for Easy Dialing
   254         iEasyDialingController = CPhoneEasyDialingController::NewL( *iDialer );
   254         iEasyDialingController = CPhoneEasyDialingController::NewL( *iDialer );
   255         iDialerController->SetEasyDialingController( iEasyDialingController );
   255         iDialerController->SetEasyDialingController( iEasyDialingController );
   256         
   256 
   257         // Create controller for DTMF mode of the dialer
   257         // Create controller for DTMF mode of the dialer
   258         iDtmfDialerController = CPhoneDtmfDialerController::NewL( iBubbleWrapper, 
   258         iDtmfDialerController = CPhoneDtmfDialerController::NewL( iBubbleWrapper,
   259                                                                   *coeEnv );
   259                                                                   *coeEnv );
   260         }
   260         }
   261 
   261 
   262     User::LeaveIfError( iKeyLock.Connect() );
   262     User::LeaveIfError( iKeyLock.Connect() );
   263 
   263 
   264     // if you are using sgc-client's session to capserver,
   264     // if you are using sgc-client's session to capserver,
   265     //you are not allowed to close the session.
   265     //you are not allowed to close the session.
   266     iAknUiServerClient = CAknSgcClient::AknSrv();
   266     iAknUiServerClient = CAknSgcClient::AknSrv();
   267     
   267 
   268     iIncallBubble = CAknIncallBubble::NewL();
   268     iIncallBubble = CAknIncallBubble::NewL();
   269     
   269 
   270     User::LeaveIfError( iSkinServerSession.Connect( this ) );
   270     User::LeaveIfError( iSkinServerSession.Connect( this ) );
   271     }
   271     }
   272 
   272 
   273 // -----------------------------------------------------------------------------
   273 // -----------------------------------------------------------------------------
   274 // CPhoneViewController::NewL
   274 // CPhoneViewController::NewL
   292 CPhoneViewController::~CPhoneViewController()
   292 CPhoneViewController::~CPhoneViewController()
   293     {
   293     {
   294     __LOGMETHODSTARTEND( EPhoneUIView,
   294     __LOGMETHODSTARTEND( EPhoneUIView,
   295                         "CPhoneViewController::~CPhoneViewController()" );
   295                         "CPhoneViewController::~CPhoneViewController()" );
   296     iSkinServerSession.Close();
   296     iSkinServerSession.Close();
   297     
   297 
   298     delete iButtonsController;
   298     delete iButtonsController;
   299     delete iDialerController;
   299     delete iDialerController;
   300     delete iToolbarController;
   300     delete iToolbarController;
   301     iKeyLock.Close();
   301     iKeyLock.Close();
   302     delete iApplicationExit;
   302     delete iApplicationExit;
   324             {
   324             {
   325             iAppui->RemoveFromStack( iDialerView );
   325             iAppui->RemoveFromStack( iDialerView );
   326             }
   326             }
   327         delete iDialerView;
   327         delete iDialerView;
   328         }
   328         }
   329 		
   329 
   330 	delete iEasyDialingController;
   330     delete iEasyDialingController;
   331 	delete iDtmfDialerController;
   331     delete iDtmfDialerController;
   332 		
   332 
   333     delete iDialer;
   333     delete iDialer;
   334     if ( iSingleItemFetch )
   334     if ( iSingleItemFetch )
   335         {
   335         {
   336         delete iSingleItemFetch;
   336         delete iSingleItemFetch;
   337         iSingleItemFetch = NULL;
   337         iSingleItemFetch = NULL;
   340     RemoveAddToContactDialog();
   340     RemoveAddToContactDialog();
   341 
   341 
   342 //    delete iStatusPane; <-- CCoeStatic are destroyed outside application
   342 //    delete iStatusPane; <-- CCoeStatic are destroyed outside application
   343 
   343 
   344     iApaLsSession.Close();
   344     iApaLsSession.Close();
   345     
   345 
   346     delete iIncallBubble;
   346     delete iIncallBubble;
   347     }
   347     }
   348 
   348 
   349 // ---------------------------------------------------------
   349 // ---------------------------------------------------------
   350 // CPhoneViewController::PhoneView
   350 // CPhoneViewController::PhoneView
   378             if ( iDialer && iDialerActive )
   378             if ( iDialer && iDialerActive )
   379                 {
   379                 {
   380                 SetControltoCallHandlingL();
   380                 SetControltoCallHandlingL();
   381                 iBubbleWrapper->RemoveNumberEntry();
   381                 iBubbleWrapper->RemoveNumberEntry();
   382                 iPhoneView->SetActivatePreviousApp( EFalse );
   382                 iPhoneView->SetActivatePreviousApp( EFalse );
   383                 
   383 
   384                 TPhoneCmdParamCallStateData callStateData;
   384                 TPhoneCmdParamCallStateData callStateData;
   385                 callStateData.SetCallState( EPEStateConnected );
   385                 callStateData.SetCallState( EPEStateConnected );
   386                 iBubbleWrapper->GetCallIdByState( &callStateData );
   386                 iBubbleWrapper->GetCallIdByState( &callStateData );
   387                 TInt connected = callStateData.CallId();
   387                 TInt connected = callStateData.CallId();
   388                     
   388 
   389                 // If video call
   389                 // If video call
   390                 if( connected == KVideoTelephonyCallId1 ||
   390                 if( connected == KVideoTelephonyCallId1 ||
   391                         connected == KVideoTelephonyCallId2 )
   391                         connected == KVideoTelephonyCallId2 )
   392                     {
   392                     {
   393                     TPhoneCmdParamInteger uidParam;
   393                     TPhoneCmdParamInteger uidParam;
   443             break;
   443             break;
   444 
   444 
   445         case EPhoneViewRemovePhoneDialogs:
   445         case EPhoneViewRemovePhoneDialogs:
   446             RemovePhoneDialogsL();
   446             RemovePhoneDialogsL();
   447             break;
   447             break;
   448             
   448 
   449         case EPhoneViewRemoveAllCallHeaders:
   449         case EPhoneViewRemoveAllCallHeaders:
   450             iBubbleWrapper->RemoveAllCallHeadersL();
   450             iBubbleWrapper->RemoveAllCallHeadersL();
   451             break;
   451             break;
   452 
   452 
   453         case EPhoneViewMuteRingToneOnAnswer:
   453         case EPhoneViewMuteRingToneOnAnswer:
   455             break;
   455             break;
   456 
   456 
   457         case EPhoneViewStopRingTone:
   457         case EPhoneViewStopRingTone:
   458             iRingingTonePlayerAO->StopPlaying();
   458             iRingingTonePlayerAO->StopPlaying();
   459             break;
   459             break;
   460             
   460 
   461         case EPhoneViewMuteRingTone:
   461         case EPhoneViewMuteRingTone:
   462             iRingingTonePlayerAO->MuteRingingTone();
   462             iRingingTonePlayerAO->MuteRingingTone();
   463             break;
   463             break;
   464 
   464 
   465         case EPhoneViewAddToConference:
   465         case EPhoneViewAddToConference:
   640             }
   640             }
   641         case EPhoneViewHideToolbar:
   641         case EPhoneViewHideToolbar:
   642             {
   642             {
   643             iToolbarController->HideToolbar();
   643             iToolbarController->HideToolbar();
   644             }
   644             }
   645             break;  
   645             break;
   646 
   646 
   647         case EPhoneViewLaunchMultimediaSharing:
   647         case EPhoneViewLaunchMultimediaSharing:
   648             {
   648             {
   649             LaunchMultimediaSharingL();
   649             LaunchMultimediaSharingL();
   650             }
   650             }
   739             // Pass the key event to number entry
   739             // Pass the key event to number entry
   740             iBubbleWrapper->HandleKeyEventL( aCommandParam );
   740             iBubbleWrapper->HandleKeyEventL( aCommandParam );
   741             break;
   741             break;
   742 
   742 
   743         case EPhoneViewUpdateContextMenu:
   743         case EPhoneViewUpdateContextMenu:
   744             {     
   744             {
   745             iMenuController->SetContextMenu( aCommandParam );     
   745             iMenuController->SetContextMenu( aCommandParam );
   746             } break; 
   746             }
       
   747             break;
   747 
   748 
   748         case EPhoneViewGetLocalizedNumberFromEntry:
   749         case EPhoneViewGetLocalizedNumberFromEntry:
   749             iBubbleWrapper->GetLocalizedNumberEntryContent( aCommandParam );
   750             iBubbleWrapper->GetLocalizedNumberEntryContent( aCommandParam );
   750             break;
   751             break;
   751 
   752 
   904 
   905 
   905         case EPhoneViewUpdateIncallIndicator:
   906         case EPhoneViewUpdateIncallIndicator:
   906             iMenuController->CloseMenuBar();
   907             iMenuController->CloseMenuBar();
   907             iIncallIndicator->Update( aCommandParam );
   908             iIncallIndicator->Update( aCommandParam );
   908             iMenuController->SetCallInProgressFlag( aCommandParam );
   909             iMenuController->SetCallInProgressFlag( aCommandParam );
   909             iToolbarController->SetCallInProgressFlag( aCommandParam );            
   910             iToolbarController->SetCallInProgressFlag( aCommandParam );
   910             break;
   911             break;
   911 
   912 
   912         case EPhoneViewStartCapturingKey:
   913         case EPhoneViewStartCapturingKey:
   913             iKeyCaptureController->StartCapturingKey( aCommandParam );
   914             iKeyCaptureController->StartCapturingKey( aCommandParam );
   914             break;
   915             break;
  1184             TPhoneCmdParamBoolean*  booleanParam =
  1185             TPhoneCmdParamBoolean*  booleanParam =
  1185                 static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1186                 static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1186             iToolbarController->DimToolbar( booleanParam->Boolean());
  1187             iToolbarController->DimToolbar( booleanParam->Boolean());
  1187             break;
  1188             break;
  1188             }
  1189             }
  1189             
  1190 
  1190         case EPhoneViewSetInvalidCsPhoneNumberFlag:
  1191         case EPhoneViewSetInvalidCsPhoneNumberFlag:
  1191             iMenuController->SetInvalidCsPhoneNumberFlag( aCommandParam );
  1192             iMenuController->SetInvalidCsPhoneNumberFlag( aCommandParam );
  1192             break;
  1193             break;
  1193                 
  1194 
  1194         case EPhoneViewGetInvalidCsPhoneNumberFlag:
  1195         case EPhoneViewGetInvalidCsPhoneNumberFlag:
  1195             iMenuController->GetInvalidCsPhoneNumberFlag( aCommandParam );
  1196             iMenuController->GetInvalidCsPhoneNumberFlag( aCommandParam );
  1196             break;
  1197             break;
  1197 
  1198 
  1198         case EPhoneViewGetEasyDialingMenuId:
  1199         case EPhoneViewGetEasyDialingMenuId:
  1204         case EPhoneViewSetConferenceAndWaitingVideo:
  1205         case EPhoneViewSetConferenceAndWaitingVideo:
  1205             {
  1206             {
  1206             TPhoneCmdParamBoolean*  booleanParam =
  1207             TPhoneCmdParamBoolean*  booleanParam =
  1207                             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1208                             static_cast<TPhoneCmdParamBoolean*>( aCommandParam );
  1208             iMenuController->SetConferenceAndWaitingVideoFlag( booleanParam->Boolean() );
  1209             iMenuController->SetConferenceAndWaitingVideoFlag( booleanParam->Boolean() );
  1209 			}
  1210             }
  1210             break;
  1211             break;
  1211         default:
  1212         default:
  1212             __PHONELOG( EBasic, EPhonePhoneapp,
  1213             __PHONELOG( EBasic, EPhonePhoneapp,
  1213              "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
  1214              "CPhoneViewController::ExecuteCommandL -> UnKnownMessage !!! " );
  1214             break;
  1215             break;
  1497                     static_cast<MPhoneButtonCustomization*>( pointerParam->Pointer() );
  1498                     static_cast<MPhoneButtonCustomization*>( pointerParam->Pointer() );
  1498                 iButtonsController->SetCustomization( customization );
  1499                 iButtonsController->SetCustomization( customization );
  1499                 }
  1500                 }
  1500             }
  1501             }
  1501             break;
  1502             break;
  1502 			
  1503 
  1503         case EPhoneViewEnableToolbarButton:
  1504         case EPhoneViewEnableToolbarButton:
  1504             {
  1505             {
  1505             TPhoneCmdParamInteger*  integerParam =
  1506             TPhoneCmdParamInteger*  integerParam =
  1506                 static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  1507                 static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  1507             iToolbarController->SetToolbarButtonDimmed( integerParam->Integer(), EFalse );
  1508             iToolbarController->SetToolbarButtonDimmed( integerParam->Integer(), EFalse );
  1508             }
  1509             }
  1509             break;
  1510             break;
  1510             
  1511 
  1511         case EPhoneViewGetQwertyModeObserver:
  1512         case EPhoneViewGetQwertyModeObserver:
  1512             {
  1513             {
  1513             TPhoneCmdParamPointer* ptrParam = static_cast<TPhoneCmdParamPointer*>( aCommandParam );
  1514             TPhoneCmdParamPointer* ptrParam = static_cast<TPhoneCmdParamPointer*>( aCommandParam );
  1514             ptrParam->SetPointer( static_cast<TAny*>( iDialer ) );
  1515             ptrParam->SetPointer( static_cast<TAny*>( iDialer ) );
  1515             }
  1516             }
  1601         case EPhoneViewGetTitlePaneIsVisibleStatus:
  1602         case EPhoneViewGetTitlePaneIsVisibleStatus:
  1602             viewResponse = iStatusPane->IsTitlePaneVisible( *this ) ?
  1603             viewResponse = iStatusPane->IsTitlePaneVisible( *this ) ?
  1603                 EPhoneViewResponseSuccess :
  1604                 EPhoneViewResponseSuccess :
  1604                 EPhoneViewResponseFailed;
  1605                 EPhoneViewResponseFailed;
  1605             break;
  1606             break;
  1606             
  1607 
  1607         case EPhoneViewIsMenuBarVisible:
  1608         case EPhoneViewIsMenuBarVisible:
  1608             viewResponse = iMenuController->IsMenuBarVisible() ?
  1609             viewResponse = iMenuController->IsMenuBarVisible() ?
  1609                 EPhoneViewResponseSuccess :
  1610                 EPhoneViewResponseSuccess :
  1610                 EPhoneViewResponseFailed;
  1611                 EPhoneViewResponseFailed;
  1611             break;
  1612             break;
  1632             BeginTransEffectForAppStartFromDialerLC( LogsUiCmdStarterConsts::KLogsUID3 );
  1633             BeginTransEffectForAppStartFromDialerLC( LogsUiCmdStarterConsts::KLogsUID3 );
  1633             LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView());
  1634             LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView());
  1634             EndTransEffect();
  1635             EndTransEffect();
  1635             }
  1636             }
  1636             break;
  1637             break;
  1637             
  1638 
  1638         case EPhoneDialerCmdContacts:
  1639         case EPhoneDialerCmdContacts:
  1639             {
  1640             {
  1640             // Launch Phonebook application
  1641             // Launch Phonebook application
  1641             TPhoneCmdParamAppInfo appInfoParam;
  1642             TPhoneCmdParamAppInfo appInfoParam;
  1642             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
  1643             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
  1643             BeginTransEffectForAppStartFromDialerLC( appInfoParam.AppUid() );
  1644             BeginTransEffectForAppStartFromDialerLC( appInfoParam.AppUid() );
  1644             ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
  1645             ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
  1645             EndTransEffect();
  1646             EndTransEffect();
  1646             }
  1647             }
  1647             break;           
  1648             break;
  1648 
  1649 
  1649         case EPhoneDialerCmdSpeedDial:
  1650         case EPhoneDialerCmdSpeedDial:
  1650             {
  1651             {
  1651             // Launch speeddial application.
  1652             // Launch speeddial application.
  1652             TPhoneCmdParamAppInfo appInfoParam;
  1653             TPhoneCmdParamAppInfo appInfoParam;
  1653             appInfoParam.SetAppUid( KUidSpdia );
  1654             appInfoParam.SetAppUid( KUidSpdia );
  1654             ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
  1655             ExecuteCommandL( EPhoneViewActivateApp, &appInfoParam );
  1655             break;
  1656             break;
  1656             }
  1657             }
  1657             
  1658 
  1658         case EPhoneDialerCallSettings:
  1659         case EPhoneDialerCallSettings:
  1659             {
  1660             {
  1660             CGSLauncher* launcher = CGSLauncher::NewLC();
  1661             CGSLauncher* launcher = CGSLauncher::NewLC();
  1661             launcher->LaunchGSViewL( TUid::Uid( 0x102824A2),
  1662             launcher->LaunchGSViewL( TUid::Uid( 0x102824A2),
  1662                                     TUid::Uid( 0x100058B3),
  1663                                     TUid::Uid( 0x100058B3),
  1663                                     KNullDesC8 );
  1664                                     KNullDesC8 );
  1664             CleanupStack::PopAndDestroy( launcher );
  1665             CleanupStack::PopAndDestroy( launcher );
  1665             break;
  1666             break;
  1666             }
  1667             }
  1667             
  1668 
  1668         case EPhoneViewIsDTMFEditorVisible:
  1669         case EPhoneViewIsDTMFEditorVisible:
  1669             if ( iDialer )
  1670             if ( iDialer )
  1670                 {
  1671                 {
  1671                 viewResponse = ( IsDtmfDialerActive() ?
  1672                 viewResponse = ( IsDtmfDialerActive() ?
  1672                     EPhoneViewResponseSuccess :
  1673                     EPhoneViewResponseSuccess :
  1677                 viewResponse = iQueryController->IsDTMFQueryVisible() ?
  1678                 viewResponse = iQueryController->IsDTMFQueryVisible() ?
  1678                     EPhoneViewResponseSuccess :
  1679                     EPhoneViewResponseSuccess :
  1679                     EPhoneViewResponseFailed;
  1680                     EPhoneViewResponseFailed;
  1680                 }
  1681                 }
  1681             break;
  1682             break;
  1682             
  1683 
  1683         case EPhoneViewIsConferenceInExpandedMode:
  1684         case EPhoneViewIsConferenceInExpandedMode:
  1684             viewResponse = iBubbleWrapper->IsConferenceInExpandedMode() ?
  1685             viewResponse = iBubbleWrapper->IsConferenceInExpandedMode() ?
  1685                 EPhoneViewResponseSuccess :
  1686                 EPhoneViewResponseSuccess :
  1686                 EPhoneViewResponseFailed;
  1687                 EPhoneViewResponseFailed;
  1687             break;
  1688             break;
  1703                     ExecuteCommandL( EPhoneViewCreateNumberEntry, &booleanParam );
  1704                     ExecuteCommandL( EPhoneViewCreateNumberEntry, &booleanParam );
  1704                     }
  1705                     }
  1705                 // Set Number Entry CBA
  1706                 // Set Number Entry CBA
  1706                 TPhoneCmdParamInteger integerParam;
  1707                 TPhoneCmdParamInteger integerParam;
  1707                 if ( iSecurityMode )
  1708                 if ( iSecurityMode )
  1708                 	{
  1709                     {
  1709                     iNoteController->DestroyNote();
  1710                     iNoteController->DestroyNote();
  1710                     integerParam.SetInteger(
  1711                     integerParam.SetInteger(
  1711                     CPhoneMainResourceResolver::Instance()->
  1712                             CPhoneMainResourceResolver::Instance()->
  1712                               		ResolveResourceID( EPhoneEmergencyModeNoteCBA ) );
  1713                                 ResolveResourceID( EPhoneEmergencyModeNoteCBA ) );
  1713                               	}
  1714                     }
  1714                               else
  1715                 else
  1715                               	{
  1716                     {
  1716                               	integerParam.SetInteger(
  1717                     integerParam.SetInteger(
  1717                               		CPhoneMainResourceResolver::Instance()->
  1718                             CPhoneMainResourceResolver::Instance()->
  1718                               		ResolveResourceID( EPhoneNumberAcqCBA ) );
  1719                                 ResolveResourceID( EPhoneNumberAcqCBA ) );
  1719                               	}
  1720                     }
  1720                 ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
  1721                 ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
  1721                 // Set flag to false because dialler is set to open status.
  1722                 // Set flag to false because dialler is set to open status.
  1722                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  1723                 iPhoneView->SetPhoneAppViewToDialer( EFalse );
  1723               }
  1724               }
  1724           break;
  1725           break;
  1734                 if ( IsDtmfDialerActive() )
  1735                 if ( IsDtmfDialerActive() )
  1735                     {
  1736                     {
  1736                     static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
  1737                     static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
  1737                     ->ProcessCommandL( EPhoneDtmfDialerExit );
  1738                     ->ProcessCommandL( EPhoneDtmfDialerExit );
  1738                     }
  1739                     }
  1739                 else if ( iCustomization && 
  1740                 else if ( iCustomization &&
  1740                           IsCustomDialerActive() )
  1741                           IsCustomDialerActive() )
  1741                     {
  1742                     {
  1742                     iCustomization->HandleCommandL( 
  1743                     iCustomization->HandleCommandL(
  1743                        *this, EPhoneViewOpenCallHandling, NULL );
  1744                        *this, EPhoneViewOpenCallHandling, NULL );
  1744                     }
  1745                     }
  1745                 else
  1746                 else
  1746                     {
  1747                     {
  1747                     SetControltoCallHandlingL();
  1748                     SetControltoCallHandlingL();
  1801         case EPhoneViewShowToolbar:
  1802         case EPhoneViewShowToolbar:
  1802             {
  1803             {
  1803             iToolbarController->ShowToolbar();
  1804             iToolbarController->ShowToolbar();
  1804             }
  1805             }
  1805             break;
  1806             break;
       
  1807             
       
  1808         case EPhoneViewIsDisplayingMenuOrDialog:
       
  1809             {
       
  1810             viewResponse = iEikEnv.EikAppUi()->IsDisplayingMenuOrDialog() ?
       
  1811                 EPhoneViewResponseSuccess :
       
  1812                 EPhoneViewResponseFailed;
       
  1813             }
       
  1814             break;
  1806         default:
  1815         default:
  1807             viewResponse = EPhoneViewResponseFailed;
  1816             viewResponse = EPhoneViewResponseFailed;
  1808             __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::HandleCommandL -> UnKnownMessage !!! ");
  1817             __PHONELOG( EBasic, EPhonePhoneapp, "CPhoneViewController::HandleCommandL -> UnKnownMessage !!! ");
  1809             break;
  1818             break;
  1810         }
  1819         }
  1821     TPhoneCommandParam* aCommandParam )
  1830     TPhoneCommandParam* aCommandParam )
  1822     {
  1831     {
  1823     __PHONELOGVIEWMSG( aCmdId, 0 );
  1832     __PHONELOGVIEWMSG( aCmdId, 0 );
  1824     TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
  1833     TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
  1825     TInt err;
  1834     TInt err;
  1826     
  1835 
  1827     switch ( aCmdId )
  1836     switch ( aCmdId )
  1828         {
  1837         {
  1829         case EPhoneViewSendKeyEventToNumberEntry:
  1838         case EPhoneViewSendKeyEventToNumberEntry:
  1830             {
  1839             {
  1831             // Pass the key event to the Bubble Manager (ignore key
  1840             // Pass the key event to the Bubble Manager (ignore key
  1954             TInt resId = iDialer->Controller()->CbaResourceId(); // easydialing change
  1963             TInt resId = iDialer->Controller()->CbaResourceId(); // easydialing change
  1955             static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( resId );
  1964             static_cast<TPhoneCmdParamInteger*>( aCommandParam )->SetInteger( resId );
  1956             viewResponse = EPhoneViewResponseSuccess;
  1965             viewResponse = EPhoneViewResponseSuccess;
  1957             }
  1966             }
  1958             break;
  1967             break;
  1959             
  1968 
  1960         default:
  1969         default:
  1961             if ( iCustomization )
  1970             if ( iCustomization )
  1962                 {
  1971                 {
  1963                 // Let customization handle view command
  1972                 // Let customization handle view command
  1964                 if ( iCustomization->HandleCommandL(
  1973                 if ( iCustomization->HandleCommandL(
  2130     {
  2139     {
  2131     __PHONELOG( EBasic, EPhoneUIView,
  2140     __PHONELOG( EBasic, EPhoneUIView,
  2132                         "CPhoneViewController::HandleResourceChangeL()" )
  2141                         "CPhoneViewController::HandleResourceChangeL()" )
  2133     // Notify the bubble that there has been a resource change
  2142     // Notify the bubble that there has been a resource change
  2134     iBubbleWrapper->Control()->HandleResourceChange( aType );
  2143     iBubbleWrapper->Control()->HandleResourceChange( aType );
  2135     
  2144 
  2136     // Notify dialer and switch statuspane layout.
  2145     // Notify dialer and switch statuspane layout.
  2137     if ( iDialer )
  2146     if ( iDialer )
  2138         {
  2147         {
  2139         if ( aType == KEikDynamicLayoutVariantSwitch )
  2148         if ( aType == KEikDynamicLayoutVariantSwitch )
  2140             {
  2149             {
  2176     {
  2185     {
  2177     return  CPhoneStatusPane::Instance()->IsVisible();
  2186     return  CPhoneStatusPane::Instance()->IsVisible();
  2178     }
  2187     }
  2179 
  2188 
  2180 // ---------------------------------------------------------------------------
  2189 // ---------------------------------------------------------------------------
       
  2190 // CPhoneViewController::IsEmergencyCallOngoing()
       
  2191 // ---------------------------------------------------------------------------
       
  2192 //
       
  2193 TBool CPhoneViewController::IsEmergencyCallOngoing()
       
  2194     {
       
  2195     __LOGMETHODSTARTEND( EPhoneUIView,
       
  2196                          "CPhoneViewController::IsEmergencyCallOngoing()");
       
  2197 
       
  2198     TPhoneCmdParamCallStateData callStateData;
       
  2199     callStateData.SetCallState( EPEStateConnected );
       
  2200     iBubbleWrapper->GetCallIdByState( &callStateData );
       
  2201     TInt connected = callStateData.CallId();
       
  2202 
       
  2203     callStateData.SetCallState( EPEStateConnecting );
       
  2204     iBubbleWrapper->GetCallIdByState( &callStateData );
       
  2205     TInt connecting = callStateData.CallId();
       
  2206 
       
  2207     return ( ( connected == KEmergencyCallId ) ||
       
  2208              ( connecting == KEmergencyCallId ) );
       
  2209     }
       
  2210 
       
  2211 // ---------------------------------------------------------------------------
  2181 // CPhoneViewController::HandleSecurityModeChanged
  2212 // CPhoneViewController::HandleSecurityModeChanged
  2182 // ---------------------------------------------------------------------------
  2213 // ---------------------------------------------------------------------------
  2183 //
  2214 //
  2184 EXPORT_C void CPhoneViewController::HandleSecurityModeChanged( TBool aIsEnabled )
  2215 EXPORT_C void CPhoneViewController::HandleSecurityModeChanged( TBool aIsEnabled )
  2185 	{
  2216     {
  2186 	 __PHONELOG1( EBasic, EPhoneUIView,
  2217     __PHONELOG1( EBasic, EPhoneUIView,
  2187             "CPhoneViewController::SetSecurityMode Mode = (%d)", aIsEnabled );
  2218             "CPhoneViewController::HandleSecurityModeChanged Mode = (%d)", aIsEnabled );
  2188     iToolbarController->DimToolbar( aIsEnabled );			
  2219 
  2189 	iPhoneView->SetSecurityMode( aIsEnabled );
  2220     TBool emergencyCallOngoing = IsEmergencyCallOngoing();
  2190 	iMenuController->SetSecurityMode( aIsEnabled );
  2221 
  2191 	
  2222     // Don't undim toolbar if emergency call is ongoing 
  2192 	TBool securityModeChanged = ( iSecurityMode != aIsEnabled );
  2223     if ( !emergencyCallOngoing )
  2193 	
  2224         {
  2194 	iSecurityMode = aIsEnabled;
  2225         iToolbarController->DimToolbar( aIsEnabled );
  2195 	
  2226         }
  2196 	if ( iDialer )
  2227     iPhoneView->SetSecurityMode( aIsEnabled );
  2197 		{
  2228     iMenuController->SetSecurityMode( aIsEnabled );
       
  2229 
       
  2230     TBool securityModeChanged = ( iSecurityMode != aIsEnabled );
       
  2231 
       
  2232     iSecurityMode = aIsEnabled;
       
  2233 
       
  2234     if ( iDialer )
       
  2235         {
  2198         iDialerController->SetRestrictedDialer( aIsEnabled );
  2236         iDialerController->SetRestrictedDialer( aIsEnabled );
  2199 	
  2237 
  2200         if ( iDialerActive && securityModeChanged )
  2238         if ( iDialerActive && securityModeChanged )
  2201             {
  2239             {
  2202             CDialingExtensionInterface* easyDialing = iDialer->GetEasyDialingInterface();
  2240             CDialingExtensionInterface* easyDialing = iDialer->GetEasyDialingInterface();
  2203             if ( easyDialing )
  2241             if ( easyDialing )
  2204                 {
  2242                 {
  2220                         TRAP_IGNORE( easyDialing->SetInputL( buf ) );
  2258                         TRAP_IGNORE( easyDialing->SetInputL( buf ) );
  2221                         }
  2259                         }
  2222                     }
  2260                     }
  2223                 }
  2261                 }
  2224             iDialer->RelayoutAndDraw();
  2262             iDialer->RelayoutAndDraw();
  2225             
  2263 
  2226             // also update cba if security mode changes while dialer is open
  2264             // Don't update cba here if emergency call is ongoing 
  2227             TPhoneCmdParamInteger integerParam;
  2265             if ( !emergencyCallOngoing )
  2228             if ( aIsEnabled )
  2266                 {
  2229                 {
  2267                 // also update cba if security mode changes while dialer is open
  2230                 iNoteController->DestroyNote();
  2268                 TPhoneCmdParamInteger integerParam;
  2231                 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  2269                 if ( aIsEnabled )
  2232                         ResolveResourceID( EPhoneEmergencyModeNoteCBA ) );
  2270                     {
  2233                 }
  2271                     iNoteController->DestroyNote();
  2234             else
  2272                     integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  2235                 {
  2273                             ResolveResourceID( EPhoneEmergencyModeNoteCBA ) );
  2236                 integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  2274                     }
  2237                         ResolveResourceID( EPhoneNumberAcqCBA ) );
  2275                 else
  2238                 }
  2276                     {
  2239             TRAP_IGNORE( ExecuteCommandL( EPhoneViewUpdateCba, &integerParam ) );
  2277                     integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
  2240             
  2278                             ResolveResourceID( EPhoneNumberAcqCBA ) );
       
  2279                     }
       
  2280                 TRAP_IGNORE( ExecuteCommandL( EPhoneViewUpdateCba, &integerParam ) );
       
  2281                 }
  2241             if ( !aIsEnabled )
  2282             if ( !aIsEnabled )
  2242                 {
  2283                 {
  2243                 TRAP_IGNORE( SwitchLayoutToFlatStatusPaneL( ETrue ) );
  2284                 TRAP_IGNORE( SwitchLayoutToFlatStatusPaneL( ETrue ) );
  2244                 }
  2285                 }
  2245             }
  2286             }
  2246 		}
  2287         }
  2247     if ( securityModeChanged )
  2288     if ( securityModeChanged )
  2248         {
  2289         {
       
  2290         // Update cba if security mode changes while emergency call is ongoing
       
  2291         if ( emergencyCallOngoing )
       
  2292             {
       
  2293             TRAP_IGNORE( static_cast<MEikCommandObserver*>( CEikonEnv::Static()->EikAppUi() )
       
  2294                                 ->ProcessCommandL( EPhoneCmdUpdateEmergencyCba ) );
       
  2295             }
       
  2296 
  2249         // Update status pane dimming
  2297         // Update status pane dimming
  2250         iStatusPane->StatusPane().SetDimmed( aIsEnabled );
  2298         iStatusPane->StatusPane().SetDimmed( aIsEnabled );
  2251 
  2299 
  2252         // Uncapture the App key for sure
  2300         // Uncapture the App key for sure
  2253         TPhoneCmdParamKeyCapture appKeyCaptureParam;
  2301         TPhoneCmdParamKeyCapture appKeyCaptureParam;
  2255         appKeyCaptureParam.SetKeyCode( EKeyApplication0 );
  2303         appKeyCaptureParam.SetKeyCode( EKeyApplication0 );
  2256         appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
  2304         appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
  2257 
  2305 
  2258         iKeyCaptureController->StopCapturingKey( &appKeyCaptureParam );
  2306         iKeyCaptureController->StopCapturingKey( &appKeyCaptureParam );
  2259         }
  2307         }
  2260 	}
  2308     }
  2261 
  2309 
  2262 // ---------------------------------------------------------------------------
  2310 // ---------------------------------------------------------------------------
  2263 // CPhoneViewController::IdleAppUid
  2311 // CPhoneViewController::IdleAppUid
  2264 // ---------------------------------------------------------------------------
  2312 // ---------------------------------------------------------------------------
  2265 //
  2313 //
  2297 //
  2345 //
  2298 void CPhoneViewController::NumberEntryStateChanged( TBool aEntryHasText )
  2346 void CPhoneViewController::NumberEntryStateChanged( TBool aEntryHasText )
  2299     {
  2347     {
  2300     iMenuController->SetNumberEntryEmptyFlag( !aEntryHasText );
  2348     iMenuController->SetNumberEntryEmptyFlag( !aEntryHasText );
  2301     iBubbleWrapper->HandleNumberEntryChanged();
  2349     iBubbleWrapper->HandleNumberEntryChanged();
  2302     ExecuteCommandL( EPhoneViewUpdateToolbar );
  2350     TRAP_IGNORE( ExecuteCommandL( EPhoneViewUpdateToolbar ) );
  2303     }
  2351     }
  2304 
  2352 
  2305 // ---------------------------------------------------------------------------
  2353 // ---------------------------------------------------------------------------
  2306 // CPhoneViewController::GetBlockingDialogIsDisplayed
  2354 // CPhoneViewController::GetBlockingDialogIsDisplayed
  2307 // ---------------------------------------------------------------------------
  2355 // ---------------------------------------------------------------------------
  2483         {
  2531         {
  2484         iPrevForegroundAppWg = ForegroundApplicationWindowGroupId();
  2532         iPrevForegroundAppWg = ForegroundApplicationWindowGroupId();
  2485         CAknSgcClient::MoveApp( phoneApp.WgId(), ESgcMoveAppToForeground );
  2533         CAknSgcClient::MoveApp( phoneApp.WgId(), ESgcMoveAppToForeground );
  2486         __PHONELOG1( EBasic, EPhoneUIView,
  2534         __PHONELOG1( EBasic, EPhoneUIView,
  2487                       "CPhoneViewController::BringPhoneAppToForeground - Previous App WG ID: %d",
  2535                       "CPhoneViewController::BringPhoneAppToForeground - Previous App WG ID: %d",
  2488                       iPrevForegroundAppWg );        
  2536                       iPrevForegroundAppWg );
  2489         }
  2537         }
  2490     }
  2538     }
  2491 
  2539 
  2492 // ---------------------------------------------------------------------------
  2540 // ---------------------------------------------------------------------------
  2493 // CPhoneViewController::SetTopApplicationL
  2541 // CPhoneViewController::SetTopApplicationL
  2758         static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  2806         static_cast<TPhoneCmdParamInteger*>( aCommandParam );
  2759 
  2807 
  2760     TInt resourceId = cbaResource->Integer();
  2808     TInt resourceId = cbaResource->Integer();
  2761 
  2809 
  2762     iCba->SetCommandSetL( resourceId );
  2810     iCba->SetCommandSetL( resourceId );
  2763     
  2811 
  2764     iCba->DrawDeferred();
  2812     iCba->DrawDeferred();
  2765     
  2813 
  2766     }
  2814     }
  2767 
  2815 
  2768 // ---------------------------------------------------------------------------
  2816 // ---------------------------------------------------------------------------
  2769 // CPhoneViewController::SetEikonNotifiersDisabled
  2817 // CPhoneViewController::SetEikonNotifiersDisabled
  2770 // ---------------------------------------------------------------------------
  2818 // ---------------------------------------------------------------------------
  2877         KPSUidCoreApplicationUIs,
  2925         KPSUidCoreApplicationUIs,
  2878         KCoreAppUIsAutolockStatus ) > EAutolockOff;
  2926         KCoreAppUIsAutolockStatus ) > EAutolockOff;
  2879 
  2927 
  2880     if ( phoneIsLocked || IsSecurityCodeQuery() )
  2928     if ( phoneIsLocked || IsSecurityCodeQuery() )
  2881         {
  2929         {
  2882         // Soft Reject is enabled if the phone is not locked. 
  2930         // Soft Reject is enabled if the phone is not locked.
  2883 		// Security Code query is checked because in the boot
  2931         // Security Code query is checked because in the boot
  2884 		// autolock status value is OFF even when it's actually
  2932         // autolock status value is OFF even when it's actually
  2885 		// ON so we need to do this double checking.
  2933         // ON so we need to do this double checking.
  2886         return EFalse;
  2934         return EFalse;
  2887         }
  2935         }
  2888     return ETrue;
  2936     return ETrue;
  2889     }
  2937     }
  2890 
  2938 
  3027     __LOGMETHODSTARTEND( EPhoneUIView,
  3075     __LOGMETHODSTARTEND( EPhoneUIView,
  3028             "CPhoneViewController::SpeedDialNumberTypeL() ");
  3076             "CPhoneViewController::SpeedDialNumberTypeL() ");
  3029     CPhCntSpeedDialMonitor::TSpdDialFieldInfo fieldInfo;
  3077     CPhCntSpeedDialMonitor::TSpdDialFieldInfo fieldInfo;
  3030 
  3078 
  3031     TBuf<KPhoneNumberEntryBufferSize> number;
  3079     TBuf<KPhoneNumberEntryBufferSize> number;
  3032     TContactItemId itemId = iSpeedDialController->GetSpeedDialFieldL( 
  3080     TContactItemId itemId = iSpeedDialController->GetSpeedDialFieldL(
  3033                                 aSpeedDialLocation, 
  3081                                 aSpeedDialLocation,
  3034                                 number,
  3082                                 number,
  3035                                 fieldInfo );
  3083                                 fieldInfo );
  3036 
  3084 
  3037     __PHONELOG1( EBasic, EPhoneUIView,
  3085     __PHONELOG1( EBasic, EPhoneUIView,
  3038         "CPhoneViewController::SpeedDialNumberTypeL - itemId = %d ", itemId );
  3086         "CPhoneViewController::SpeedDialNumberTypeL - itemId = %d ", itemId );
  3043 // ---------------------------------------------------------------------------
  3091 // ---------------------------------------------------------------------------
  3044 // CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo
  3092 // CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo
  3045 // ---------------------------------------------------------------------------
  3093 // ---------------------------------------------------------------------------
  3046 //
  3094 //
  3047 TPhoneNumberType CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo(
  3095 TPhoneNumberType CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo(
  3048     CPhCntSpeedDialMonitor::TSpdDialFieldInfo aFieldInfo )
  3096     const CPhCntSpeedDialMonitor::TSpdDialFieldInfo& aFieldInfo )
  3049     {
  3097     {
  3050     __LOGMETHODSTARTEND(EPhoneUIView,
  3098     __LOGMETHODSTARTEND(EPhoneUIView,
  3051         "CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo() ");
  3099         "CPhoneViewController::ConvertNumberTypeFromSpeedDialFieldInfo() ");
  3052     TPhoneNumberType retValue;
  3100     TPhoneNumberType retValue;
  3053     switch( aFieldInfo.iNumberType )
  3101     switch( aFieldInfo.iNumberType )
  3101 // ---------------------------------------------------------------------------
  3149 // ---------------------------------------------------------------------------
  3102 //
  3150 //
  3103 TBool CPhoneViewController::AssignSpeedDialLocationL(
  3151 TBool CPhoneViewController::AssignSpeedDialLocationL(
  3104     TInt aLocation )
  3152     TInt aLocation )
  3105     {
  3153     {
  3106   CreateSpeedDialControllerL();
  3154     CreateSpeedDialControllerL();
  3107 
  3155 
  3108     // Assign speed dial location
  3156     // Assign speed dial location
  3109     TBuf<KPhoneNumberEntryBufferSize> number;
  3157     TBuf<KPhoneNumberEntryBufferSize> number;
  3110 
  3158 
  3111     const TBool numberAssigned =
  3159     const TBool numberAssigned =
  3126 
  3174 
  3127     //Launch message editor standalone
  3175     //Launch message editor standalone
  3128     TUid mtmUid = { KSenduiMtmUniMessageUidValue };
  3176     TUid mtmUid = { KSenduiMtmUniMessageUidValue };
  3129 
  3177 
  3130     CSendUi* messageEditor = CSendUi::NewL();
  3178     CSendUi* messageEditor = CSendUi::NewL();
  3131   CleanupStack::PushL( messageEditor );
  3179     CleanupStack::PushL( messageEditor );
  3132 
  3180 
  3133     // Inform the SendUi to open the message editor. This is not a blocking
  3181     // Inform the SendUi to open the message editor. This is not a blocking
  3134     // dialog so the flag does not need to be set.
  3182     // dialog so the flag does not need to be set.
  3135     messageEditor->CreateAndSendMessageL(
  3183     messageEditor->CreateAndSendMessageL(
  3136         mtmUid,
  3184         mtmUid,
  3586 //
  3634 //
  3587 void CPhoneViewController::CreateSpeedDialControllerL()
  3635 void CPhoneViewController::CreateSpeedDialControllerL()
  3588   {
  3636   {
  3589     __LOGMETHODSTARTEND( EPhoneUIView,
  3637     __LOGMETHODSTARTEND( EPhoneUIView,
  3590         "CPhoneViewController::CreateSpeedDialControllerL()" );
  3638         "CPhoneViewController::CreateSpeedDialControllerL()" );
  3591   if( !iSpeedDialController )
  3639     if( !iSpeedDialController )
  3592         {
  3640         {
  3593         iSpeedDialController = iContactController->CreateSpeedDialMonitorL();
  3641         iSpeedDialController = iContactController->CreateSpeedDialMonitorL();
  3594         }
  3642         }
  3595 
  3643 
  3596     if( !iVmbxHandler )
  3644     if( !iVmbxHandler )
  3688 // -----------------------------------------------------------
  3736 // -----------------------------------------------------------
  3689 // CPhoneViewController::SingleItemFetchType
  3737 // CPhoneViewController::SingleItemFetchType
  3690 // -----------------------------------------------------------
  3738 // -----------------------------------------------------------
  3691 //
  3739 //
  3692 TInt CPhoneViewController::SingleItemFetchType() const
  3740 TInt CPhoneViewController::SingleItemFetchType() const
  3693    {
  3741     {
  3694    __LOGMETHODSTARTEND(EPhoneUIView,
  3742     __LOGMETHODSTARTEND(EPhoneUIView,
  3695        "CPhoneViewController::SingleItemFetchType()" );
  3743        "CPhoneViewController::SingleItemFetchType()" );
  3696 
  3744 
  3697    return iSingleItemFetchType;
  3745     return iSingleItemFetchType;
  3698    }
  3746     }
  3699 
  3747 
  3700 // ---------------------------------------------------------------------------
  3748 // ---------------------------------------------------------------------------
  3701 // CPhoneViewController::SwitchLayoutToFlatStatusPaneL
  3749 // CPhoneViewController::SwitchLayoutToFlatStatusPaneL
  3702 // ---------------------------------------------------------------------------
  3750 // ---------------------------------------------------------------------------
  3703 //
  3751 //
  3820             break;
  3868             break;
  3821             }
  3869             }
  3822         case EPhoneTransEffectAppStartFromDialer:
  3870         case EPhoneTransEffectAppStartFromDialer:
  3823             {
  3871             {
  3824             GfxTransEffect::BeginFullScreen(
  3872             GfxTransEffect::BeginFullScreen(
  3825                 AknTransEffect::EApplicationStart, 
  3873                 AknTransEffect::EApplicationStart,
  3826                 TRect(), 
  3874                 TRect(),
  3827                 AknTransEffect::EParameterType, 
  3875                 AknTransEffect::EParameterType,
  3828                 AknTransEffect::GfxTransParam( aAppUidEffectParam,
  3876                 AknTransEffect::GfxTransParam( aAppUidEffectParam,
  3829                     AknTransEffect::TParameter::EActivateExplicitCancel ) );
  3877                     AknTransEffect::TParameter::EActivateExplicitCancel ) );
  3830             iEffectOngoing = ETrue;
  3878             iEffectOngoing = ETrue;
  3831             }
  3879             }
  3832             break;
  3880             break;
  3857 
  3905 
  3858     if ( !iDialerActive )
  3906     if ( !iDialerActive )
  3859         {
  3907         {
  3860         iDialerActive = ETrue;
  3908         iDialerActive = ETrue;
  3861 
  3909 
  3862         // Ensure that toolbar and menu commands are up-to-date 
  3910         // Ensure that toolbar and menu commands are up-to-date
  3863         TBuf<1> temp; // we are only interested if the text is empty or not
  3911         TBuf<1> temp; // we are only interested if the text is empty or not
  3864         iDialer->GetTextFromNumberEntry( temp );
  3912         iDialer->GetTextFromNumberEntry( temp );
  3865         NumberEntryStateChanged( temp.Length() > 0 );
  3913         NumberEntryStateChanged( temp.Length() > 0 );
  3866         
  3914 
  3867         // Make dialer view top most
  3915         // Make dialer view top most
  3868         iDialerView->DrawableWindow()->SetOrdinalPosition(
  3916         iDialerView->DrawableWindow()->SetOrdinalPosition(
  3869             iPhoneView->DrawableWindow()->OrdinalPosition() );
  3917             iPhoneView->DrawableWindow()->OrdinalPosition() );
  3870 
  3918 
  3871         // Hide in-call view toolbar
  3919         // Hide in-call view toolbar
  3872         iToolbarController->HideToolbar();
  3920         iToolbarController->HideToolbar();
  3873         
  3921 
  3874         SwitchLayoutToFlatStatusPaneL( ETrue );
  3922         SwitchLayoutToFlatStatusPaneL( ETrue );
  3875 
  3923 
  3876         // Don't make dialer view visible before status pane is updated.
  3924         // Don't make dialer view visible before status pane is updated.
  3877         // This prevents unnecessary resizings.
  3925         // This prevents unnecessary resizings.
  3878         // But do it right away after it. Otherwice a black toolbar area is shortly shown.
  3926         // But do it right away after it. Otherwice a black toolbar area is shortly shown.
  3880         // Number entry is emptied when dialer is hidden but drawing doesn't
  3928         // Number entry is emptied when dialer is hidden but drawing doesn't
  3881         // succeed at that point as dialer is hidden first. So must draw
  3929         // succeed at that point as dialer is hidden first. So must draw
  3882         // dialer as soon as it becomes visible to prevent the flashing of
  3930         // dialer as soon as it becomes visible to prevent the flashing of
  3883         // number entry (DrawDeferred() isn't fast enough here).
  3931         // number entry (DrawDeferred() isn't fast enough here).
  3884         iDialerView->DrawNow();
  3932         iDialerView->DrawNow();
  3885       
  3933 
  3886         iPhoneView->DrawableWindow()->SetOrdinalPosition( -1 );
  3934         iPhoneView->DrawableWindow()->SetOrdinalPosition( -1 );
  3887         iPhoneView->MakeVisible( EFalse );
  3935         iPhoneView->MakeVisible( EFalse );
  3888 
  3936 
  3889         // Update control stack
  3937         // Update control stack
  3890         iAppui->AddToStackL( iDialerView );
  3938         iAppui->AddToStackL( iDialerView );
  3908         iDialerActive = EFalse;
  3956         iDialerActive = EFalse;
  3909         // Hide dialer view. Do this before resizing status pane to prevent unnecessary
  3957         // Hide dialer view. Do this before resizing status pane to prevent unnecessary
  3910         // resizing of dialer components. Hiding dialer view already before showing
  3958         // resizing of dialer components. Hiding dialer view already before showing
  3911         // phone view might cause screen flickering but tests have proven it doesn't happen.
  3959         // phone view might cause screen flickering but tests have proven it doesn't happen.
  3912         iDialerView->MakeVisible( EFalse );
  3960         iDialerView->MakeVisible( EFalse );
  3913         
  3961 
  3914         SwitchLayoutToFlatStatusPaneL( EFalse );
  3962         SwitchLayoutToFlatStatusPaneL( EFalse );
  3915 
  3963 
  3916         // Make call handling view top most
  3964         // Make call handling view top most
  3917         iPhoneView->DrawableWindow()->SetOrdinalPosition(
  3965         iPhoneView->DrawableWindow()->SetOrdinalPosition(
  3918             iDialerView->DrawableWindow()->OrdinalPosition() );
  3966             iDialerView->DrawableWindow()->OrdinalPosition() );
  3922         iDialerView->DrawableWindow()->SetOrdinalPosition( -1 );
  3970         iDialerView->DrawableWindow()->SetOrdinalPosition( -1 );
  3923 
  3971 
  3924         // Update control stack
  3972         // Update control stack
  3925         iAppui->AddToStackL( iPhoneView );
  3973         iAppui->AddToStackL( iPhoneView );
  3926         iAppui->RemoveFromStack( iDialerView );
  3974         iAppui->RemoveFromStack( iDialerView );
  3927         
  3975 
  3928         iEasyDialingController->HandleCommandL( EEasyDialingCallHandlingActivated );
  3976         iEasyDialingController->HandleCommandL( EEasyDialingCallHandlingActivated );
  3929         }
  3977         }
  3930     }
  3978     }
  3931 
  3979 
  3932 // ---------------------------------------------------------------------------
  3980 // ---------------------------------------------------------------------------
  4036 // CPhoneViewController::IsDtmfDialerActive
  4084 // CPhoneViewController::IsDtmfDialerActive
  4037 // ---------------------------------------------------------------------------
  4085 // ---------------------------------------------------------------------------
  4038 //
  4086 //
  4039 TBool CPhoneViewController::IsDtmfDialerActive() const
  4087 TBool CPhoneViewController::IsDtmfDialerActive() const
  4040     {
  4088     {
  4041     TBool ret = 
  4089     TBool ret =
  4042             ( iDialer && iDtmfDialerController && 
  4090             ( iDialer && iDtmfDialerController &&
  4043               iDialer->Controller() == iDtmfDialerController );
  4091               iDialer->Controller() == iDtmfDialerController );
  4044     return ret;
  4092     return ret;
  4045     }
  4093     }
  4046 
  4094 
  4047 // ---------------------------------------------------------------------------
  4095 // ---------------------------------------------------------------------------
  4052     {
  4100     {
  4053     TBool ret = EFalse;
  4101     TBool ret = EFalse;
  4054     if ( iDialer )
  4102     if ( iDialer )
  4055         {
  4103         {
  4056         MPhoneDialerController* curController = iDialer->Controller();
  4104         MPhoneDialerController* curController = iDialer->Controller();
  4057         ret = ( curController && 
  4105         ret = ( curController &&
  4058                 curController != iDialerController && 
  4106                 curController != iDialerController &&
  4059                 curController != iDtmfDialerController );
  4107                 curController != iDtmfDialerController );
  4060         }
  4108         }
  4061     return ret;
  4109     return ret;
  4062     }
  4110     }
  4063 
  4111 
  4064 // -----------------------------------------------------------
  4112 // -----------------------------------------------------------
  4065 // CPhoneViewController::CanTransEffectBeUsed
  4113 // CPhoneViewController::CanTransEffectBeUsed
  4066 // -----------------------------------------------------------
  4114 // -----------------------------------------------------------
  4067 //
  4115 //
  4068 TBool CPhoneViewController::CanTransEffectBeUsed( 
  4116 TBool CPhoneViewController::CanTransEffectBeUsed(
  4069     TPhoneTransEffectType aType )
  4117     TPhoneTransEffectType aType )
  4070     {
  4118     {
  4071     TBool okToUseEffect( EFalse );
  4119     TBool okToUseEffect( EFalse );
  4072     
  4120 
  4073     TBool isForeground = iAppui->IsForeground();
  4121     TBool isForeground = iAppui->IsForeground();
  4074     // Check whether the idle is on foreground
  4122     // Check whether the idle is on foreground
  4075     TBool idleInFore = ForegroundApplicationWindowGroupId() ==  IdleWindowGroupId() ?
  4123     TBool idleInFore = ForegroundApplicationWindowGroupId() ==  IdleWindowGroupId() ?
  4076             ETrue : EFalse;
  4124             ETrue : EFalse;
  4077     
  4125 
  4078     if ( isForeground && // Newer run effect if not at front
  4126     if ( isForeground && // Newer run effect if not at front
  4079          ( ( aType == EPhoneTransEffectDialerCreate && !iDialerActive ) ||
  4127          ( ( aType == EPhoneTransEffectDialerCreate && !iDialerActive ) ||
  4080            ( aType == EPhoneTransEffectDialerOpen && !iDialerActive &&
  4128            ( aType == EPhoneTransEffectDialerOpen && !iDialerActive &&
  4081              iBubbleWrapper->IsNumberEntryUsed() ) ||
  4129              iBubbleWrapper->IsNumberEntryUsed() ) ||
  4082            ( aType == EPhoneTransEffectDialerClose && iDialerActive ) ) )
  4130            ( aType == EPhoneTransEffectDialerClose && iDialerActive ) ) )
  4083         {
  4131         {
  4084         okToUseEffect = ETrue;
  4132         okToUseEffect = ETrue;
  4085         }
  4133         }
  4086     // In case transition is from idle to dialer show transition effects as well.                 
  4134     // In case transition is from idle to dialer show transition effects as well.
  4087     else if ( idleInFore && !iDialerActive &&
  4135     else if ( idleInFore && !iDialerActive &&
  4088               aType == EPhoneTransEffectDialerOpen )
  4136               aType == EPhoneTransEffectDialerOpen )
  4089         {
  4137         {
  4090         okToUseEffect = ETrue;
  4138         okToUseEffect = ETrue;
  4091         }
  4139         }
  4092     else if ( isForeground && iDialerActive && 
  4140     else if ( isForeground && iDialerActive &&
  4093               aType == EPhoneTransEffectAppStartFromDialer )
  4141               aType == EPhoneTransEffectAppStartFromDialer )
  4094         {
  4142         {
  4095         okToUseEffect = ETrue;
  4143         okToUseEffect = ETrue;
  4096         }
  4144         }
  4097     
  4145 
  4098     return okToUseEffect;
  4146     return okToUseEffect;
  4099     }
  4147     }
  4100 
  4148 
  4101 // -----------------------------------------------------------
  4149 // -----------------------------------------------------------
  4102 // CPhoneViewController::BeginTransEffectForAppStartFromDialerLC
  4150 // CPhoneViewController::BeginTransEffectForAppStartFromDialerLC
  4103 // -----------------------------------------------------------
  4151 // -----------------------------------------------------------
  4104 //
  4152 //
  4105 void CPhoneViewController::BeginTransEffectForAppStartFromDialerLC( 
  4153 void CPhoneViewController::BeginTransEffectForAppStartFromDialerLC(
  4106     const TUid& aAppUid )
  4154     const TUid& aAppUid )
  4107     {
  4155     {
  4108     TPhoneCmdParamTransEffect effectParam;
  4156     TPhoneCmdParamTransEffect effectParam;
  4109     effectParam.SetType( EPhoneTransEffectAppStartFromDialer );
  4157     effectParam.SetType( EPhoneTransEffectAppStartFromDialer );
  4110     effectParam.SetAppUid( aAppUid );
  4158     effectParam.SetAppUid( aAppUid );
  4111     
  4159 
  4112     ExecuteCommand( EPhoneViewBeginTransEffect,  &effectParam );
  4160     ExecuteCommand( EPhoneViewBeginTransEffect,  &effectParam );
  4113 
  4161 
  4114     TCleanupItem operation( EffectCleanup, this );
  4162     TCleanupItem operation( EffectCleanup, this );
  4115     CleanupStack::PushL( operation );
  4163     CleanupStack::PushL( operation );
  4116     }
  4164     }
  4165 // ---------------------------------------------------------------------------
  4213 // ---------------------------------------------------------------------------
  4166 // CPhoneViewController::AllowInCallBubbleInSpecialCases
  4214 // CPhoneViewController::AllowInCallBubbleInSpecialCases
  4167 // ---------------------------------------------------------------------------
  4215 // ---------------------------------------------------------------------------
  4168 //
  4216 //
  4169 void CPhoneViewController::AllowInCallBubbleInSpecialCases()
  4217 void CPhoneViewController::AllowInCallBubbleInSpecialCases()
  4170 {
  4218     {
  4171     // this method can be used for special cases like dialer
  4219     // this method can be used for special cases like dialer
  4172  
  4220 
  4173     if( iDialerActive )
  4221     if( iDialerActive )
  4174     {
  4222         {
  4175         SetIncallBubbleVisibility( ETrue );
  4223         SetIncallBubbleVisibility( ETrue );
  4176     }
  4224         }
  4177     else
  4225     else
  4178     {
  4226         {
  4179         SetIncallBubbleVisibility( EFalse );
  4227         SetIncallBubbleVisibility( EFalse );
  4180     }
  4228         }
  4181  
  4229     }
  4182 }
  4230 
  4183                     
       
  4184 // ---------------------------------------------------------------------------
  4231 // ---------------------------------------------------------------------------
  4185 // CPhoneViewController::SetIncallBubbleVisibility
  4232 // CPhoneViewController::SetIncallBubbleVisibility
  4186 // ---------------------------------------------------------------------------
  4233 // ---------------------------------------------------------------------------
  4187 //
  4234 //
  4188 void CPhoneViewController::SetIncallBubbleVisibility( TBool aVisible )
  4235 void CPhoneViewController::SetIncallBubbleVisibility( TBool aVisible )
  4189     {
  4236     {
  4190     __PHONELOG1( EBasic, EPhoneUIView,
  4237     __PHONELOG1( EBasic, EPhoneUIView,
  4191         "CPhoneViewController::SetIncallBubbleVisibility(%d)",
  4238         "CPhoneViewController::SetIncallBubbleVisibility(%d)",
  4192         aVisible );
  4239         aVisible );
  4193 
  4240 
  4194     TRAP_IGNORE( iIncallBubble->SetIncallBubbleAllowedInUsualL( aVisible ) ); 
  4241     TRAP_IGNORE( iIncallBubble->SetIncallBubbleAllowedInUsualL( aVisible ) );
  4195     }
  4242     }
  4196 
  4243 
  4197 // ---------------------------------------------------------------------------
  4244 // ---------------------------------------------------------------------------
  4198 // CPhoneViewController::SkinContentChanged
  4245 // CPhoneViewController::SkinContentChanged
  4199 // ---------------------------------------------------------------------------
  4246 // ---------------------------------------------------------------------------