phoneapp/phoneuicontrol/src/cphonestateincall.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
child 69 8baf28733c3d
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
     1 /*
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    24 #include <UikonInternalPSKeys.h>
    24 #include <UikonInternalPSKeys.h>
    25 #include <mpeengineinfo.h>
    25 #include <mpeengineinfo.h>
    26 #include <videotelcontrolmediatorapi.h>
    26 #include <videotelcontrolmediatorapi.h>
    27 #include <MediatorDomainUIDs.h>
    27 #include <MediatorDomainUIDs.h>
    28 #include <bldvariant.hrh>
    28 #include <bldvariant.hrh>
       
    29 #include <coreapplicationuisdomainpskeys.h>
    29 
    30 
    30 #include "cphonestateincall.h"
    31 #include "cphonestateincall.h"
    31 #include "tphonecmdparamboolean.h"
    32 #include "tphonecmdparamboolean.h"
    32 #include "tphonecmdparaminteger.h"
    33 #include "tphonecmdparaminteger.h"
    33 #include "tphonecmdparamstring.h"
    34 #include "tphonecmdparamstring.h"
    34 #include "tphonecmdparamnote.h"
    35 #include "tphonecmdparamnote.h"
    35 #include "tphonecmdparamquery.h"
    36 #include "tphonecmdparamquery.h"
       
    37 #include "tphonecmdparamsingleitemfetch.h"
    36 #include "tphonecmdparamcallstatedata.h"
    38 #include "tphonecmdparamcallstatedata.h"
    37 #include "tphonecmdparamkeycapture.h"
       
    38 #include "tphonecmdparamsfidata.h"
    39 #include "tphonecmdparamsfidata.h"
    39 #include "mphonestatemachine.h"
    40 #include "mphonestatemachine.h"
       
    41 #include "mphonesecuritymodeobserver.h"
    40 #include "phonestatedefinitions.h"
    42 #include "phonestatedefinitions.h"
    41 #include "phoneviewcommanddefinitions.h"
    43 #include "phoneviewcommanddefinitions.h"
    42 #include "phoneui.hrh"
    44 #include "phoneui.hrh"
    43 #include "phonerssbase.h"
    45 #include "phonerssbase.h"
    44 #include "cphonemainresourceresolver.h"
    46 #include "cphonemainresourceresolver.h"
    49 #include "tphonecmdparamcallheaderdata.h"
    51 #include "tphonecmdparamcallheaderdata.h"
    50 #include "cphonemediatorfactory.h"
    52 #include "cphonemediatorfactory.h"
    51 #include "cphonemediatorsender.h"
    53 #include "cphonemediatorsender.h"
    52 #include "cphoneterminateallconnectionscommand.h"
    54 #include "cphoneterminateallconnectionscommand.h"
    53 #include "mphonecustomization.h"
    55 #include "mphonecustomization.h"
       
    56 #include "easydialingcommands.hrh"
       
    57 
    54 
    58 
    55 // ================= MEMBER FUNCTIONS =======================
    59 // ================= MEMBER FUNCTIONS =======================
    56 
    60 
    57 // C++ default constructor can NOT contain any code, that
    61 // C++ default constructor can NOT contain any code, that
    58 // might leave.
    62 // might leave.
    72 // (other items were commented in a header).
    76 // (other items were commented in a header).
    73 // -----------------------------------------------------------
    77 // -----------------------------------------------------------
    74 //
    78 //
    75 EXPORT_C CPhoneStateInCall::~CPhoneStateInCall()
    79 EXPORT_C CPhoneStateInCall::~CPhoneStateInCall()
    76     {
    80     {
    77     if( iDtmfWaitCharTimer )
    81     delete iDtmfWaitCharTimer;            
    78         {
       
    79         delete iDtmfWaitCharTimer;            
       
    80         }
       
    81     }
    82     }
    82 
    83 
    83 // -----------------------------------------------------------
    84 // -----------------------------------------------------------
    84 // CPhoneStateInCall::ConstructL()
    85 // CPhoneStateInCall::ConstructL()
    85 // Constructor
    86 // Constructor
    89 EXPORT_C void CPhoneStateInCall::ConstructL()
    90 EXPORT_C void CPhoneStateInCall::ConstructL()
    90     {
    91     {
    91     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
    92     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
    92         Panic( EPhoneCtrlInvariant ) );
    93         Panic( EPhoneCtrlInvariant ) );
    93     CPhoneState::BaseConstructL();
    94     CPhoneState::BaseConstructL();
       
    95     // Enable the volume display
       
    96     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
    94     }
    97     }
    95 
    98 
    96 // -----------------------------------------------------------
    99 // -----------------------------------------------------------
    97 // CPhoneStateInCall::NewL()
   100 // CPhoneStateInCall::NewL()
    98 // Constructor
   101 // Constructor
   136             HandleVoiceKeyPressL( aMessage ); 
   139             HandleVoiceKeyPressL( aMessage ); 
   137             break;
   140             break;
   138             
   141             
   139 #ifdef RD_INTELLIGENT_TEXT_INPUT
   142 #ifdef RD_INTELLIGENT_TEXT_INPUT
   140         case EKeyEnter:
   143         case EKeyEnter:
   141             if ( IsNumberEntryVisibleL() )
   144             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   142                 {
   145                 {
   143                 HandleCommandL( EPhoneCmdOptions );
   146                 SendDtmfL();    
       
   147                 }
       
   148             else if ( IsNumberEntryVisibleL() )
       
   149                 {
       
   150                 if ( IsDialingExtensionInFocusL() )
       
   151                     {
       
   152                     iViewCommandHandle->HandleCommandL(
       
   153                                        EEasyDialingEnterKeyAction );
       
   154                     }
       
   155                 else
       
   156                     {
       
   157                     TPhoneCmdParamInteger numberEntryCountParam;
       
   158                     iViewCommandHandle->ExecuteCommandL( 
       
   159                            EPhoneViewGetNumberEntryCount,
       
   160                            &numberEntryCountParam );
       
   161                     
       
   162                     TInt neLength( numberEntryCountParam.Integer() );
       
   163                     if ( neLength > 0 )
       
   164                        {
       
   165                        HandleCommandL( EPhoneNumberAcqCmdSendCommand );
       
   166                        }
       
   167                     }      
   144                 }
   168                 }
   145             break;
   169             break;
   146 #endif            
   170 #endif            
   147           
   171           
   148         default:
   172         default:
   174         "CPhoneStateInCall::HandlePhoneEngineMessageL()" );
   198         "CPhoneStateInCall::HandlePhoneEngineMessageL()" );
   175     switch ( aMessage )
   199     switch ( aMessage )
   176         {
   200         {
   177         case MEngineMonitor::EPEMessageIdle:
   201         case MEngineMonitor::EPEMessageIdle:
   178             HandleIdleL( aCallId );
   202             HandleIdleL( aCallId );
       
   203             // Forward idle message to phone customization 
       
   204             CPhoneState::ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
   179             break;
   205             break;
   180 
   206 
   181         case MEngineMonitor::EPEMessageAudioMuteChanged:
   207         case MEngineMonitor::EPEMessageAudioMuteChanged:
   182             HandleAudioMuteChangedL();
   208             HandleAudioMuteChangedL();
   183             break;
   209             break;
   197 
   223 
   198         case MEngineMonitor::EPEMessageSentDTMF:
   224         case MEngineMonitor::EPEMessageSentDTMF:
   199         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   225         case MEngineMonitor::EPEMessageDTMFSendingAborted:
   200             CancelDTMFSendingL();
   226             CancelDTMFSendingL();
   201             break;
   227             break;
       
   228 
       
   229         case MEngineMonitor::EPEMessagePromptSpeedDial:
       
   230             HandleDTMFPromptSpeedDialL();
       
   231             break;
       
   232 
       
   233         case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
       
   234             CPhoneState::SendGlobalErrorNoteL( 
       
   235                 EPhoneDtmfSpeedDialNotAssigned );
       
   236             break;
       
   237 
       
   238         case MEngineMonitor::EPEMessageInvalidSpeedDial:
       
   239             CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial );
       
   240             break;
   202             
   241             
   203         case MEngineMonitor::EPEMessageAudioVolumeChanged:
   242         case MEngineMonitor::EPEMessageAudioVolumeChanged:
   204             HandleAudioVolumeChangedL();
   243             HandleAudioVolumeChangedL();
   205             break;
   244             break;
   206             
   245             
   212                 }            
   251                 }            
   213             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   252             CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
   214             break; 
   253             break; 
   215             
   254             
   216         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   255         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   217             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue );
   256             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
   218             break;
   257             break;
   219             
   258             
   220         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   259         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   221             DialVoiceCallL();
   260             DialVoiceCallL();
   222             break;    
   261             break;    
   265 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   304 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
   266     {
   305     {
   267     __LOGMETHODSTARTEND(EPhoneControl,  
   306     __LOGMETHODSTARTEND(EPhoneControl,  
   268         "CPhoneStateInCall::HandleIdleL()" );
   307         "CPhoneStateInCall::HandleIdleL()" );
   269     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
   308     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
   270     
       
   271     TBool showDialer( EFalse );
       
   272     HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
   273     TPtr ptr( phoneNumber->Des() );
       
   274     TPhoneCmdParamString stringParam;
       
   275     stringParam.SetString( &ptr );
       
   276 
       
   277     // Remove call 
       
   278     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   309     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   279   
       
   280     //Make sure that toolbar is not shown
       
   281     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   310     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
       
   311     if (  IsNumberEntryUsedL() )
       
   312         {
       
   313         BeginTransEffectLC( ECallUiDisappear );
       
   314         }
       
   315     else 
       
   316         {
       
   317         BeginTransEffectLC( ENumberEntryClose );
       
   318         }
   282     BeginUiUpdateLC();
   319     BeginUiUpdateLC();
   283     SetDefaultFlagsL();
   320     SetDefaultFlagsL();
       
   321         
   284     if ( IsNumberEntryUsedL() )
   322     if ( IsNumberEntryUsedL() )
   285         {
   323         {
   286         iViewCommandHandle->ExecuteCommand(
   324         // Show the number entry if it exists and update cba's.
   287                 EPhoneViewGetNumberFromEntry,
   325         SetNumberEntryVisibilityL( ETrue );
   288                 &stringParam );
   326         // Close dtmf dialer when call is disconnected.
   289         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   327         if ( IsDTMFEditorVisibleL() )
   290         showDialer = ETrue;
   328             {      
   291         }
   329             CloseDTMFEditorL();
   292     
   330             // Display idle screen and update CBA's
   293     if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
   331             DisplayIdleScreenL();
   294         {        
   332             }
   295         // Continue displaying current app but set up the 
   333         else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
   296         // idle screen in the background
   334             {            
   297         SetupIdleScreenInBackgroundL();
   335             CloseCustomizedDialerL();
   298         }
   336             // Display idle screen and update CBA's
   299     else if ( showDialer )
   337             DisplayIdleScreenL();
   300         {
   338             } 
   301         // Open dialer
   339         }            
   302         iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam );
   340     else
   303         }
   341         {
   304     else 
   342         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   305         {
   343         if ( !TopAppIsDisplayedL() || IsAutoLockOn() || NeedToReturnToForegroundAppL() )
   306         // Display idle screen and update CBAs
   344             {        
   307         DisplayIdleScreenL();
   345             // Continue displaying current app but set up the 
       
   346             // idle screen in the background
       
   347             SetupIdleScreenInBackgroundL();
       
   348             }
       
   349         else
       
   350             {
       
   351             // Display idle screen and update CBAs
       
   352             DisplayIdleScreenL();
       
   353             }
   308         }
   354         }
   309         
   355         
   310     DeleteTouchPaneButtons();        
   356     DeleteTouchPaneButtons();
   311     EndUiUpdate();
   357     EndUiUpdate();
   312     // Display call termination note, if necessary
   358     EndTransEffect();
   313     DisplayCallTerminationNoteL();
   359     DisplayCallTerminationNoteL();
   314 
       
   315     TPhoneCmdParamKeyCapture captureParam;
       
   316     captureParam.SetKeyCode( EKeyNo );
       
   317     iViewCommandHandle->ExecuteCommand( EPhoneViewStopCapturingKey, &captureParam );
       
   318     
       
   319     CleanupStack::PopAndDestroy( phoneNumber );
       
   320     // Go to idle state
       
   321     iStateMachine->ChangeState( EPhoneStateIdle );
   360     iStateMachine->ChangeState( EPhoneStateIdle );
       
   361     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
   322     }
   362     }
   323 
   363 
   324 // -----------------------------------------------------------
   364 // -----------------------------------------------------------
   325 // CPhoneStateInCall::UpdateInCallCbaL
   365 // CPhoneStateInCall::UpdateInCallCbaL
   326 // -----------------------------------------------------------
   366 // -----------------------------------------------------------
   336 // -----------------------------------------------------------
   376 // -----------------------------------------------------------
   337 //
   377 //
   338 EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource )
   378 EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource )
   339     {
   379     {
   340     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() ");
   380     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() ");
   341     iCbaManager->UpdateCbaL( aResource );   
   381     if ( iOnScreenDialer && IsNumberEntryVisibleL() && IsDTMFEditorVisibleL() )
       
   382         {
       
   383         iCbaManager->SetCbaL( EPhoneDtmfDialerCBA );        
       
   384         }
       
   385     else if ( iOnScreenDialer && IsNumberEntryVisibleL() && IsCustomizedDialerVisibleL() )
       
   386         {
       
   387         iCbaManager->SetCbaL( CustomizedDialerCbaResourceIdL() );
       
   388         }
       
   389     else
       
   390         {
       
   391         iCbaManager->UpdateCbaL( aResource );   
       
   392         }
   342     }
   393     }
   343 
   394 
   344 // -----------------------------------------------------------
   395 // -----------------------------------------------------------
   345 // CPhoneStateInCall::HandleAudioMuteChangedL
   396 // CPhoneStateInCall::HandleAudioMuteChangedL
   346 // -----------------------------------------------------------
   397 // -----------------------------------------------------------
   356     if ( !IsNumberEntryUsedL() )
   407     if ( !IsNumberEntryUsedL() )
   357         {
   408         {
   358         // Go to current state implementation
   409         // Go to current state implementation
   359         UpdateInCallCbaL();
   410         UpdateInCallCbaL();
   360         }
   411         }
       
   412 	TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute();
       
   413     TPhoneCmdParamCallStateData callStateData;
       
   414     callStateData.SetCallState( EPEStateConnected );
       
   415     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, &callStateData );
       
   416     TInt call = callStateData.CallId();
       
   417     if ( call != KErrNotFound  && iStateMachine->PhoneEngineInfo()->CallType( call ) == EPECallTypeVoIP
       
   418             && audioMute )
       
   419 		{
       
   420 			  TPhoneCmdParamBoolean dtmfSendFlag;
       
   421 			  dtmfSendFlag.SetBoolean( ETrue );
       
   422 			  iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag,
       
   423 																							   &dtmfSendFlag );
       
   424 		}
       
   425     else
       
   426 		{           
       
   427 		 TPhoneCmdParamBoolean dtmfSendFlag;
       
   428 		  dtmfSendFlag.SetBoolean( EFalse );
       
   429 		  iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag,
       
   430 																						   &dtmfSendFlag );
       
   431 		} 
   361     }
   432     }
   362 
   433 
   363 // -----------------------------------------------------------
   434 // -----------------------------------------------------------
   364 // CPhoneStateInCall::HandleAudioOutputChangedL
   435 // CPhoneStateInCall::HandleAudioOutputChangedL
   365 // -----------------------------------------------------------
   436 // -----------------------------------------------------------
   376     if ( !IsNumberEntryVisibleL() )
   447     if ( !IsNumberEntryVisibleL() )
   377         {
   448         {
   378         // Go to current state implementation
   449         // Go to current state implementation
   379         UpdateInCallCbaL();
   450         UpdateInCallCbaL();
   380         }
   451         }
   381     
       
   382     SetTouchPaneButtons(0);
       
   383     }
   452     }
   384 
   453 
   385 // -----------------------------------------------------------
   454 // -----------------------------------------------------------
   386 // CPhoneStateInCall::HandleAudioVolumeChangedL
   455 // CPhoneStateInCall::HandleAudioVolumeChangedL
   387 // -----------------------------------------------------------
   456 // -----------------------------------------------------------
   497     // Remove the Sending... note
   566     // Remove the Sending... note
   498     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
   567     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
   499     }
   568     }
   500 
   569 
   501 // -----------------------------------------------------------
   570 // -----------------------------------------------------------
       
   571 // CPhoneStateInCall::HandleDtmfPromptSpeedDialL
       
   572 // -----------------------------------------------------------
       
   573 //
       
   574 void CPhoneStateInCall::HandleDTMFPromptSpeedDialL()
       
   575     {
       
   576     __LOGMETHODSTARTEND(EPhoneControl,  
       
   577         "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" );
       
   578     // Remove the Sending... note
       
   579     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
       
   580 
       
   581     // Prompt for speed dial number
       
   582     HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
   583     TPtr ptr( emptyString->Des() );
       
   584 
       
   585     // If the Search softkey is selected before a speed dial number is entered,
       
   586     // revert back to the DTMF query   
       
   587     ShowDtmfTextQueryL( 
       
   588         CPhoneMainResourceResolver::Instance()->
       
   589             ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ),
       
   590         CPhoneMainResourceResolver::Instance()->
       
   591             ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
       
   592         CPhoneMainResourceResolver::Instance()->
       
   593             ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ),
       
   594         &ptr );
       
   595 
       
   596     CleanupStack::PopAndDestroy( emptyString );
       
   597     }
       
   598 
       
   599 // -----------------------------------------------------------
   502 // CPhoneStateInCall::HandleCommandL
   600 // CPhoneStateInCall::HandleCommandL
   503 // -----------------------------------------------------------
   601 // -----------------------------------------------------------
   504 //
   602 //
   505 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
   603 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
   506     {
   604     {
   511     TBool commandStatus = ETrue;
   609     TBool commandStatus = ETrue;
   512 
   610 
   513     switch( aCommand )
   611     switch( aCommand )
   514         {
   612         {
   515         case EPhoneInCallCmdDialer:
   613         case EPhoneInCallCmdDialer:
   516             iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer );
   614             BeginTransEffectLC( ECallUiDisappear );
   517             break;
   615             if ( !IsNumberEntryUsedL() )
       
   616                 {
       
   617                 CreateNumberEntryL();
       
   618                 }
       
   619             SetNumberEntryVisibilityL( ETrue ); 
       
   620             EndTransEffect();
       
   621           break;
       
   622           
   518         case EPhoneCmdOptions:
   623         case EPhoneCmdOptions:
       
   624             OpenMenuBarL();
   519             break;
   625             break;
   520             
   626             
   521         case EPhoneDtmfDialerCancel:
   627         case EPhoneDtmfDialerCancel:
   522             {
   628             {
       
   629             CloseDTMFEditorL();
       
   630             
   523             // Activate DTMF list query when cancel is pressed.
   631             // Activate DTMF list query when cancel is pressed.
   524             // Forwards command to the framework 
   632             // Forwards command to the framework 
   525             HandleCommandL( EPhoneInCallCmdDtmfListQuery );
   633             if ( !iStateMachine->SecurityMode()->IsSecurityMode() )
       
   634                 {
       
   635                 HandleCommandL( EPhoneInCallCmdDtmfListQuery );
       
   636                 }
   526             }
   637             }
   527             break;  
   638             break;  
       
   639 			
   528         case EPhoneDtmfDialerExit:
   640         case EPhoneDtmfDialerExit:
   529             {
   641             {
       
   642             CloseDTMFEditorL();   
   530             }
   643             }
   531             break;
   644             break;
   532             
   645             
   533         case EPhoneInCallCmdEndThisActiveCall:
   646         case EPhoneInCallCmdEndThisActiveCall:
   534             CPhoneState::DisconnectCallL();
   647             CPhoneState::DisconnectCallL();
   547             iStateMachine->SendPhoneEngineMessage( 
   660             iStateMachine->SendPhoneEngineMessage( 
   548                 MPEPhoneModel::EPEMessageSetAudioMute );
   661                 MPEPhoneModel::EPEMessageSetAudioMute );
   549             break;
   662             break;
   550         //DTMF list query - dialog   
   663         //DTMF list query - dialog   
   551         case EPhoneInCallCmdDtmfListQuery:
   664         case EPhoneInCallCmdDtmfListQuery:
   552             LaunchDtmfListQueryL();
   665             if ( iStateMachine->SecurityMode()->IsSecurityMode() )
       
   666                 {
       
   667                 HandleCommandL( EPhoneInCallCmdDtmfManualQuery );
       
   668                 }
       
   669              else
       
   670                 {
       
   671                 LaunchDtmfListQueryL();
       
   672                 }
   553             break;
   673             break;
   554             
   674             
   555         //DTMF list query - Search   
   675         //DTMF list query - Search   
   556         case EPhoneInCallCmdDtmfListViewSearch:
   676         case EPhoneInCallCmdDtmfListViewSearch:
       
   677             LaunchDtmfListViewSearchDialogL();
   557             break;
   678             break;
   558             
   679             
   559         //DTMF manual entry 
   680         //DTMF manual entry 
   560         case EPhoneInCallCmdDtmfManualQuery:
   681         case EPhoneInCallCmdDtmfManualQuery:
       
   682             if ( iOnScreenDialer )
       
   683                 {
       
   684                 ShowDtmfDialerL();
       
   685                 }
       
   686             else
       
   687                 {
       
   688                 LaunchDtmfManualQueryL();
       
   689                 }
   561             break;
   690             break;
   562             
   691             
   563         // DTMF manual entry - Search          
   692         // DTMF manual entry - Search          
   564         case EPhoneCmdDtmfSearch:
   693         case EPhoneCmdDtmfSearch:
       
   694             LaunchDtmfSearchDialogL();
   565             break;
   695             break;
   566             
   696             
   567         // DTMF entry - Ok          
   697         // DTMF entry - Ok          
   568         case EPhoneCmdDtmfOk:
   698         case EPhoneCmdDtmfOk:
   569             SendDtmfL();
   699             SendDtmfL();
       
   700             break;
       
   701 
       
   702         // DTMF Speed entry - Ok
       
   703         case EPhoneCmdDtmfSpeedDialOk:
       
   704             SendDtmfSpeedDialNumberL();
   570             break;
   705             break;
   571 
   706 
   572         // DTMF sending - Cancel
   707         // DTMF sending - Cancel
   573         case EPhoneInCallCmdCancelSendingDtmfString:
   708         case EPhoneInCallCmdCancelSendingDtmfString:
   574             // Stop the asynchronous sending operation the 
   709             // Stop the asynchronous sending operation the 
   587                 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
   722                 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
   588                     iStateMachine );                    
   723                     iStateMachine );                    
   589                 }
   724                 }
   590             iDtmfWaitCharTimer->ButtonPressedL();
   725             iDtmfWaitCharTimer->ButtonPressedL();
   591             break;
   726             break;
       
   727             
       
   728         case  EPhoneDialerCmdHelpDtmf:
       
   729             {
       
   730             if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   731                 {                
       
   732                 TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF );
       
   733                 iViewCommandHandle->ExecuteCommandL( 
       
   734                     EPhoneViewLaunchHelpApplication,
       
   735                     0,
       
   736                     contextName );
       
   737                 }
       
   738             }
       
   739             break;
   592 
   740 
   593         // New Call - Search
   741         // New Call - Search
   594         case EPhoneInCallCmdNewCallFind:
   742         case EPhoneInCallCmdNewCallFind:
       
   743             LaunchNewCallSearchDialogL();
   595             break;
   744             break;
   596             
   745             
   597         // New Call - Dialog     
   746         // New Call - Dialog     
   598         case EPhoneInCallCmdNewCall:
   747         case EPhoneInCallCmdNewCall:
       
   748             LaunchNewCallQueryL();
       
   749             break;
       
   750             
       
   751         case EPhoneViewYesSingleItemFetch:       
       
   752             HandleSuccessFetchedNumberL();                          
       
   753             break;
       
   754             
       
   755         case EPhoneViewNoSingleItemFetch:
       
   756             if ( !iOnScreenDialer )
       
   757                 {   
       
   758                 HandleFailedFetchedNumberL();
       
   759                 }
   599             break;
   760             break;
   600             
   761             
   601         case EPhoneNumberAcqCmdCall:
   762         case EPhoneNumberAcqCmdCall:
   602         case EPhoneNumberAcqCmdSendCommand:
   763         case EPhoneNumberAcqCmdSendCommand:
   603             if ( IsVideoCallActiveL() )
   764             if ( IsVideoCallActiveL() )
   631                 // Provide number information with dial command
   792                 // Provide number information with dial command
   632                 CallFromNumberEntryL();
   793                 CallFromNumberEntryL();
   633                 }
   794                 }
   634             break;
   795             break;
   635 
   796 
       
   797         case EPhoneInCallCmdHelp:
       
   798             if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   799                 {                
       
   800                 TPtrC contextName;
       
   801                 if ( IsVideoCallActiveL() )
       
   802                     {
       
   803                     contextName.Set( KINCAL_HLP_VIDEOCALL() );    
       
   804                     }     
       
   805                 else
       
   806                     {
       
   807                     contextName.Set( KINCAL_HLP_CALL_HANDLING() );
       
   808                     }
       
   809                 iViewCommandHandle->ExecuteCommandL(
       
   810                     EPhoneViewLaunchHelpApplication, 0, contextName );
       
   811                 }
       
   812             break;
       
   813 
   636         case EPhoneCmdEnd:
   814         case EPhoneCmdEnd:
   637             CloseDtmfQueryL();
   815             CloseDtmfQueryL();
   638             CPhoneState::DisconnectCallL();
   816             DisconnectCallL();
   639             break;
   817             break;
   640             
   818             
   641         // 'End all calls' from menu
   819         // 'End all calls' from menu
   642         case EPhoneInCallCmdEndAllCalls:
   820         case EPhoneInCallCmdEndAllCalls:
   643             iStateMachine->SendPhoneEngineMessage(
   821             iStateMachine->SendPhoneEngineMessage(
   671             break;
   849             break;
   672 
   850 
   673        case EPhoneViewOpenCallHandling:
   851        case EPhoneViewOpenCallHandling:
   674             if ( iOnScreenDialer && IsNumberEntryUsedL() )
   852             if ( iOnScreenDialer && IsNumberEntryUsedL() )
   675                 {
   853                 {
       
   854                 BeginTransEffectLC( ECallUiAppear );
   676                 // Remove number entry from screen
   855                 // Remove number entry from screen
   677                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   856                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   857                 EndTransEffect();
   678                 HandleNumberEntryClearedL();
   858                 HandleNumberEntryClearedL();
   679                 }
   859                 }
   680             commandStatus = CPhoneState::HandleCommandL( aCommand );        
   860             commandStatus = CPhoneState::HandleCommandL( aCommand );        
   681             break;
   861             break;
   682  
   862  
       
   863         case EPhoneInCallCmdShareLiveVideo:
       
   864             iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchMultimediaSharing );
       
   865             break;
       
   866 
   683        default:
   867        default:
   684             commandStatus = CPhoneState::HandleCommandL( aCommand );
   868             commandStatus = CPhoneState::HandleCommandL( aCommand );
   685             break;
   869             break;
   686         }
   870         }
   687 
   871 
   688     return commandStatus;
   872     return commandStatus;
       
   873     }
       
   874     
       
   875 // -----------------------------------------------------------
       
   876 // CPhoneStateInCall::CreateNumberEntryL
       
   877 // -----------------------------------------------------------
       
   878 //
       
   879 EXPORT_C void CPhoneStateInCall::CreateNumberEntryL()
       
   880     {
       
   881     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::CreateNumberEntryL( ) ");
       
   882     iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateNumberEntry );
       
   883     }
       
   884 
       
   885 // -----------------------------------------------------------
       
   886 // CPhoneStateInCall::OpenMenuBarL
       
   887 // -----------------------------------------------------------
       
   888 //
       
   889 EXPORT_C void CPhoneStateInCall::OpenMenuBarL()
       
   890     {
       
   891     __LOGMETHODSTARTEND(EPhoneControl,  
       
   892         "CPhoneStateInCall::OpenMenuBarL()" );
       
   893     TInt resourceId;
       
   894     
       
   895     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   896         {
       
   897         resourceId = EPhoneDtmfDialerMenubar;
       
   898         }
       
   899     else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
       
   900         {
       
   901         resourceId = CustomizedDialerMenuResourceIdL();
       
   902         }
       
   903     else if ( IsNumberEntryVisibleL() )
       
   904         {
       
   905         resourceId = EPhoneCallHandlingMenubarWithNumberEntry;
       
   906         }
       
   907     else
       
   908         {
       
   909         resourceId = EPhoneCallHandlingMenubar;
       
   910         }
       
   911 
       
   912     TPhoneCmdParamInteger integerParam;
       
   913     integerParam.SetInteger( 
       
   914         CPhoneMainResourceResolver::Instance()->
       
   915         ResolveResourceID( resourceId ) );
       
   916     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   917         &integerParam );
       
   918     }
       
   919     
       
   920 // -----------------------------------------------------------
       
   921 // CPhoneStateInCall::LaunchNewCallQueryL
       
   922 // -----------------------------------------------------------
       
   923 //
       
   924 EXPORT_C void CPhoneStateInCall::LaunchNewCallQueryL()
       
   925     {
       
   926     __LOGMETHODSTARTEND(EPhoneControl,  
       
   927         "CPhoneStateInCall::LaunchNewCallQueryL()" );
       
   928     
       
   929     if ( iOnScreenDialer )
       
   930         {
       
   931         //In touch, just activate dialer
       
   932         BeginTransEffectLC( ECallUiDisappear );
       
   933         if ( IsNumberEntryUsedL() )
       
   934             {
       
   935             SetNumberEntryVisibilityL(ETrue);   
       
   936             }
       
   937         else
       
   938             {
       
   939             CreateNumberEntryL();
       
   940             SetNumberEntryVisibilityL(ETrue); 
       
   941             }
       
   942         EndTransEffect();
       
   943         }
       
   944     else
       
   945         {
       
   946         HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
   947         TPtr ptr( text->Des() );
       
   948 
       
   949         // Pre-populate the query with the number entry contents,
       
   950         // if it exists
       
   951         if ( IsNumberEntryUsedL() )
       
   952             {
       
   953             // get the number entry contents
       
   954             TPhoneCmdParamString stringParam;
       
   955             stringParam.SetString( &ptr );
       
   956             iViewCommandHandle->ExecuteCommandL(
       
   957                 EPhoneViewGetLocalizedNumberFromEntry,
       
   958                 &stringParam );
       
   959             }
       
   960 
       
   961         // Show text query with send key enabled
       
   962         const TBool enableSendKey = ETrue;
       
   963 
       
   964         CPhoneState::ShowTextQueryL( 
       
   965             CPhoneMainResourceResolver::Instance()->
       
   966                 ResolveResourceID( EPhoneNewCallPhoneNumberEditor ),
       
   967             CPhoneMainResourceResolver::Instance()->
       
   968                 ResolveResourceID( EPhoneCallHandlingNewCallFindCBA ),
       
   969             CPhoneMainResourceResolver::Instance()->
       
   970                 ResolveResourceID( EPhoneCallHandlingNewCallCallCBA ),
       
   971             &ptr,
       
   972             enableSendKey );
       
   973 
       
   974         CleanupStack::PopAndDestroy( text );        
       
   975         }
       
   976 
   689     }
   977     }
   690 
   978 
   691 // -----------------------------------------------------------
   979 // -----------------------------------------------------------
   692 // CPhoneStateInCall::CallFetchedNumberL
   980 // CPhoneStateInCall::CallFetchedNumberL
   693 // -----------------------------------------------------------
   981 // -----------------------------------------------------------
   721     TPhoneCmdParamString dtmfSequence;
  1009     TPhoneCmdParamString dtmfSequence;
   722     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
  1010     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
   723     TPtr ptr( content->Des() );
  1011     TPtr ptr( content->Des() );
   724     dtmfSequence.SetString( &ptr );
  1012     dtmfSequence.SetString( &ptr );
   725     
  1013     
   726     if ( iOnScreenDialer )
  1014     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   727         {
  1015         {
   728         iViewCommandHandle->ExecuteCommand(
  1016         iViewCommandHandle->ExecuteCommand(
   729             EPhoneViewGetNumberFromEntry,
  1017             EPhoneViewGetNumberFromEntry,
   730             &dtmfSequence );  
  1018             &dtmfSequence );  
   731                     
  1019                     
   732         }     
  1020         CloseDTMFEditorL();   
       
  1021         }
       
  1022     else
       
  1023         {
       
  1024         iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
       
  1025                                              &dtmfSequence );
       
  1026         }        
   733 
  1027 
   734     // Send the DTMF
  1028     // Send the DTMF
   735     if ( ptr.Length() )
  1029     if ( ptr.Length() )
   736         {
  1030         {
   737         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
  1031         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
   738         iStateMachine->SendPhoneEngineMessage(
  1032         iStateMachine->SendPhoneEngineMessage(
   739             MPEPhoneModel::EPEMessageSendDTMF );    
  1033             MPEPhoneModel::EPEMessageSendDTMF );    
   740         }
  1034         }
   741     
  1035     
   742     CleanupStack::PopAndDestroy( content );
  1036     CleanupStack::PopAndDestroy( content );
       
  1037     }
       
  1038     
       
  1039 // -----------------------------------------------------------
       
  1040 // CPhoneStateInCall::SendDtmfSpeedDialNumberL
       
  1041 // -----------------------------------------------------------
       
  1042 //
       
  1043 void CPhoneStateInCall::SendDtmfSpeedDialNumberL()
       
  1044     {
       
  1045     __LOGMETHODSTARTEND(EPhoneControl,  
       
  1046         "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" );
       
  1047     // First get the DTMF sequence from dialog
       
  1048     TPhoneCmdParamString dtmfSequence;
       
  1049     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
       
  1050     TPtr ptr( content->Des() );
       
  1051     dtmfSequence.SetString( &ptr );
       
  1052     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
       
  1053         &dtmfSequence );
       
  1054 
       
  1055     // Prefix the query content string with the speed dial character '+'
       
  1056     _LIT( KSpeedDialPrefix, "+" );
       
  1057     ptr.Insert( 0, KSpeedDialPrefix );
       
  1058 
       
  1059     // Send the DTMF
       
  1060     iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
       
  1061     iStateMachine->SendPhoneEngineMessage(
       
  1062         MPEPhoneModel::EPEMessageSendDTMF );    
       
  1063 
       
  1064     CleanupStack::PopAndDestroy( content );
       
  1065     }
       
  1066 
       
  1067 // -----------------------------------------------------------
       
  1068 // CPhoneStateInCall::LaunchDtmfManualQueryL
       
  1069 // -----------------------------------------------------------
       
  1070 //
       
  1071 void CPhoneStateInCall::LaunchDtmfManualQueryL()
       
  1072     {
       
  1073     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::LaunchDtmfManualQueryL()" );
       
  1074     
       
  1075     HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
       
  1076     TPtr ptr( text->Des() );
       
  1077     // Pre-populate the query with the number entry contents, if it exists
       
  1078     if ( IsNumberEntryUsedL() )
       
  1079         {
       
  1080         // get the number entry contents
       
  1081         TPhoneCmdParamString stringParam;
       
  1082         stringParam.SetString( &ptr );
       
  1083         iViewCommandHandle->ExecuteCommandL(
       
  1084             EPhoneViewGetLocalizedNumberFromEntry,
       
  1085             &stringParam );
       
  1086         }
       
  1087 
       
  1088     ShowDtmfTextQueryL( 
       
  1089         CPhoneMainResourceResolver::Instance()->
       
  1090             ResolveResourceID( EPhoneDtmfNumberQuery ),
       
  1091         CPhoneMainResourceResolver::Instance()->
       
  1092             ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
       
  1093         CPhoneMainResourceResolver::Instance()->
       
  1094             ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
       
  1095         &ptr );
       
  1096     CleanupStack::PopAndDestroy( text );
   743     }
  1097     }
   744 
  1098 
   745 // -----------------------------------------------------------
  1099 // -----------------------------------------------------------
   746 // CPhoneStateInCall::LaunchDtmfListQueryL
  1100 // CPhoneStateInCall::LaunchDtmfListQueryL
   747 // -----------------------------------------------------------
  1101 // -----------------------------------------------------------
   811        
  1165        
   812        // Display dialog        
  1166        // Display dialog        
   813        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
  1167        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
   814            &queryDialogParam );
  1168            &queryDialogParam );
   815        }
  1169        }
   816     }   
  1170     }
       
  1171 
       
  1172 // -----------------------------------------------------------
       
  1173 // CPhoneStateInCall::LaunchDtmfSearchDialogL
       
  1174 // -----------------------------------------------------------
       
  1175 //
       
  1176 void CPhoneStateInCall::LaunchDtmfSearchDialogL()
       
  1177     {
       
  1178     __LOGMETHODSTARTEND(EPhoneControl,  
       
  1179         "CPhoneStateInCall::LaunchDtmfSearchDialogL()" );
       
  1180     
       
  1181     TPhoneCmdParamInteger integerParam;
       
  1182     integerParam.SetInteger( EPhoneDtmfNumberQuery ); 
       
  1183     iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
       
  1184     }
       
  1185     
       
  1186 // -----------------------------------------------------------
       
  1187 // CPhoneStateInCall::LaunchDtmfListViewSearchDialogL
       
  1188 // -----------------------------------------------------------
       
  1189 //
       
  1190 void CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()
       
  1191     {
       
  1192     __LOGMETHODSTARTEND(EPhoneControl,  
       
  1193         "CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()" );
       
  1194 
       
  1195     TPhoneCmdParamInteger integerParam;
       
  1196     integerParam.SetInteger( EPhoneDtmfFetchTitle ); 
       
  1197     iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
       
  1198     }    
       
  1199 
       
  1200 // -----------------------------------------------------------
       
  1201 // CPhoneStateInCall::LaunchNewCallSearchDialogL
       
  1202 // -----------------------------------------------------------
       
  1203 //
       
  1204 void CPhoneStateInCall::LaunchNewCallSearchDialogL()
       
  1205     {
       
  1206     __LOGMETHODSTARTEND(EPhoneControl,  
       
  1207         "CPhoneStateInCall::LaunchNewCallSearchDialogL()" );
       
  1208     
       
  1209     TPhoneCmdParamBoolean blockingDialogStatus;
       
  1210             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, 
       
  1211             &blockingDialogStatus ); 
       
  1212     // Prevents unlegal use of singleitem fetch       
       
  1213     if ( !blockingDialogStatus.Boolean() )     
       
  1214         {             
       
  1215                     
       
  1216         TPhoneCmdParamInteger integerParam;
       
  1217         integerParam.SetInteger( EPhoneNewCallFetchTitle ); 
       
  1218         iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
       
  1219         }
       
  1220     }
   817     
  1221     
   818 // ---------------------------------------------------------
  1222 // ---------------------------------------------------------
   819 // CPhoneStateInCall::IsVideoCallActiveL
  1223 // CPhoneStateInCall::IsVideoCallActiveL
   820 // ---------------------------------------------------------
  1224 // ---------------------------------------------------------
   821 //
  1225 //
   932         __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) );
  1336         __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) );
   933         }       
  1337         }       
   934     }
  1338     }
   935 
  1339 
   936 // -----------------------------------------------------------------------------
  1340 // -----------------------------------------------------------------------------
   937 // CPhoneStateInCall::LockKeysL
  1341 // CPhoneStateInCall::LockKeypadL
   938 // -----------------------------------------------------------------------------
  1342 // -----------------------------------------------------------------------------
   939 //
  1343 //
   940 void CPhoneStateInCall::LockKeypadL()
  1344 void CPhoneStateInCall::LockKeypadL()
   941     {
  1345     {
   942     __LOGMETHODSTARTEND(EPhoneControl, 
  1346     __LOGMETHODSTARTEND(EPhoneControl, 
   949             KPSUidHWRM,
  1353             KPSUidHWRM,
   950             KHWRMGripStatus,
  1354             KHWRMGripStatus,
   951             state );
  1355             state );
   952         if ( state == EPSHWRMGripOpen )
  1356         if ( state == EPSHWRMGripOpen )
   953             {
  1357             {
   954             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue );
  1358             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
   955             }
  1359             }
   956         else
  1360         else
   957             {
  1361             {
   958             iViewCommandHandle->ExecuteCommandL(
  1362             iViewCommandHandle->ExecuteCommandL(
   959                 EPhoneViewEnableKeyLock );    
  1363                 EPhoneViewEnableKeyLock );    
   963         {
  1367         {
   964         iViewCommandHandle->ExecuteCommandL(
  1368         iViewCommandHandle->ExecuteCommandL(
   965             EPhoneViewEnableKeyLock ); 
  1369             EPhoneViewEnableKeyLock ); 
   966         }
  1370         }
   967     }    
  1371     }    
       
  1372      
       
  1373 // -----------------------------------------------------------------------------
       
  1374 // CPhoneStateInCall::HandleSuccessFetchedNumberL
       
  1375 // -----------------------------------------------------------------------------
       
  1376 //    
       
  1377 void CPhoneStateInCall::HandleSuccessFetchedNumberL()
       
  1378     {
       
  1379     __LOGMETHODSTARTEND(EPhoneControl, 
       
  1380         "CPhoneStateInCall::HandleSuccessFetchedNumberL()");
       
  1381     TBuf<KPhoneNumberEntryBufferSize> fetchContent;    
       
  1382     fetchContent = iViewCommandHandle->FetchContent();
       
  1383 
       
  1384     TPhoneCmdParamInteger fetchTypeParam;
       
  1385     iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
       
  1386         &fetchTypeParam );
       
  1387     TInt fetchType( fetchTypeParam.Integer() );
       
  1388     
       
  1389     if ( fetchType == EPhoneNewCallFetchTitle )
       
  1390         {
       
  1391         if ( iOnScreenDialer )
       
  1392             {
       
  1393             iViewCommandHandle->ExecuteCommandL(
       
  1394                             EPhoneViewSetNumberEntryContent,
       
  1395                             0,
       
  1396                             fetchContent );              
       
  1397             }
       
  1398         // Call the fetched number
       
  1399         CallFetchedNumberL( fetchContent );
       
  1400         }
       
  1401     else if ( fetchType == EPhoneDtmfFetchTitle )
       
  1402         {
       
  1403         // Send the DTMF
       
  1404         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
       
  1405         iStateMachine->SendPhoneEngineMessage(
       
  1406             MPEPhoneModel::EPEMessageSendDTMF ); 
       
  1407         }
       
  1408     else if( iCustomization && fetchType > EPhoneRssBaseLast )
       
  1409         {
       
  1410         // Handle unattended transfer contact fetch
       
  1411         iCustomization->HandleCommandL( fetchType );
       
  1412         }
       
  1413     else // EPhoneCmdDtmfSearch
       
  1414         {
       
  1415         // Send the DTMF
       
  1416         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
       
  1417         iStateMachine->SendPhoneEngineMessage(
       
  1418             MPEPhoneModel::EPEMessageSendDTMF ); 
       
  1419         }
       
  1420     }
       
  1421     
       
  1422 // -----------------------------------------------------------------------------
       
  1423 // CPhoneStateInCall::HandleFailedFetchedNumberL
       
  1424 // -----------------------------------------------------------------------------
       
  1425 //    
       
  1426 void CPhoneStateInCall::HandleFailedFetchedNumberL()
       
  1427     {
       
  1428     __LOGMETHODSTARTEND(EPhoneControl, 
       
  1429         "CPhoneStateInCall::HandleFailedFetchedNumberL()");
       
  1430     
       
  1431     TPhoneCmdParamInteger fetchTypeParam;
       
  1432     iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
       
  1433         &fetchTypeParam );
       
  1434     TInt fetchType( fetchTypeParam.Integer() );
       
  1435     
       
  1436     if ( fetchType == EPhoneNewCallFetchTitle )
       
  1437         {
       
  1438         HandleCommandL( EPhoneInCallCmdNewCall );
       
  1439         }
       
  1440     else if ( fetchType ==  EPhoneDtmfFetchTitle )
       
  1441         {
       
  1442         HandleCommandL( EPhoneInCallCmdDtmfListQuery );
       
  1443         }
       
  1444     else // EPhoneCmdDtmfSearch
       
  1445         {
       
  1446         HandleCommandL( EPhoneDtmfFetchTitle ); 
       
  1447         }
       
  1448     }  
       
  1449 
   968 
  1450 
   969 // -----------------------------------------------------------------------------
  1451 // -----------------------------------------------------------------------------
   970 // CPhoneStateInCall::CloseDtmfQueryL
  1452 // CPhoneStateInCall::CloseDtmfQueryL
   971 // -----------------------------------------------------------------------------
  1453 // -----------------------------------------------------------------------------
   972 //    
  1454 //    
   973 EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL()
  1455 EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL()
   974     {    
  1456     {
       
  1457     __LOGMETHODSTARTEND(EPhoneControl, 
       
  1458         "CPhoneStateInCall::CloseDtmfQueryL()");
       
  1459     TPhoneCmdParamInteger fetchTypeParam;
       
  1460         iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
       
  1461             &fetchTypeParam );
       
  1462         TInt fetchType( fetchTypeParam.Integer() );
       
  1463      
       
  1464     // If DTMF fetch is active then remove numberentry because it is considered
       
  1465     // to be a part of DTMF fetch operation.
       
  1466     if ( fetchType ==  EPhoneDtmfFetchTitle )
       
  1467         {
       
  1468         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
  1469         iViewCommandHandle->ExecuteCommand( EPhoneViewCloseSingleItemFetchDialog ); 
       
  1470         }
       
  1471     
       
  1472     // Close dtmf dialer or dtmf query if exist.
       
  1473     if ( IsDTMFEditorVisibleL() )
       
  1474         {
       
  1475         CloseDTMFEditorL();
       
  1476         }
   975     }  
  1477     }  
       
  1478 
       
  1479 // -----------------------------------------------------------
       
  1480 // CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL
       
  1481 // -----------------------------------------------------------
       
  1482 //
       
  1483 EXPORT_C void CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL( TInt aCallId )
       
  1484     {
       
  1485     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL() ");
       
  1486     TPhoneCmdParamBoolean phoneNumberAvailable;
       
  1487     
       
  1488     const TBool contactInfoAvailable = 
       
  1489         iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
       
  1490         iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length();
       
  1491     
       
  1492     if( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ||
       
  1493         contactInfoAvailable )
       
  1494         {
       
  1495         // Phone number is available straight or via contact info
       
  1496         // so switch to video/voice call is possible
       
  1497         __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is available" );
       
  1498         phoneNumberAvailable.SetBoolean( ETrue );
       
  1499         }
       
  1500     else
       
  1501         {
       
  1502         __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is not available" );
       
  1503         phoneNumberAvailable.SetBoolean( EFalse );
       
  1504         }
       
  1505 
       
  1506     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
       
  1507         &phoneNumberAvailable );
       
  1508     }
   976 
  1509 
   977 
  1510 
   978 // -----------------------------------------------------------------------------
  1511 // -----------------------------------------------------------------------------
   979 // CPhoneStateInCall::HandleEndKeyPressL
  1512 // CPhoneStateInCall::HandleEndKeyPressL
   980 // -----------------------------------------------------------------------------
  1513 // -----------------------------------------------------------------------------
   992         iViewCommandHandle->HandleCommandL(
  1525         iViewCommandHandle->HandleCommandL(
   993             EPhoneViewGetCallIdByState, &callStateData );
  1526             EPhoneViewGetCallIdByState, &callStateData );
   994 
  1527 
   995         if( IsVideoCall( callStateData.CallId() ) )
  1528         if( IsVideoCall( callStateData.CallId() ) )
   996             {
  1529             {
   997             // Video call can be released only after we get response to VT Shutdown Command 
  1530             // Video call can be released only after we get response to VT Shutdown Command
   998             CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( 
  1531             CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( 
   999                 KMediatorVideoTelephonyDomain,
  1532                 KMediatorVideoTelephonyDomain,
  1000                 KCatPhoneToVideotelCommands, 
  1533                 KCatPhoneToVideotelCommands, 
  1001                 EVtCmdReleaseDataport,
  1534                 EVtCmdReleaseDataport,
  1002                 TVersion( KPhoneToVideotelCmdVersionMajor,
  1535                 TVersion( KPhoneToVideotelCmdVersionMajor,
  1017                 }
  1550                 }
  1018             }
  1551             }
  1019 
  1552 
  1020         if ( IsNumberEntryUsedL() )
  1553         if ( IsNumberEntryUsedL() )
  1021             {
  1554             {
  1022             // Remove number entry from screen
  1555             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
  1023             iViewCommandHandle->ExecuteCommandL( 
  1556                 {
  1024                 EPhoneViewRemoveNumberEntry );
  1557                 CloseDTMFEditorL();
  1025             // Do state-specific operation when number entry is cleared
  1558                 }
  1026             HandleNumberEntryClearedL();         
  1559             else
       
  1560                 {    
       
  1561                 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
       
  1562                 }
  1027             }
  1563             }
  1028 
  1564 
  1029         if ( !TopAppIsDisplayedL() )
  1565         if ( !TopAppIsDisplayedL() )
  1030             {
  1566             {
  1031             // Bring app to foreground
  1567             // Bring app to foreground
  1034             iViewCommandHandle->ExecuteCommandL(
  1570             iViewCommandHandle->ExecuteCommandL(
  1035                 EPhoneViewBringAppToForeground, &uidParam );
  1571                 EPhoneViewBringAppToForeground, &uidParam );
  1036             }
  1572             }
  1037         }
  1573         }
  1038     else
  1574     else
  1039         {        
  1575         {  
       
  1576         if ( IsNumberEntryUsedL() )
       
  1577             {
       
  1578             if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
  1579                 {
       
  1580                 CloseDTMFEditorL();
       
  1581                 }
       
  1582             }
       
  1583       
  1040         // handle short end key
  1584         // handle short end key
  1041         CPhoneState::DisconnectCallL();    
  1585         CPhoneState::DisconnectCallL();    
  1042         }
  1586         }
  1043     }
  1587     }
  1044 
  1588 
  1059         SetHandsfreeModeL( !handsfreeMode );
  1603         SetHandsfreeModeL( !handsfreeMode );
  1060         }
  1604         }
  1061     else // aMessage == EPhoneKeyLongPress
  1605     else // aMessage == EPhoneKeyLongPress
  1062         {
  1606         {
  1063         // Display call in progress information note
  1607         // Display call in progress information note
  1064         SendGlobalInfoNoteL( EPhoneCallInProgress, ETrue );
  1608         SendGlobalInfoNoteL( EPhoneCallInProgress );
  1065         }        
  1609         }        
  1066     }
  1610     }
  1067 
  1611 
  1068 // -----------------------------------------------------------
  1612 // -----------------------------------------------------------
  1069 // CPhoneStateInCall::ShowDtmfTextQueryL
  1613 // CPhoneStateInCall::ShowDtmfTextQueryL
  1095     // Display dialog        
  1639     // Display dialog        
  1096     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
  1640     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
  1097         &queryDialogParam );    
  1641         &queryDialogParam );    
  1098     }
  1642     }
  1099   
  1643   
       
  1644 // -----------------------------------------------------------------------------
       
  1645 // CPhoneStateInCall::HandlePropertyChangedL
       
  1646 // from CPhoneState
       
  1647 // -----------------------------------------------------------------------------
       
  1648 //  
       
  1649 EXPORT_C void CPhoneStateInCall::HandlePropertyChangedL(
       
  1650         const TUid& aCategory, const TUint aKey, const TInt aValue)
       
  1651     {
       
  1652     if ( aCategory == KPSUidCoreApplicationUIs &&
       
  1653          aKey == KCoreAppUIsVideoSharingIndicator )
       
  1654         {
       
  1655         if ( aValue == ECoreAppUIsVideoSharingIndicatorOn )
       
  1656             {
       
  1657             SetTouchPaneButtons( EPhoneIncallVideoShareButtons );
       
  1658             }
       
  1659         else
       
  1660             {
       
  1661             SetTouchPaneButtons( EPhoneIncallButtons );
       
  1662             }
       
  1663         }
       
  1664     else
       
  1665         {
       
  1666         CPhoneState::HandlePropertyChangedL( aCategory, aKey, aValue );
       
  1667         }
       
  1668     }
       
  1669 
  1100 // End of File
  1670 // End of File