phoneapp/phoneuicontrol/src/cphonestateincall.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 22 6bb1b21d2484
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
    32 #include "tphonecmdparaminteger.h"
    32 #include "tphonecmdparaminteger.h"
    33 #include "tphonecmdparamstring.h"
    33 #include "tphonecmdparamstring.h"
    34 #include "tphonecmdparamnote.h"
    34 #include "tphonecmdparamnote.h"
    35 #include "tphonecmdparamquery.h"
    35 #include "tphonecmdparamquery.h"
    36 #include "tphonecmdparamcallstatedata.h"
    36 #include "tphonecmdparamcallstatedata.h"
       
    37 #include "tphonecmdparamkeycapture.h"
    37 #include "tphonecmdparamsfidata.h"
    38 #include "tphonecmdparamsfidata.h"
    38 #include "mphonestatemachine.h"
    39 #include "mphonestatemachine.h"
    39 #include "phonestatedefinitions.h"
    40 #include "phonestatedefinitions.h"
    40 #include "phoneviewcommanddefinitions.h"
    41 #include "phoneviewcommanddefinitions.h"
    41 #include "phoneui.hrh"
    42 #include "phoneui.hrh"
   202 
   203 
   203         case MEngineMonitor::EPEMessageSentDTMF:
   204         case MEngineMonitor::EPEMessageSentDTMF:
   204         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   205         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   205             CancelDTMFSendingL();
   206             CancelDTMFSendingL();
   206             break;
   207             break;
   207 
       
   208         case MEngineMonitor::EPEMessagePromptSpeedDial:
       
   209             HandleDTMFPromptSpeedDialL();
       
   210             break;
       
   211 
       
   212         case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
       
   213             CPhoneState::SendGlobalErrorNoteL( 
       
   214                 EPhoneDtmfSpeedDialNotAssigned );
       
   215             break;
       
   216 
       
   217         case MEngineMonitor::EPEMessageInvalidSpeedDial:
       
   218             CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial );
       
   219             break;
       
   220             
   208             
   221         case MEngineMonitor::EPEMessageAudioVolumeChanged:
   209         case MEngineMonitor::EPEMessageAudioVolumeChanged:
   222             HandleAudioVolumeChangedL();
   210             HandleAudioVolumeChangedL();
   223             break;
   211             break;
   224             
   212             
   230                 }            
   218                 }            
   231             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   219             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   232             break; 
   220             break; 
   233             
   221             
   234         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   222         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   235             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
   223             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue );
   236             break;
   224             break;
   237             
   225             
   238         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   226         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   239             DialVoiceCallL();
   227             DialVoiceCallL();
   240             break;    
   228             break;    
   283 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   271 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   284     {
   272     {
   285     __LOGMETHODSTARTEND(EPhoneControl,  
   273     __LOGMETHODSTARTEND(EPhoneControl,  
   286         "CPhoneStateInCall::HandleIdleL()" );
   274         "CPhoneStateInCall::HandleIdleL()" );
   287     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
   275     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
       
   276     
       
   277     TBool showDialer( EFalse );
       
   278     HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
   279     TPtr ptr( phoneNumber->Des() );
       
   280     TPhoneCmdParamString stringParam;
       
   281     stringParam.SetString( &ptr );
       
   282 
   288     // Remove call 
   283     // Remove call 
   289     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   284     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   290   
   285   
   291     //Make sure that toolbar is not shown
   286     //Make sure that toolbar is not shown
   292     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   287     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   293     BeginTransEffectLC( ENumberEntryOpen );  
   288     BeginTransEffectLC( ENumberEntryOpen );  
   294     BeginUiUpdateLC();
   289     BeginUiUpdateLC();
   295     SetDefaultFlagsL();
   290     SetDefaultFlagsL();
   296     if ( IsNumberEntryUsedL() )
   291     if ( IsNumberEntryUsedL() )
   297         {
   292         {
   298         // Show the number entry if it exists and update cba's.
   293         if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
   299         SetNumberEntryVisibilityL( ETrue );
       
   300         
       
   301         // Close dtmf dialer when call is disconnected.
       
   302         if ( IsDTMFEditorVisibleL() )
       
   303             {      
       
   304             CloseDTMFEditorL();
       
   305             
       
   306             // Display idle screen and update CBA's
       
   307             DisplayIdleScreenL();
       
   308             }
       
   309         else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
       
   310             {            
   294             {            
   311             CloseCustomizedDialerL();
   295             CloseCustomizedDialerL();
   312             // Display idle screen and update CBA's
   296             }
   313             DisplayIdleScreenL();
   297         else 
   314             }          
   298             {
   315         }
   299             iViewCommandHandle->ExecuteCommand(
   316     else
   300                     EPhoneViewGetNumberFromEntry,
   317         {
   301                     &stringParam );
   318         // Close menu bar, if it is displayed
   302             iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   319         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   303             showDialer = ETrue;
       
   304             }
       
   305         }
       
   306 
   320         
   307         
   321         if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
   308     // Close menu bar, if it is displayed
   322             {        
   309     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   323             // Continue displaying current app but set up the 
   310     
   324             // idle screen in the background
   311     if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
   325             SetupIdleScreenInBackgroundL();
   312         {        
   326             }
   313         // Continue displaying current app but set up the 
   327         else
   314         // idle screen in the background
   328             {
   315         SetupIdleScreenInBackgroundL();
   329             // Display idle screen and update CBAs
   316         }
   330             DisplayIdleScreenL();
   317     else if ( showDialer )
   331             }
   318         {
       
   319         // Open dialer
       
   320         iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam );
       
   321         }
       
   322     else 
       
   323         {
       
   324         // Display idle screen and update CBAs
       
   325         DisplayIdleScreenL();
   332         }
   326         }
   333         
   327         
   334     DeleteTouchPaneButtons();        
   328     DeleteTouchPaneButtons();        
   335     EndUiUpdate();
   329     EndUiUpdate();
   336     EndTransEffect();
   330     EndTransEffect();
   337     // Display call termination note, if necessary
   331     // Display call termination note, if necessary
   338     DisplayCallTerminationNoteL();
   332     DisplayCallTerminationNoteL();
   339 
   333 
       
   334     TPhoneCmdParamKeyCapture captureParam;
       
   335     captureParam.SetKeyCode( EKeyNo );
       
   336     iViewCommandHandle->ExecuteCommand( EPhoneViewStopCapturingKey, &captureParam );
       
   337     
       
   338     CleanupStack::PopAndDestroy( phoneNumber );
   340     // Go to idle state
   339     // Go to idle state
   341     iStateMachine->ChangeState( EPhoneStateIdle );
   340     iStateMachine->ChangeState( EPhoneStateIdle );
   342     }
   341     }
   343 
   342 
   344 // -----------------------------------------------------------
   343 // -----------------------------------------------------------
   407     if ( !IsNumberEntryVisibleL() )
   406     if ( !IsNumberEntryVisibleL() )
   408         {
   407         {
   409         // Go to current state implementation
   408         // Go to current state implementation
   410         UpdateInCallCbaL();
   409         UpdateInCallCbaL();
   411         }
   410         }
       
   411     
       
   412     SetTouchPaneButtons(0);
   412     }
   413     }
   413 
   414 
   414 // -----------------------------------------------------------
   415 // -----------------------------------------------------------
   415 // CPhoneStateInCall::HandleAudioVolumeChangedL
   416 // CPhoneStateInCall::HandleAudioVolumeChangedL
   416 // -----------------------------------------------------------
   417 // -----------------------------------------------------------
   526     // Remove the Sending... note
   527     // Remove the Sending... note
   527     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
   528     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
   528     }
   529     }
   529 
   530 
   530 // -----------------------------------------------------------
   531 // -----------------------------------------------------------
   531 // CPhoneStateInCall::HandleDtmfPromptSpeedDialL
       
   532 // -----------------------------------------------------------
       
   533 //
       
   534 void CPhoneStateInCall::HandleDTMFPromptSpeedDialL()
       
   535     {
       
   536     __LOGMETHODSTARTEND(EPhoneControl,  
       
   537         "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" );
       
   538     // Remove the Sending... note
       
   539     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
       
   540 
       
   541     // Prompt for speed dial number
       
   542     HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
   543     TPtr ptr( emptyString->Des() );
       
   544 
       
   545     // If the Search softkey is selected before a speed dial number is entered,
       
   546     // revert back to the DTMF query   
       
   547     ShowDtmfTextQueryL( 
       
   548         CPhoneMainResourceResolver::Instance()->
       
   549             ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ),
       
   550         CPhoneMainResourceResolver::Instance()->
       
   551             ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
       
   552         CPhoneMainResourceResolver::Instance()->
       
   553             ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ),
       
   554         &ptr );
       
   555 
       
   556     CleanupStack::PopAndDestroy( emptyString );
       
   557     }
       
   558 
       
   559 // -----------------------------------------------------------
       
   560 // CPhoneStateInCall::HandleCommandL
   532 // CPhoneStateInCall::HandleCommandL
   561 // -----------------------------------------------------------
   533 // -----------------------------------------------------------
   562 //
   534 //
   563 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
   535 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
   564     {
   536     {
   637             break;
   609             break;
   638             
   610             
   639         // DTMF entry - Ok          
   611         // DTMF entry - Ok          
   640         case EPhoneCmdDtmfOk:
   612         case EPhoneCmdDtmfOk:
   641             SendDtmfL();
   613             SendDtmfL();
   642             break;
       
   643 
       
   644         // DTMF Speed entry - Ok
       
   645         case EPhoneCmdDtmfSpeedDialOk:
       
   646             SendDtmfSpeedDialNumberL();
       
   647             break;
   614             break;
   648 
   615 
   649         // DTMF sending - Cancel
   616         // DTMF sending - Cancel
   650         case EPhoneInCallCmdCancelSendingDtmfString:
   617         case EPhoneInCallCmdCancelSendingDtmfString:
   651             // Stop the asynchronous sending operation the 
   618             // Stop the asynchronous sending operation the 
   969             MPEPhoneModel::EPEMessageSendDTMF );    
   936             MPEPhoneModel::EPEMessageSendDTMF );    
   970         }
   937         }
   971     
   938     
   972     CleanupStack::PopAndDestroy( content );
   939     CleanupStack::PopAndDestroy( content );
   973     }
   940     }
   974     
       
   975 // -----------------------------------------------------------
       
   976 // CPhoneStateInCall::SendDtmfSpeedDialNumberL
       
   977 // -----------------------------------------------------------
       
   978 //
       
   979 void CPhoneStateInCall::SendDtmfSpeedDialNumberL()
       
   980     {
       
   981     __LOGMETHODSTARTEND(EPhoneControl,  
       
   982         "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" );
       
   983     // First get the DTMF sequence from dialog
       
   984     TPhoneCmdParamString dtmfSequence;
       
   985     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
       
   986     TPtr ptr( content->Des() );
       
   987     dtmfSequence.SetString( &ptr );
       
   988     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
       
   989         &dtmfSequence );
       
   990 
       
   991     // Prefix the query content string with the speed dial character '+'
       
   992     _LIT( KSpeedDialPrefix, "+" );
       
   993     ptr.Insert( 0, KSpeedDialPrefix );
       
   994 
       
   995     // Send the DTMF
       
   996     iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
       
   997     iStateMachine->SendPhoneEngineMessage(
       
   998         MPEPhoneModel::EPEMessageSendDTMF );    
       
   999 
       
  1000     CleanupStack::PopAndDestroy( content );
       
  1001     }
       
  1002 
   941 
  1003 // -----------------------------------------------------------
   942 // -----------------------------------------------------------
  1004 // CPhoneStateInCall::LaunchDtmfManualQueryL
   943 // CPhoneStateInCall::LaunchDtmfManualQueryL
  1005 // -----------------------------------------------------------
   944 // -----------------------------------------------------------
  1006 //
   945 //
  1289             KPSUidHWRM,
  1228             KPSUidHWRM,
  1290             KHWRMGripStatus,
  1229             KHWRMGripStatus,
  1291             state );
  1230             state );
  1292         if ( state == EPSHWRMGripOpen )
  1231         if ( state == EPSHWRMGripOpen )
  1293             {
  1232             {
  1294             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
  1233             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue );
  1295             }
  1234             }
  1296         else
  1235         else
  1297             {
  1236             {
  1298             iViewCommandHandle->ExecuteCommandL(
  1237             iViewCommandHandle->ExecuteCommandL(
  1299                 EPhoneViewEnableKeyLock );    
  1238                 EPhoneViewEnableKeyLock );    
  1545         SetHandsfreeModeL( !handsfreeMode );
  1484         SetHandsfreeModeL( !handsfreeMode );
  1546         }
  1485         }
  1547     else // aMessage == EPhoneKeyLongPress
  1486     else // aMessage == EPhoneKeyLongPress
  1548         {
  1487         {
  1549         // Display call in progress information note
  1488         // Display call in progress information note
  1550         SendGlobalInfoNoteL( EPhoneCallInProgress );
  1489         SendGlobalInfoNoteL( EPhoneCallInProgress, ETrue );
  1551         }        
  1490         }        
  1552     }
  1491     }
  1553 
  1492 
  1554 // -----------------------------------------------------------
  1493 // -----------------------------------------------------------
  1555 // CPhoneStateInCall::ShowDtmfTextQueryL
  1494 // CPhoneStateInCall::ShowDtmfTextQueryL