phoneapp/phoneuicontrol/src/cphonestateincoming.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    22 #include <eikenv.h>
    22 #include <eikenv.h>
    23 #include <featmgr.h>
    23 #include <featmgr.h>
    24 #include <StringLoader.h>
    24 #include <StringLoader.h>
    25 #include <dundomainpskeys.h>
    25 #include <dundomainpskeys.h>
    26 #include <telephonyvariant.hrh>
    26 #include <telephonyvariant.hrh>
    27 #include <ScreensaverInternalPSKeys.h>
       
    28 #include <mpeengineinfo.h>
    27 #include <mpeengineinfo.h>
    29 #include <MediatorDomainUIDs.h>
    28 #include <MediatorDomainUIDs.h>
    30 #include <videotelcontrolmediatorapi.h>
    29 #include <videotelcontrolmediatorapi.h>
    31 
    30 
    32 #include "cphonepubsubproxy.h"
    31 #include "cphonepubsubproxy.h"
    52 #include "tphonecmdparamquery.h"
    51 #include "tphonecmdparamquery.h"
    53 #include "cphonemediatorfactory.h"
    52 #include "cphonemediatorfactory.h"
    54 #include "cphonemediatorsender.h"
    53 #include "cphonemediatorsender.h"
    55 #include "cphonereleasecommand.h"
    54 #include "cphonereleasecommand.h"
    56 #include "mphonecustomization.h"
    55 #include "mphonecustomization.h"
    57 #include "mphonesecuritymodeobserver.h"
    56 #include "mphonestorage.h"
    58 
    57 
    59 // ================= MEMBER FUNCTIONS =======================
    58 // ================= MEMBER FUNCTIONS =======================
    60 
    59 
    61 // C++ default constructor can NOT contain any code, that
    60 // C++ default constructor can NOT contain any code, that
    62 // might leave.
    61 // might leave.
   152     {
   151     {
   153     __LOGMETHODSTARTEND(EPhoneControl,
   152     __LOGMETHODSTARTEND(EPhoneControl,
   154         "CPhoneStateIncoming::HandleNumberEntryClearedL ()" );
   153         "CPhoneStateIncoming::HandleNumberEntryClearedL ()" );
   155     // Set incoming call CBA when number entry is cleared
   154     // Set incoming call CBA when number entry is cleared
   156     iCbaManager->UpdateIncomingCbaL( iRingingCallId );
   155     iCbaManager->UpdateIncomingCbaL( iRingingCallId );
   157     UpdateSilenceButtonDimming();
       
   158     }
   156     }
   159 
   157 
   160 // -----------------------------------------------------------
   158 // -----------------------------------------------------------
   161 // CPhoneStateIncoming::HandleKeyMessageL
   159 // CPhoneStateIncoming::HandleKeyMessageL
   162 // -----------------------------------------------------------
   160 // -----------------------------------------------------------
   218             if ( aMessage == EPhoneKeyLongPress )
   216             if ( aMessage == EPhoneKeyLongPress )
   219                 {
   217                 {
   220                 // Answer the call if long press of selection key
   218                 // Answer the call if long press of selection key
   221                 AnswerCallL();
   219                 AnswerCallL();
   222                 }
   220                 }
   223             else if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
   221             break;
   224                         KTelephonyLVFlagCoverHideSendEndKey ))
   222 
       
   223         case EKeyDeviceF:
   225                 {
   224                 {
   226                 // Open number entry OK menubar
   225                 __PHONELOG( EBasic, EPhoneUIStates,
   227                 OpenMenuBarL();
   226                     "CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL-deviceF" );
       
   227                 HandleHoldSwitchL();
   228                 }
   228                 }
   229             break;
   229             break;
   230 
   230             
   231         default:
   231         default:
   232             break;
   232             break;
   233         }
   233         }
   234     }
   234     }
   235 
   235 
   246     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
   246     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
   247     iStateMachine->SendPhoneEngineMessage(
   247     iStateMachine->SendPhoneEngineMessage(
   248             MPEPhoneModel::EPEMessagePhoneNumberEdited );
   248             MPEPhoneModel::EPEMessagePhoneNumberEdited );
   249     
   249     
   250     if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength 
   250     if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength 
   251     		&& iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) 
   251             && iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) 
   252         {
   252         {
   253         // Send a manual control sequence by providing number
   253         // Send a manual control sequence by providing number
   254         // information with dial command
   254         // information with dial command
   255         CPhoneState::CallFromNumberEntryL();
   255         CPhoneState::CallFromNumberEntryL();
   256         }
   256         }
   359 //
   359 //
   360 void CPhoneStateIncoming::HandleConnectedL( TInt aCallId )
   360 void CPhoneStateIncoming::HandleConnectedL( TInt aCallId )
   361     {
   361     {
   362     __LOGMETHODSTARTEND(EPhoneControl,
   362     __LOGMETHODSTARTEND(EPhoneControl,
   363         "CPhoneStateIncoming::HandleConnectedL ()" );
   363         "CPhoneStateIncoming::HandleConnectedL ()" );
       
   364 
   364     // Re-enable global notes
   365     // Re-enable global notes
   365     TPhoneCmdParamBoolean globalNotifierParam;
   366     TPhoneCmdParamBoolean globalNotifierParam;
   366     globalNotifierParam.SetBoolean( EFalse );
   367     globalNotifierParam.SetBoolean( EFalse );
   367     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   368     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   368         &globalNotifierParam );
   369         &globalNotifierParam );
   369     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
   370     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
   370         &globalNotifierParam );
   371         &globalNotifierParam );
   371     // Stop tone playing, if necessary
   372     // Stop tone playing, if necessary
   372     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   373     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
       
   374     
       
   375     if( IsVideoCall( aCallId ) && !IsAutoLockOn() )
       
   376         {
       
   377         // For keeping video call on top
       
   378         TPhoneCmdParamBoolean booleanParam;
       
   379         booleanParam.SetBoolean( EFalse );
       
   380         iViewCommandHandle->ExecuteCommandL(
       
   381             EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
       
   382         }
       
   383 
       
   384     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   385          && iStateMachine->PhoneStorage()->IsScreenLocked() )
       
   386         {
       
   387         EnableCallUIL();
       
   388         }
       
   389     
       
   390     // Reset blocked keys list
       
   391     iStateMachine->PhoneStorage()->ResetBlockedKeysList();
       
   392 
   373     BeginUiUpdateLC();
   393     BeginUiUpdateLC();
       
   394     
   374     // Update single call
   395     // Update single call
   375     UpdateSingleActiveCallL( aCallId );
   396     UpdateSingleActiveCallL( aCallId );
       
   397 
   376     SetTouchPaneButtons( EPhoneIncallButtons );
   398     SetTouchPaneButtons( EPhoneIncallButtons );
   377     SetToolbarDimming( EFalse );
   399     SetBackButtonActive(ETrue);
       
   400             
   378     EndUiUpdate();
   401     EndUiUpdate();
       
   402 
       
   403     // Go to single state
   379     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
   404     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   405 
   380     iStateMachine->ChangeState( EPhoneStateSingle );
   406     iStateMachine->ChangeState( EPhoneStateSingle );
   381     }
   407     }
   382 
   408 
   383 // -----------------------------------------------------------
   409 // -----------------------------------------------------------
   384 // CPhoneStateIncoming::HandleAudioPlayStoppedL
   410 // CPhoneStateIncoming::HandleAudioPlayStoppedL
   386 //
   412 //
   387 EXPORT_C void CPhoneStateIncoming::HandleAudioPlayStoppedL()
   413 EXPORT_C void CPhoneStateIncoming::HandleAudioPlayStoppedL()
   388     {
   414     {
   389     __LOGMETHODSTARTEND(EPhoneControl,
   415     __LOGMETHODSTARTEND(EPhoneControl,
   390         "CPhoneStateIncoming::HandleAudioPlayStoppedL ()" );
   416         "CPhoneStateIncoming::HandleAudioPlayStoppedL ()" );
   391     // Update the CBA
       
   392     
       
   393     // Set the ringtone silenced status
   417     // Set the ringtone silenced status
   394     iCbaManager->SetRingtoneSilencedStatus( ETrue );
   418     iCbaManager->SetRingtoneSilencedStatus( ETrue );
   395     TInt resourceId = EPhoneCallHandlingIncomingRejectCBA;
   419     TInt resourceId = EPhoneCallHandlingIncomingRejectCBA;
   396     // Get the soft reject flag status
   420     iCbaManager->SetCbaL( resourceId );
   397     TPhoneCmdParamBoolean softRejectParam;
       
   398     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectFlag,
       
   399         &softRejectParam );
       
   400 
       
   401     if ( IsNumberEntryVisibleL() && !iOnScreenDialer )
       
   402         {
       
   403         resourceId = EPhoneNumberAcqCBA;
       
   404         }
       
   405     else if ( iStateMachine->SecurityMode()->IsSecurityMode() )
       
   406     	{
       
   407 		// Use 'answer & reject' softkeys if security mode is enabled.
       
   408     	resourceId = EPhoneCallHandlingIncomingRejectCBA;
       
   409     	}
       
   410     else if ( softRejectParam.Boolean() )
       
   411         {
       
   412         resourceId = EPhoneCallHandlingIncomingSoftRejectCBA;
       
   413         }
       
   414 	iCbaManager->SetCbaL( resourceId );
       
   415     }
   421     }
   416 
   422 
   417 // -----------------------------------------------------------
   423 // -----------------------------------------------------------
   418 // CPhoneStateIncoming::HandleIdleL
   424 // CPhoneStateIncoming::HandleIdleL
   419 // -----------------------------------------------------------
   425 // -----------------------------------------------------------
   420 //
   426 //
   421 void CPhoneStateIncoming::HandleIdleL( TInt aCallId )
   427 void CPhoneStateIncoming::HandleIdleL( TInt aCallId )
   422     {
   428     {
   423     __LOGMETHODSTARTEND(EPhoneControl,
   429     __LOGMETHODSTARTEND(EPhoneControl,
   424         "CPhoneStateIncoming::HandleIdleL ()" );
   430         "CPhoneStateIncoming::HandleIdleL ()" );
   425     BeginTransEffectLC( ENumberEntryClose );
       
   426     BeginUiUpdateLC();
   431     BeginUiUpdateLC();
       
   432 
       
   433     // Enable call UI
       
   434     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   435         && iStateMachine->PhoneStorage()->IsScreenLocked() )
       
   436         {
       
   437         EnableCallUIL();
       
   438         }
       
   439 
       
   440     // Reset blocked keys list
       
   441     iStateMachine->PhoneStorage()->ResetBlockedKeysList();
       
   442     
       
   443     // Remove call
   427     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   444     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   428     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   445     // Stop tone playing, if necessary
   429     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   446     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   430     
   447     
   431     TPhoneCmdParamBoolean globalNotifierParam;
   448     TPhoneCmdParamBoolean globalNotifierParam;
   432     globalNotifierParam.SetBoolean( EFalse );
   449     globalNotifierParam.SetBoolean( EFalse );
   433     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
   450     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
   435     
   452     
   436     SetDefaultFlagsL();
   453     SetDefaultFlagsL();
   437     
   454     
   438      if ( IsNumberEntryUsedL() )
   455      if ( IsNumberEntryUsedL() )
   439         {
   456         {
   440         if ( NeedToReturnToForegroundAppL() )
   457         if ( NeedToSendToBackgroundL() )
   441             {
   458             {
   442             // Return phone to the background if send to background is needed.
   459             // Return phone to the background if send to background is needed.
   443             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   460             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
   444             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
   461 
       
   462             // Set Number Entry CBA
   445             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
   463             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
   446             }
   464             }
   447         else
   465         else
   448             {
   466             {
   449             // Show the number entry if it exists.
   467             // Show the number entry if it exists.
   450             SetNumberEntryVisibilityL(ETrue);
   468             SetNumberEntryVisibilityL(ETrue);
   451             }
   469             }
   452         }
   470         }
   453     else if ( NeedToReturnToForegroundAppL() ||
   471     else if ( NeedToSendToBackgroundL() )
   454         SoftRejectMessageEditorIsDisplayedL() )
       
   455         {
   472         {
   456         // Continue displaying current app but set up the
   473         // Continue displaying current app but set up the
   457         // idle screen in the background
   474         // idle screen in the background
   458         SetupIdleScreenInBackgroundL();
   475         SetupIdleScreenInBackgroundL();
   459         }
   476         }
   460     else
   477     else
   461         {
   478         {
       
   479         // Display idle screen
   462         DisplayIdleScreenL();
   480         DisplayIdleScreenL();
   463         }
   481         }
   464  
   482  
   465     DeleteTouchPaneButtons();
   483     DeleteTouchPaneButtons();
       
   484     SetBackButtonActive(ETrue);
       
   485     
   466     EndUiUpdate();
   486     EndUiUpdate();
   467     EndTransEffect();
   487     // Go to idle state   
   468     iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
   488     iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
   469     iStateMachine->ChangeState( EPhoneStateIdle );
   489     iStateMachine->ChangeState( EPhoneStateIdle );
   470     }
   490     }
   471 
   491 
   472 // -----------------------------------------------------------
   492 // -----------------------------------------------------------
   483         {
   503         {
   484         case EPhoneCmdOptions:
   504         case EPhoneCmdOptions:
   485             // Stop tone playing, if necessary.
   505             // Stop tone playing, if necessary.
   486             // And stop vibrating, if it is active.
   506             // And stop vibrating, if it is active.
   487             iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   507             iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   488             // Open the menu bar
       
   489             OpenMenuBarL();
       
   490             break;
   508             break;
   491 
   509 
   492         case EPhoneCallComingCmdAnswer:
   510         case EPhoneCallComingCmdAnswer:
   493             AnswerCallL();
   511             AnswerCallL();
   494             break;
   512             break;
   507             break;
   525             break;
   508 
   526 
   509         case EPhoneCallComingCmdSilent:
   527         case EPhoneCallComingCmdSilent:
   510             // Silence the ringer. And stop vibrating, if it is active.
   528             // Silence the ringer. And stop vibrating, if it is active.
   511             iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingTone );
   529             iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingTone );
   512             // Dim silence button
       
   513             SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
       
   514             HandleAudioPlayStoppedL();
   530             HandleAudioPlayStoppedL();
   515             iStateMachine->SendPhoneEngineMessage(
   531             iStateMachine->SendPhoneEngineMessage(
   516                 MPEPhoneModel::EPEMessageStopTonePlay );
   532                 MPEPhoneModel::EPEMessageStopTonePlay );
   517             break;
   533             break;
   518 
   534 
   519         case EPhoneCallComingCmdSoftReject:
   535         case EPhoneCallComingCmdSoftReject:
   520             // Open Soft reject message editor
   536             // Open Soft reject message editor
   521             OpenSoftRejectMessageEditorL();
   537             OpenSoftRejectMessageL();
   522             break;
   538             break;
   523 
   539 
   524         case EPhoneNumberAcqCmdSendCommand:
   540         case EPhoneNumberAcqCmdSendCommand:
   525             HandleSendL();
   541             HandleSendL();
   526             break;
       
   527 
       
   528         case EPhoneInCallCmdHelp:
       
   529             {
       
   530             TPtrC contextName;
       
   531             if( IsVideoCall( iRingingCallId ) )
       
   532                 {
       
   533                 contextName.Set( KINCAL_HLP_VIDEOCALL() );
       
   534                 }
       
   535             else
       
   536                 {
       
   537                 contextName.Set( KINCAL_HLP_CALL_HANDLING() );
       
   538                 }
       
   539             iViewCommandHandle->ExecuteCommandL(
       
   540                 EPhoneViewLaunchHelpApplication, 0, contextName );
       
   541             }
       
   542             break;
   542             break;
   543 
   543 
   544         default:
   544         default:
   545             commandStatus = CPhoneState::HandleCommandL( aCommand );
   545             commandStatus = CPhoneState::HandleCommandL( aCommand );
   546             break;
   546             break;
   592     iStateMachine->SetCallId( iRingingCallId );
   592     iStateMachine->SetCallId( iRingingCallId );
   593 
   593 
   594     if( IsVideoCall( iRingingCallId ) )
   594     if( IsVideoCall( iRingingCallId ) )
   595         {
   595         {
   596         // Video call can be released only after we get response to VT Shutdown Command
   596         // Video call can be released only after we get response to VT Shutdown Command
   597         CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( 
   597         CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
   598                 KMediatorVideoTelephonyDomain,
   598                                                                              KCatPhoneToVideotelCommands, 
   599                          KCatPhoneToVideotelCommands, 
   599                                                                              EVtCmdReleaseDataport,
   600                          EVtCmdReleaseDataport,
   600                                                                    TVersion( KPhoneToVideotelCmdVersionMajor,
   601                TVersion( KPhoneToVideotelCmdVersionMajor,
   601                                                                              KPhoneToVideotelCmdVersionMinor, 
   602                          KPhoneToVideotelCmdVersionMinor, 
   602                                                                              KPhoneToVideotelCmdVersionBuild ),
   603                          KPhoneToVideotelCmdVersionBuild ),
   603                                                                    KNullDesC8,
   604                KNullDesC8,
   604                                                                    CPhoneReleaseCommand::NewL( *iStateMachine ) );
   605                CPhoneReleaseCommand::NewL( *iStateMachine ) );
       
   606         }
   605         }
   607     else
   606     else
   608         {
   607         {
   609         // Release the call
   608         // Release the call
   610         iStateMachine->SendPhoneEngineMessage(
   609         iStateMachine->SendPhoneEngineMessage(
   616 
   615 
   617 // -----------------------------------------------------------
   616 // -----------------------------------------------------------
   618 // CPhoneStateIncoming::OpenSoftRejectMessageEditorL
   617 // CPhoneStateIncoming::OpenSoftRejectMessageEditorL
   619 // -----------------------------------------------------------
   618 // -----------------------------------------------------------
   620 //
   619 //
   621 void CPhoneStateIncoming::OpenSoftRejectMessageEditorL()
   620 void CPhoneStateIncoming::OpenSoftRejectMessageL()
   622     {
   621     {
   623     __LOGMETHODSTARTEND(EPhoneControl,
   622     __LOGMETHODSTARTEND(EPhoneControl,
   624         "CPhoneStateIncoming::OpenSoftRejectMessageEditorL ()" );
   623         "CPhoneStateIncoming::OpenSoftRejectMessageEditorL ()" );
   625     // Clear the soft reject flag
       
   626     TPhoneCmdParamBoolean softRejectParam;
       
   627     softRejectParam.SetBoolean( EFalse );
       
   628     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSoftRejectFlag,
       
   629         &softRejectParam );
       
   630 
       
   631     // Dim silence button
       
   632     SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
       
   633     
   624     
   634     // Silence the vibrating
   625     // Silence the vibrating
   635     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   626     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   636     iStateMachine->SendPhoneEngineMessage(
   627     iStateMachine->SendPhoneEngineMessage(
   637         MPEPhoneModel::EPEMessageStopTonePlay );
   628         MPEPhoneModel::EPEMessageStopTonePlay );
   661 
   652 
   662     iViewCommandHandle->ExecuteCommandL(
   653     iViewCommandHandle->ExecuteCommandL(
   663         EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
   654         EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
   664     }
   655     }
   665 
   656 
   666 // -----------------------------------------------------------
   657 
   667 // CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL
   658 // -----------------------------------------------------------
   668 // -----------------------------------------------------------
   659 // CPhoneStateIncoming::GetNumberEntryVisibleMenuBar
   669 //
   660 // -----------------------------------------------------------
   670 TBool CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() const
   661 //
   671     {
   662 TInt CPhoneStateIncoming::GetNumberEntryVisibleMenuBar()
   672     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL () ");
   663     {
   673     // Get the foreground application window group id
   664     if( CPhoneState::IsVideoCall ( iRingingCallId ) )
   674     TPhoneCmdParamInteger foregroundAppParam;
   665         {
   675     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication,
   666         return EPhoneIncomingVideoCallMenubarWithNumberEntry;
   676         &foregroundAppParam );
       
   677 
       
   678     // Get the soft reject message editor window group id
       
   679     TPhoneCmdParamInteger softRejectMessageEditorWgId;
       
   680     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectWindowGroupId,
       
   681         &softRejectMessageEditorWgId );
       
   682 
       
   683     __PHONELOG1(
       
   684         EBasic,
       
   685         EPhoneControl,
       
   686         "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() SoftRejectGroupId %d",
       
   687         softRejectMessageEditorWgId.Integer() );
       
   688     __PHONELOG1(
       
   689         EBasic,
       
   690         EPhoneControl,
       
   691         "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() ForegroundAppGroupId %d",
       
   692         foregroundAppParam.Integer() );
       
   693     // Return ETrue if soft reject message editor is displayed
       
   694     return softRejectMessageEditorWgId.Integer() == foregroundAppParam.Integer();
       
   695     }
       
   696 
       
   697 // -----------------------------------------------------------
       
   698 // CPhoneStateIncoming::OpenMenuBarL
       
   699 // -----------------------------------------------------------
       
   700 //
       
   701 void CPhoneStateIncoming::OpenMenuBarL()
       
   702     {
       
   703     __LOGMETHODSTARTEND(EPhoneControl,
       
   704         "CPhoneStateIncoming::OpenMenuBarL ()" );
       
   705     TInt resourceId;
       
   706 
       
   707     // Determine the correct menu bar to display
       
   708     if ( CPhoneState::IsNumberEntryVisibleL() )
       
   709         {
       
   710         resourceId = GetNumberEntryVisibleMenuBar();
       
   711         }
   667         }
   712     else
   668     else
   713         {
   669         {
   714         resourceId = GetNumberEntryNotVisibleMenuBar();
   670         return EPhoneIncomingCallMenubarWithNumberEntry;
   715         }
   671         }
   716 
   672     }
   717     // Silence the ringer. And stop vibrating, if it is active.
   673 
   718     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   674 // -----------------------------------------------------------
   719     iStateMachine->SendPhoneEngineMessage(
   675 // CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar
   720         MPEPhoneModel::EPEMessageStopTonePlay );
   676 // -----------------------------------------------------------
   721 
   677 //
   722     //Set correct cba
   678 TInt CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar()
   723     HandleAudioPlayStoppedL();
       
   724     
       
   725     // Dim button
       
   726     SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
       
   727 
       
   728     // Open the menu bar
       
   729     TPhoneCmdParamInteger integerParam;
       
   730     integerParam.SetInteger(
       
   731         CPhoneMainResourceResolver::Instance()->
       
   732         ResolveResourceID( resourceId ) );
       
   733     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
       
   734         &integerParam );
       
   735     }
       
   736 
       
   737 // -----------------------------------------------------------
       
   738 // CPhoneStateIncoming::GetNumberEntryVisibleMenuBar
       
   739 // -----------------------------------------------------------
       
   740 //
       
   741 TInt CPhoneStateIncoming::GetNumberEntryVisibleMenuBar()
       
   742     {
   679     {
   743     if( CPhoneState::IsVideoCall ( iRingingCallId ) )
   680     if( CPhoneState::IsVideoCall ( iRingingCallId ) )
   744         {
   681         {
   745         return EPhoneIncomingVideoCallMenubarWithNumberEntry;
   682         return EPhoneIncomingVideoCallMenubar;
   746         }
   683         }
   747     else
   684     else
   748         {
   685         {
   749         return EPhoneIncomingCallMenubarWithNumberEntry;
       
   750         }
       
   751     }
       
   752 
       
   753 // -----------------------------------------------------------
       
   754 // CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar
       
   755 // -----------------------------------------------------------
       
   756 //
       
   757 TInt CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar()
       
   758     {
       
   759     if( CPhoneState::IsVideoCall ( iRingingCallId ) )
       
   760         {
       
   761         return EPhoneIncomingVideoCallMenubar;
       
   762         }
       
   763     else
       
   764         {
       
   765         return EPhoneIncomingCallMenubar;
   686         return EPhoneIncomingCallMenubar;
   766         }
   687         }
   767     }
       
   768 
       
   769 // -----------------------------------------------------------
       
   770 // CPhoneStateIncoming::DynInitMenuPaneL
       
   771 // -----------------------------------------------------------
       
   772 //
       
   773 EXPORT_C void CPhoneStateIncoming::DynInitMenuPaneL(
       
   774     TInt aResourceId,
       
   775     CEikMenuPane* aMenuPane )
       
   776     {
       
   777     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::DynInitMenuPaneL() ");
       
   778     __ASSERT_DEBUG( aMenuPane && aResourceId,
       
   779         Panic( EPhoneCtrlParameterNotInitialized ) );
       
   780 
       
   781     // Save the number of digits in the number entry before processing
       
   782     // the menu pane
       
   783     if ( IsNumberEntryUsedL() )
       
   784         {
       
   785         TPhoneCmdParamBoolean serviceCodeParam;
       
   786         serviceCodeParam.SetBoolean( ETrue );
       
   787         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag,
       
   788             &serviceCodeParam );
       
   789         }
       
   790 
       
   791     if ( iCustomization )
       
   792         {
       
   793         iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane);
       
   794         }
       
   795     // Process the menu pane
       
   796     TPhoneCmdParamDynMenu dynMenuPane;
       
   797     dynMenuPane.SetResourceId( aResourceId );
       
   798     dynMenuPane.SetDynMenu( aMenuPane );
       
   799     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane );
       
   800     }
   688     }
   801 
   689 
   802 // -----------------------------------------------------------
   690 // -----------------------------------------------------------
   803 // CPhoneStateIncoming::ShowDisconnectingL
   691 // CPhoneStateIncoming::ShowDisconnectingL
   804 // -----------------------------------------------------------
   692 // -----------------------------------------------------------
   818 
   706 
   819     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   707     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   820         &callHeaderParam );
   708         &callHeaderParam );
   821     }
   709     }
   822 
   710 
       
   711 // ---------------------------------------------------------
       
   712 // CPhoneStateIncoming::HandleKeyLockEnabledL
       
   713 // ---------------------------------------------------------
       
   714 //
       
   715 EXPORT_C void CPhoneStateIncoming::HandleKeyLockEnabled( TBool aKeylockEnabled )
       
   716     {
       
   717     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::HandleKeyLockEnabledL( ) ");
       
   718     if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
       
   719         && CPhoneCenRepProxy::Instance()->
       
   720             IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
       
   721         {
       
   722         if( aKeylockEnabled )
       
   723             {
       
   724             // Keylock enabled
       
   725             if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() )
       
   726                 {
       
   727                 // Disable HW Keys if needed
       
   728                 DisableHWKeysL();
       
   729                 }
       
   730             }
       
   731         else
       
   732             {
       
   733             // Keylock disabled
       
   734             // Reset blocked keys list
       
   735             iStateMachine->PhoneStorage()->ResetBlockedKeysList();
       
   736             }
       
   737         }
       
   738     }
       
   739 
   823 // End of File
   740 // End of File