phoneapp/phoneuicontrol/src/cphonestateincoming.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
equal deleted inserted replaced
76:cfea66083b62 78:baacf668fe89
    32 #include "phoneui.pan"
    32 #include "phoneui.pan"
    33 #include "cphonestateincoming.h"
    33 #include "cphonestateincoming.h"
    34 #include "tphonecmdparamboolean.h"
    34 #include "tphonecmdparamboolean.h"
    35 #include "tphonecmdparamcallheaderdata.h"
    35 #include "tphonecmdparamcallheaderdata.h"
    36 #include "tphonecmdparaminteger.h"
    36 #include "tphonecmdparaminteger.h"
    37 #include "tphonecmdparamcallstatedata.h"
       
    38 #include "tphonecmdparamringtone.h"
    37 #include "tphonecmdparamringtone.h"
    39 #include "tphonecmdparamsfidata.h"
    38 #include "tphonecmdparamsfidata.h"
    40 #include "tphonecmdparamstring.h"
    39 #include "tphonecmdparamstring.h"
    41 #include "tphonecmdparamglobalnote.h"
    40 #include "tphonecmdparamglobalnote.h"
    42 #include "tphonecmdparamdynmenu.h"
    41 #include "tphonecmdparamdynmenu.h"
    52 #include "cphonemediatorfactory.h"
    51 #include "cphonemediatorfactory.h"
    53 #include "cphonemediatorsender.h"
    52 #include "cphonemediatorsender.h"
    54 #include "cphonereleasecommand.h"
    53 #include "cphonereleasecommand.h"
    55 #include "mphonecustomization.h"
    54 #include "mphonecustomization.h"
    56 #include "mphonestorage.h"
    55 #include "mphonestorage.h"
       
    56 #include "phonecallutil.h"
    57 
    57 
    58 // ================= MEMBER FUNCTIONS =======================
    58 // ================= MEMBER FUNCTIONS =======================
    59 
    59 
    60 // C++ default constructor can NOT contain any code, that
    60 // C++ default constructor can NOT contain any code, that
    61 // might leave.
    61 // might leave.
    86 //
    86 //
    87 EXPORT_C void CPhoneStateIncoming::ConstructL()
    87 EXPORT_C void CPhoneStateIncoming::ConstructL()
    88     {
    88     {
    89     CPhoneState::BaseConstructL();
    89     CPhoneState::BaseConstructL();
    90     
    90     
    91     // Fetch incoming call's id from view
    91     // Fetch incoming call's id
    92     TPhoneCmdParamCallStateData callStateData;
    92     TInt callId = PhoneCallUtil::CallIdByState( EPEStateRinging );
    93     callStateData.SetCallState( EPEStateRinging );
    93     if( callId > KErrNotFound  )
    94     iViewCommandHandle->HandleCommandL(
       
    95         EPhoneViewGetCallIdByState, &callStateData );
       
    96     if( callStateData.CallId() > KErrNotFound  )
       
    97         {
    94         {
    98         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
    95         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
    99         iRingingCallId = callStateData.CallId();
    96         iRingingCallId = callId;
   100         }
    97         }
   101     else
    98     else
   102         {
    99         {
   103         __PHONELOG( EOnlyFatal, EPhoneControl,
   100         __PHONELOG( EOnlyFatal, EPhoneControl,
   104             "CPhoneStateIncoming::ConstructL - incoming call already in disconnecting state!");
   101             "CPhoneStateIncoming::ConstructL - incoming call already in disconnecting state!");
   320 
   317 
   321     UpdateUiCommands();
   318     UpdateUiCommands();
   322     SetBackButtonActive(ETrue);
   319     SetBackButtonActive(ETrue);
   323     EndUiUpdate();
   320     EndUiUpdate();
   324 
   321 
       
   322     if ( PhoneCallUtil::IsVideoCall( aCallId ) )
       
   323         {
       
   324         iViewCommandHandle->ExecuteCommand( EPhoneViewSetVideoCallOnTop );
       
   325         }
       
   326     
   325     iStateMachine->ChangeState( EPhoneStateSingle );
   327     iStateMachine->ChangeState( EPhoneStateSingle );
   326     }
   328     }
   327 
   329 
   328 // -----------------------------------------------------------
   330 // -----------------------------------------------------------
   329 // CPhoneStateIncoming::HandleAudioPlayStoppedL
   331 // CPhoneStateIncoming::HandleAudioPlayStoppedL
   440     {
   442     {
   441     __LOGMETHODSTARTEND(EPhoneControl,
   443     __LOGMETHODSTARTEND(EPhoneControl,
   442         "CPhoneStateIncoming::DisconnectWaitingCallL ()" );
   444         "CPhoneStateIncoming::DisconnectWaitingCallL ()" );
   443     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   445     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   444 
   446 
   445     // The ringing call might have changed
   447     // The ringing call might have changed   
   446     TPhoneCmdParamCallStateData callStateData;
   448     TInt callId = PhoneCallUtil::CallIdByState( EPEStateRinging );   
   447     callStateData.SetCallState( EPEStateRinging );
   449     if ( callId > KErrNotFound )
   448     iViewCommandHandle->HandleCommandL(
   450         {
   449         EPhoneViewGetCallIdByState, &callStateData );
   451         iRingingCallId = callId;
   450     
       
   451     if ( callStateData.CallId() > KErrNotFound )
       
   452         {
       
   453         iRingingCallId = callStateData.CallId();
       
   454         }
   452         }
   455     
   453     
   456     iStateMachine->SetCallId( iRingingCallId );
   454     iStateMachine->SetCallId( iRingingCallId );
   457 
   455 
   458     if( IsVideoCall( iRingingCallId ) )
   456     if( IsVideoCall( iRingingCallId ) )
   505         sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) );
   503         sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) );
   506         }
   504         }
   507     iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
   505     iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
   508     }
   506     }
   509 
   507 
   510 
       
   511 // -----------------------------------------------------------
       
   512 // CPhoneStateIncoming::GetNumberEntryVisibleMenuBar
       
   513 // -----------------------------------------------------------
       
   514 //
       
   515 TInt CPhoneStateIncoming::GetNumberEntryVisibleMenuBar()
       
   516     {
       
   517     TInt resource(EPhoneIncomingCallMenubarWithNumberEntry);
       
   518     if( IsVideoCall ( iRingingCallId ) )
       
   519         {
       
   520         resource = EPhoneIncomingVideoCallMenubarWithNumberEntry;
       
   521         }
       
   522     return resource;
       
   523     }
       
   524 
       
   525 // -----------------------------------------------------------
       
   526 // CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar
       
   527 // -----------------------------------------------------------
       
   528 //
       
   529 TInt CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar()
       
   530     {
       
   531     TInt resource(EPhoneIncomingCallMenubar);
       
   532     if( IsVideoCall ( iRingingCallId ) )
       
   533         {
       
   534         resource =  EPhoneIncomingVideoCallMenubar;
       
   535         }
       
   536     return resource;
       
   537     }
       
   538 
       
   539 // -----------------------------------------------------------
   508 // -----------------------------------------------------------
   540 // CPhoneStateIncoming::ShowDisconnectingL
   509 // CPhoneStateIncoming::ShowDisconnectingL
   541 // -----------------------------------------------------------
   510 // -----------------------------------------------------------
   542 //
   511 //
   543 void CPhoneStateIncoming::ShowDisconnectingL( TInt aCallId )
   512 void CPhoneStateIncoming::ShowDisconnectingL( TInt aCallId )