phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp
branchRCL_3
changeset 3 8871b09be73b
parent 0 5f000ab63145
child 7 544e34b3255a
equal deleted inserted replaced
2:c84cf270c54f 3:8871b09be73b
    26 #include <phoneui.rsg>
    26 #include <phoneui.rsg>
    27 #include <avkon.rsg>
    27 #include <avkon.rsg>
    28 #include <phoneuivoip.rsg>
    28 #include <phoneuivoip.rsg>
    29 #include <StringLoader.h>
    29 #include <StringLoader.h>
    30 #include <featmgr.h>
    30 #include <featmgr.h>
       
    31 #include <centralrepository.h>
       
    32 #include <easydialingcrkeys.h>
    31 
    33 
    32 #include "cphonecustomizationvoip.h"
    34 #include "cphonecustomizationvoip.h"
    33 #include "tphonecmdparaminteger.h"
    35 #include "tphonecmdparaminteger.h"
    34 #include "tphonecmdparamboolean.h"
    36 #include "tphonecmdparamboolean.h"
    35 #include "tphonecmdparamstring.h"
    37 #include "tphonecmdparamstring.h"
   205         {
   207         {
   206         switch( menuItemArray[ i ] )
   208         switch( menuItemArray[ i ] )
   207             {
   209             {
   208             case EPhoneDialerCmdTouchInput:
   210             case EPhoneDialerCmdTouchInput:
   209                 {
   211                 {
   210                 if ( !AllowAlphaNumericMode() )
   212                 if ( !VoIPSupportedL() )
   211                     {
   213                     {
   212                     menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
   214                     menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
   213                     }
   215                     }
   214                 break;
   216                 break;
   215                 }
   217                 }
   230                 break;
   232                 break;
   231                 }
   233                 }
   232             case EPhoneInCallCmdNewCall:
   234             case EPhoneInCallCmdNewCall:
   233                 {
   235                 {
   234                 if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) &&
   236                 if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) &&
   235                      AllowAlphaNumericMode() &&
   237                      VoIPSupportedL() &&
   236                      R_PHONEUI_NEW_CALL_MENU_VOIP != aResourceId )
   238                      R_PHONEUI_NEW_CALL_MENU_VOIP != aResourceId )
   237                     {
   239                     {
   238                         
   240                         
   239                     menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
   241                     menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
   240                     
   242                     
   455     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   457     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   456         "CPhoneCustomizationVoip::AllowAlphaNumericMode" );
   458         "CPhoneCustomizationVoip::AllowAlphaNumericMode" );
   457     
   459     
   458     TBool alphaModeSupported( EFalse );
   460     TBool alphaModeSupported( EFalse );
   459     TRAP_IGNORE( alphaModeSupported = VoIPSupportedL() );
   461     TRAP_IGNORE( alphaModeSupported = VoIPSupportedL() );
       
   462 
       
   463     if ( !alphaModeSupported )
       
   464         {
       
   465         alphaModeSupported = EasyDialingEnabled();
       
   466         }
   460     
   467     
   461     return alphaModeSupported;
   468     return alphaModeSupported;
   462     }
   469     }
   463 
   470 
   464 
   471 
   678     delete serviceProviderSettings;
   685     delete serviceProviderSettings;
   679     
   686     
   680     return voipSupported;   
   687     return voipSupported;   
   681     }
   688     }
   682 
   689 
       
   690 // -----------------------------------------------------------
       
   691 // CPhoneCustomizationVoip::EasyDialingEnabled
       
   692 // -----------------------------------------------------------
       
   693 //
       
   694 TBool CPhoneCustomizationVoip::EasyDialingEnabled()
       
   695     {
       
   696     __LOGMETHODSTARTEND( PhoneUIVoIPExtension,
       
   697             "CPhoneCustomizationVoip::EasyDialingEnabled" );
       
   698 
       
   699     TBool easyDialingEnabled( EFalse );
       
   700     if ( FeatureManager::FeatureSupported( KFeatureIdProductIncludesHomeScreenEasyDialing ) )
       
   701         {
       
   702         TInt easyDialingSetting;
       
   703         TInt err = CPhoneCenRepProxy::Instance()->GetInt(
       
   704                 KCRUidEasyDialSettings,
       
   705                 KEasyDialing,
       
   706                 easyDialingSetting);
       
   707         if ( !err && easyDialingSetting )
       
   708             {
       
   709             easyDialingEnabled = ETrue;
       
   710             }
       
   711         }
       
   712     return easyDialingEnabled;
       
   713     }
   683 
   714 
   684 // -----------------------------------------------------------
   715 // -----------------------------------------------------------
   685 // CPhoneCustomizationVoip::ModifyInCallMenuL
   716 // CPhoneCustomizationVoip::ModifyInCallMenuL
   686 // -----------------------------------------------------------
   717 // -----------------------------------------------------------
   687 //
   718 //
   774                 ResolveResourceID( EPhoneVoIPCallTypeInternet ) );
   805                 ResolveResourceID( EPhoneVoIPCallTypeInternet ) );
   775         }
   806         }
   776 
   807 
   777     HBufC* phoneNumber = PhoneNumberFromEntryLC();
   808     HBufC* phoneNumber = PhoneNumberFromEntryLC();
   778 
   809 
       
   810     TInt index(KErrNotFound);
       
   811 
   779     if ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU )
   812     if ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU )
   780         {
   813         {
   781         if ( !CPhoneKeys::Validate( phoneNumber->Des() ) )
   814         if ( !CPhoneKeys::Validate( phoneNumber->Des() ) )
   782             {
   815             {        
   783             TInt index(KErrNotFound);
       
   784             if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
   816             if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
   785                 {
   817                 {
   786                 aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdCall );
   818                 aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdCall );
   787                 }
   819                 }
   788             
   820             
   792                 }
   824                 }
   793             }
   825             }
   794         
   826         
   795         aMenuPane.AddMenuItemL( voipMenuItem->iData );
   827         aMenuPane.AddMenuItemL( voipMenuItem->iData );
   796         }
   828         }
   797     else if ( iStateMachine.PhoneEngineInfo()->PhoneNumberIsServiceCode() )
   829     else if ( !aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
   798         {
   830         {
   799         // When user writes string recognized as service code (eg.*#31# -> clir off)
   831         // Call menu is removed if user inserts anything that is not
   800         // call menu is not visible. Internet call must still be possible so 
   832         // a valid cs number, so must add Internet call option here where
   801         // internet call option is added here to the menu.
   833         // we know that voip is however supported.
   802         
   834     
   803         // If number entry is empty don't add internet call option 
   835         // If number entry is empty don't add internet call option 
   804         if ( phoneNumber->Length() )
   836         if ( phoneNumber->Length() )
   805             {
   837             {
   806             // Internet call item must be on the top of the menu
   838             // Internet call item must be on the top of the menu
   807             aMenuPane.InsertMenuItemL( voipMenuItem->iData, 0 );
   839             aMenuPane.InsertMenuItemL( voipMenuItem->iData, 0 );
  1087     for( TInt i = 0; i < array.Count(); i++ )
  1119     for( TInt i = 0; i < array.Count(); i++ )
  1088         {
  1120         {
  1089         if( array[i].iCallState == CTelMenuExtension::EOutgoing ||
  1121         if( array[i].iCallState == CTelMenuExtension::EOutgoing ||
  1090             array[i].iCallState == CTelMenuExtension::EActive ||
  1122             array[i].iCallState == CTelMenuExtension::EActive ||
  1091             array[i].iCallState == CTelMenuExtension::EOnHold )
  1123             array[i].iCallState == CTelMenuExtension::EOnHold )
  1092             {
  1124             {              
       
  1125             if( aFeature == EFeatureTransfer &&
       
  1126                 array[i].iCallState == CTelMenuExtension::EOutgoing &&
       
  1127                 array[i].iCallType == CTelMenuExtension::EPsVoice  )
       
  1128                 {
       
  1129                 // If there is outgoing VoIP call then transfer is not supported
       
  1130                 supported = EFalse;
       
  1131                 break;
       
  1132                 }
       
  1133             
  1093             if( firstCallType == CTelMenuExtension::EUninitialized )
  1134             if( firstCallType == CTelMenuExtension::EUninitialized )
  1094                 {
  1135                 {
  1095                 // Memorize first found call type
  1136                 // Memorize first found call type
  1096                 firstCallType = array[i].iCallType;
  1137                 firstCallType = array[i].iCallType;
  1097                 }
  1138                 }
  1378     {
  1419     {
  1379     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
  1420     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
  1380         "CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL" );
  1421         "CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL" );
  1381     
  1422     
  1382     // Menu items to be added
  1423     // Menu items to be added
  1383     if ( iVccHandler && AllowAlphaNumericMode() &&
  1424     if ( iVccHandler && VoIPSupportedL() &&
  1384         ( aResourceId == R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU ||
  1425         ( aResourceId == R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU ||
  1385           aResourceId == R_PHONEUI_CALLWAITING_OPTIONS_MENU ||
  1426           aResourceId == R_PHONEUI_CALLWAITING_OPTIONS_MENU ||
  1386           aResourceId == R_PHONEUI_ACTIVEANDHELDCALL_OPTIONS_MENU ||
  1427           aResourceId == R_PHONEUI_ACTIVEANDHELDCALL_OPTIONS_MENU ||
  1387           aResourceId == R_PHONEUI_ACTIVEANDHELDCONFCALL_OPTIONS_MENU ||
  1428           aResourceId == R_PHONEUI_ACTIVEANDHELDCONFCALL_OPTIONS_MENU ||
  1388           aResourceId == R_PHONEUI_CALLACTIVEHELDANDWAITING_OPTIONS_MENU 
  1429           aResourceId == R_PHONEUI_CALLACTIVEHELDANDWAITING_OPTIONS_MENU