phoneapp/phoneuistates/src/cphonesinglecall.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
equal deleted inserted replaced
76:cfea66083b62 78:baacf668fe89
    39 #include "phoneui.hrh"
    39 #include "phoneui.hrh"
    40 #include "cphonemainresourceresolver.h"
    40 #include "cphonemainresourceresolver.h"
    41 #include "phonerssbase.h"
    41 #include "phonerssbase.h"
    42 #include "phonestatedefinitionsgsm.h"
    42 #include "phonestatedefinitionsgsm.h"
    43 #include "tphonecmdparamglobalnote.h"
    43 #include "tphonecmdparamglobalnote.h"
    44 #include "tphonecmdparamcallstatedata.h"
       
    45 #include "phonelogger.h"
    44 #include "phonelogger.h"
    46 #include "cphonepubsubproxy.h"
    45 #include "cphonepubsubproxy.h"
    47 #include "cphonemediatorfactory.h"
    46 #include "cphonemediatorfactory.h"
    48 #include "cphonemediatorsender.h"
    47 #include "cphonemediatorsender.h"
    49 #include "mphonestorage.h"
    48 #include "mphonestorage.h"
    50 #include "cphonecenrepproxy.h"
    49 #include "cphonecenrepproxy.h"
       
    50 #include "phonecallutil.h"
    51 
    51 
    52 // ================= MEMBER FUNCTIONS =======================
    52 // ================= MEMBER FUNCTIONS =======================
    53 
    53 
    54 // C++ default constructor can NOT contain any code, that
    54 // C++ default constructor can NOT contain any code, that
    55 // might leave.
    55 // might leave.
    81     TPhoneCmdParamBoolean globalNotifierParam;
    81     TPhoneCmdParamBoolean globalNotifierParam;
    82     globalNotifierParam.SetBoolean( EFalse );
    82     globalNotifierParam.SetBoolean( EFalse );
    83     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
    83     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
    84         &globalNotifierParam );
    84         &globalNotifierParam );
    85     
    85     
    86     TPhoneCmdParamCallStateData callStateData;
    86     TInt callId = PhoneCallUtil::CallIdByState( EPEStateConnected );
    87     callStateData.SetCallState( EPEStateConnected );
       
    88     iViewCommandHandle->HandleCommandL(
       
    89         EPhoneViewGetCallIdByState, &callStateData );
       
    90     
       
    91     // No connected call, 
    87     // No connected call, 
    92     if( callStateData.CallId() == KErrNotFound )
    88     if( callId == KErrNotFound )
    93         {
    89         {
    94         //find the held call.
    90         //find the held call.
    95         callStateData.SetCallState( EPEStateHeld );
    91         callId = PhoneCallUtil::CallIdByState( EPEStateHeld );
    96         iViewCommandHandle->HandleCommandL(
    92         if ( callId == KErrNotFound ) 
    97             EPhoneViewGetCallIdByState, &callStateData );
       
    98         // No held call.
       
    99         if ( callStateData.CallId() == KErrNotFound ) 
       
   100             {
    93             {
   101             // find the disconnected call.
    94             // find the disconnected call.
   102             callStateData.SetCallState( EPEStateDisconnecting );
    95             callId = PhoneCallUtil::CallIdByState( EPEStateDisconnecting );  
   103             iViewCommandHandle->HandleCommandL(
       
   104                     EPhoneViewGetCallIdByState, &callStateData );    
       
   105             }
    96             }
   106         }
    97         }
   107     iCallId = callStateData.CallId();      
    98     iCallId = callId;      
   108     }
    99     }
   109 
   100 
   110 // -----------------------------------------------------------
   101 // -----------------------------------------------------------
   111 // CPhoneSingleCall::NewL()
   102 // CPhoneSingleCall::NewL()
   112 // Constructor
   103 // Constructor