phoneapp/phoneuivoipextension/src/cphoneunattendedtransfercmdhandler.cpp
branchRCL_3
changeset 7 544e34b3255a
parent 2 c84cf270c54f
child 9 91c2fb4b78df
equal deleted inserted replaced
6:38529f706030 7:544e34b3255a
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <featmgr.h>
    18 #include <featmgr.h>
    19 #include <mpeengineinfo.h>
    19 #include <mpeengineinfo.h>
       
    20 #include <StringLoader.h>
       
    21 
    20 #include "cphoneunattendedtransfercmdhandler.h"
    22 #include "cphoneunattendedtransfercmdhandler.h"
    21 
    23 
    22 #include "cphonelogger.h"
    24 #include "cphonelogger.h"
    23 #include "mphonestatemachine.h"
    25 #include "mphonestatemachine.h"
    24 #include "cphonetransferdialercontroller.h"
    26 #include "cphonetransferdialercontroller.h"
    30 #include "tphonecmdparaminteger.h"
    32 #include "tphonecmdparaminteger.h"
    31 #include "tphonecmdparamstring.h"
    33 #include "tphonecmdparamstring.h"
    32 #include "tphonecmdparamquery.h"
    34 #include "tphonecmdparamquery.h"
    33 #include "tphonecmdparamglobalnote.h"
    35 #include "tphonecmdparamglobalnote.h"
    34 #include "cphonemainresourceresolver.h"
    36 #include "cphonemainresourceresolver.h"
       
    37 #include "cphonestatemachinevoip.h"
       
    38 #include "cphonestateutilsvoip.h"
       
    39 
    35 
    40 
    36 
    41 
    37 // ======== MEMBER FUNCTIONS ========
    42 // ======== MEMBER FUNCTIONS ========
    38 
    43 
    39 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
   145                 {
   150                 {
   146                 ShowWaitingAcceptanceNoteL();
   151                 ShowWaitingAcceptanceNoteL();
   147                 }
   152                 }
   148             }
   153             }
   149             break;
   154             break;
   150         
   155         case EPhoneCmdUnattendedTransferCallBackOk:
       
   156             {
       
   157             MPEEngineInfo* info = iStateMachine.PhoneEngineInfo();
       
   158             const TDesC& callBackToAddr = info->CallBackAddress();
       
   159             // Service id used for last call is used to call back
       
   160             TUint32 serviceId = info->ServiceIdCommand();
       
   161             static_cast<CPhoneStateMachineVoIP&>( 
       
   162                 iStateMachine ).StateUtils().SelectServiceAndDialL( 
       
   163                     callBackToAddr, serviceId );
       
   164             }
       
   165             break;
       
   166         case EPhoneCmdUnattendedTransferCallBackCancel:
       
   167             {
       
   168             MPEEngineInfo* info = iStateMachine.PhoneEngineInfo();
       
   169             info->SetCallBackAddress( KNullDesC );
       
   170             }
       
   171             break;
   151         default:
   172         default:
   152             __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, 
   173             __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, 
   153                 "CPhoneUnattendedTransferCmdHandler::HandleCommandL, DEFAULT" );    
   174                 "CPhoneUnattendedTransferCmdHandler::HandleCommandL, DEFAULT" );    
   154             ASSERT( EFalse );
   175             ASSERT( EFalse );
   155         }
   176         }
   320     globalNoteParam.SetTextResourceId( CPhoneMainResourceResolver::Instance()->
   341     globalNoteParam.SetTextResourceId( CPhoneMainResourceResolver::Instance()->
   321         ResolveResourceID( EPhoneVoIPWaitingAcceptanceNote ) );
   342         ResolveResourceID( EPhoneVoIPWaitingAcceptanceNote ) );
   322     iViewCommandHandle.ExecuteCommandL( 
   343     iViewCommandHandle.ExecuteCommandL( 
   323         EPhoneViewShowGlobalNote, &globalNoteParam );
   344         EPhoneViewShowGlobalNote, &globalNoteParam );
   324     }
   345     }
       
   346 
       
   347 // ---------------------------------------------------------------------------
       
   348 // CPhoneUnattendedTransferCmdHandler::LaunchCallBackQuery
       
   349 // ---------------------------------------------------------------------------
       
   350 //
       
   351 void CPhoneUnattendedTransferCmdHandler::LaunchCallBackQueryL()
       
   352     {
       
   353     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
       
   354           "CPhoneUnattendedTransferCmdHandler::LaunchCallBackQueryL() ")
       
   355     MPEEngineInfo* info = iStateMachine.PhoneEngineInfo();
       
   356     const TDesC& callBackToAddr = info->CallBackAddress();
       
   357     // We cannot do call back if original call had private address
       
   358     if ( callBackToAddr.Compare( KNullDesC ) == 0 )
       
   359         {
       
   360         return;
       
   361         }
       
   362           
       
   363     TPhoneCmdParamQuery queryParam;
       
   364     queryParam.SetQueryType( EPhoneGlobalMsgQuery );
       
   365     
       
   366     HBufC* msgHeader = 
       
   367       StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()->
       
   368           ResolveResourceID( EPhoneVoIPTransferCallBackHeader ) );
       
   369     queryParam.SetQueryPrompt( *msgHeader );
       
   370          
       
   371     HBufC* queryText = 
       
   372       StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()->
       
   373           ResolveResourceID( 
       
   374                   EPhoneVoIPTransferCallBackText ), callBackToAddr );
       
   375     
       
   376     queryParam.SetDataText( &queryText->Des() );
       
   377     
       
   378     queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_OK_CANCEL );
       
   379     
       
   380     // configure custom command mappings for user responses
       
   381     queryParam.SetCbaCommandMapping( 
       
   382       EAknSoftkeyOk, EPhoneCmdUnattendedTransferCallBackOk );
       
   383     queryParam.SetCbaCommandMapping( 
       
   384       EAknSoftkeyCancel, EPhoneCmdUnattendedTransferCallBackCancel );
       
   385     
       
   386     iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
       
   387     
       
   388     CleanupStack::PopAndDestroy( queryText );
       
   389     CleanupStack::PopAndDestroy( msgHeader );
       
   390     }