phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
    38 #include "tphonecmdparamquery.h"
    38 #include "tphonecmdparamquery.h"
    39 #include "tphonecmdparamglobalnote.h"
    39 #include "tphonecmdparamglobalnote.h"
    40 #include "cphonestateutilsvoip.h"
    40 #include "cphonestateutilsvoip.h"
    41 #include "cphonestatemachinevoip.h"
    41 #include "cphonestatemachinevoip.h"
    42 
    42 
       
    43 #include "easydialingcommands.hrh"
       
    44 
       
    45 
    43 // ================= MEMBER FUNCTIONS =======================
    46 // ================= MEMBER FUNCTIONS =======================
    44 
    47 
    45 // C++ default constructor can NOT contain any code, that
    48 // C++ default constructor can NOT contain any code, that
    46 // might leave.
    49 // might leave.
    47 //
    50 //
   109         "CPhoneStateSingleVoIP::HandlePhoneEngineMessageL() ")
   112         "CPhoneStateSingleVoIP::HandlePhoneEngineMessageL() ")
   110     switch ( aMessage )
   113     switch ( aMessage )
   111         {
   114         {
   112         case MEngineMonitor::EPEMessageUnattendedTransferRequest:
   115         case MEngineMonitor::EPEMessageUnattendedTransferRequest:
   113             LaunchUnattendedTransferAcceptanceQueryL();
   116             LaunchUnattendedTransferAcceptanceQueryL();
   114             break;
   117             // Forward message to phone customization 
       
   118 			CPhoneState::ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
       
   119 			break;
   115         default:
   120         default:
   116             CPhoneSingleCall::HandlePhoneEngineMessageL( 
   121             CPhoneSingleCall::HandlePhoneEngineMessageL( 
   117                 aMessage, aCallId );
   122                 aMessage, aCallId );
   118             break;
   123             break;
   119         }
   124         }
   132 
   137 
   133     switch( aCommand )
   138     switch( aCommand )
   134         {
   139         {
   135         case EPhoneNumberAcqCmdInternetCall:
   140         case EPhoneNumberAcqCmdInternetCall:
   136             StateUtils().SelectServiceAndDialL();
   141             StateUtils().SelectServiceAndDialL();
   137             break;
   142         	break;
   138         
   143      	
   139         case EPhoneNumberAcqCmdSendCommand:
   144         case EPhoneNumberAcqCmdSendCommand:
   140             StartCallingL();
   145             // If easydialing has focus, call should be initiated to focused contact.
       
   146             if ( IsDialingExtensionInFocusL() )
       
   147                 {
       
   148                 commandStatus = CPhoneSingleCall::HandleCommandL( aCommand );
       
   149                 }
       
   150             else
       
   151                 {
       
   152                 StartCallingL();
       
   153                 }
   141             break;
   154             break;
   142          
   155          
   143         case EPhoneCmdAcceptUnattendedTransfer:
   156         case EPhoneCmdAcceptUnattendedTransfer:
   144             HandleUnattendedTransferRequestResponseL( ETrue );
   157             HandleUnattendedTransferRequestResponseL( ETrue );
   145             break;
   158             break;
   175             &numberEntryCountParam );
   188             &numberEntryCountParam );
   176             TInt neLength( numberEntryCountParam.Integer() );
   189             TInt neLength( numberEntryCountParam.Integer() );
   177                  
   190                  
   178             if( IsNumberEntryVisibleL() && neLength )
   191             if( IsNumberEntryVisibleL() && neLength )
   179                 {
   192                 {
   180                 if ( IsOnScreenDialerSupported() &&  
   193                 if ( IsOnScreenDialerSupported() )
   181                      IsCustomizedDialerVisibleL()  )
       
   182                     {
   194                     {
   183                     return;
   195                     if ( IsDTMFEditorVisibleL() || 
       
   196                          IsCustomizedDialerVisibleL() )
       
   197                         {
       
   198                         return;
       
   199                         }
       
   200                     // If easydialing has focus, call should be initiated to focused contact.
       
   201                     else if ( IsDialingExtensionInFocusL() )
       
   202                         {
       
   203                         CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
       
   204                         return;
       
   205                         }
   184                     }
   206                     }
   185                     
   207                     
   186                 StartCallingL();
   208                 StartCallingL();
   187                 }
   209                 }
   188             else
   210             else
   191                 CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
   213                 CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
   192                 }
   214                 }
   193             }
   215             }
   194             break;
   216             break;
   195             
   217             
   196         default:
   218 		default:
   197             CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
   219 			CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
   198             break;
   220 			break;
   199         }
   221         }
   200     }
   222     }
   201 
   223 
   202 // -----------------------------------------------------------
   224 // -----------------------------------------------------------
   203 // CPhoneStateSingleVoIP::StartCallingL
   225 // CPhoneStateSingleVoIP::StartCallingL
   204 // -----------------------------------------------------------
   226 // -----------------------------------------------------------
   205 //
   227 //
   206 void CPhoneStateSingleVoIP::StartCallingL()
   228 void CPhoneStateSingleVoIP::StartCallingL()
   207     {
   229 	{
   208     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   230     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   209         "CPhoneStateSingleVoIP::StartCallingL()" )
   231         "CPhoneStateSingleVoIP::StartCallingL()" )
   210     
   232     
   211     TUint serviceId( 0 );
   233     TUint serviceId( 0 );
   212     CPhoneStateUtilsVoip& utililty = StateUtils();
   234     CPhoneStateUtilsVoip& utililty = StateUtils();
   213     if ( utililty.IsVoipPreferredCall( serviceId ) )
   235 	if ( utililty.IsVoipPreferredCall( serviceId ) )
   214         {
   236 		{
   215         utililty.SelectServiceAndDialL( KNullDesC, serviceId );         
   237 		utililty.SelectServiceAndDialL( KNullDesC, serviceId );			
   216         }
   238 		}
   217     else
   239 	else
   218         {
   240 		{
   219         if ( utililty.IsVoipNumber() )
   241         if ( utililty.IsVoipNumber() )
   220             {
   242             {
   221             utililty.SelectServiceAndDialL();
   243             utililty.SelectServiceAndDialL();
   222             }
   244             }
   223         else
   245         else
   243                 DialVoiceCallL();
   265                 DialVoiceCallL();
   244 
   266 
   245                 CleanupStack::PopAndDestroy( phoneNumber );
   267                 CleanupStack::PopAndDestroy( phoneNumber );
   246                 }
   268                 }
   247             }
   269             }
   248         }
   270 		}
   249     }
   271 	}
   250 
   272 
   251 // -----------------------------------------------------------
   273 // -----------------------------------------------------------
   252 // CPhoneStateSingleVoIP::LaunchUnattendedTransferAcceptanceQueryL
   274 // CPhoneStateSingleVoIP::LaunchUnattendedTransferAcceptanceQueryL
   253 // Dialog is constructed based on S60 In-Call Operations UI Specification, 
   275 // Dialog is constructed based on S60 In-Call Operations UI Specification, 
   254 // Section 2.26.
   276 // Section 2.26.
   358         iStateMachine->SendPhoneEngineMessage( 
   380         iStateMachine->SendPhoneEngineMessage( 
   359             MPEPhoneModel::EPEMessageAcceptUnattendedTransfer );
   381             MPEPhoneModel::EPEMessageAcceptUnattendedTransfer );
   360         MPEEngineInfo* info = iStateMachine->PhoneEngineInfo();
   382         MPEEngineInfo* info = iStateMachine->PhoneEngineInfo();
   361         const TPEPhoneNumber& transferTarget = 
   383         const TPEPhoneNumber& transferTarget = 
   362             info->UnattendedTransferTarget( CallId() );
   384             info->UnattendedTransferTarget( CallId() );
   363  
   385         info->SetIsTransferDial( ETrue );
   364         TUint32 serviceId = iStateMachine->PhoneEngineInfo()->
   386         TUint32 serviceId = iStateMachine->PhoneEngineInfo()->
   365             ServiceId( CallId() );
   387             ServiceId( CallId() );
   366         StateUtils().SelectServiceAndDialL( transferTarget, serviceId );
   388         StateUtils().SelectServiceAndDialL( transferTarget, serviceId );
       
   389         
       
   390         // Store transferor address to phoneengine, this is used for
       
   391         // calling back if transfer call fails for some reason
       
   392         info->SetCallBackAddress( info->RemotePhoneNumber( CallId() ) );
   367         }
   393         }
   368     else
   394     else
   369         {
   395         {
   370         iStateMachine->SendPhoneEngineMessage( 
   396         iStateMachine->SendPhoneEngineMessage( 
   371             MPEPhoneModel::EPEMessageRejectUnattendedTransfer );
   397             MPEPhoneModel::EPEMessageRejectUnattendedTransfer );
       
   398         iStateMachine->PhoneEngineInfo()->SetCallBackAddress(
       
   399             KNullDesC() );
   372         }
   400         }
   373     }
   401     }
   374 
   402 
   375 
   403 
   376 // -----------------------------------------------------------
   404 // -----------------------------------------------------------