phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
    20 #include <eikmenup.h>
    20 #include <eikmenup.h>
    21 #include <spsettings.h>
    21 #include <spsettings.h>
    22 #include <spentry.h>
    22 #include <spentry.h>
    23 #include <spproperty.h>
    23 #include <spproperty.h>
    24 #include <mpeengineinfo.h>
    24 #include <mpeengineinfo.h>
    25 // <-- QT PHONE START -->
       
    26 //#include <bmbubblemanager.h>
       
    27 // <-- QT PHONE END -->
       
    28 // <-- QT PHONE START --> 
       
    29 //#include <phoneui.rsg>
       
    30 #include "phoneresourceids.h"
    25 #include "phoneresourceids.h"
    31 //#include <phoneui.rsg>
       
    32 //#include <phoneuivoip.rsg>
       
    33 // <-- QT PHONE END --> 
       
    34 #include <avkon.rsg>
    26 #include <avkon.rsg>
    35 #include <StringLoader.h>
    27 #include <StringLoader.h>
    36 #include <featmgr.h>
    28 #include <featmgr.h>
    37 
    29 
    38 #include "cphonecustomizationvoip.h"
    30 #include "cphonecustomizationvoip.h"
    59 #include "cphoneviewcustomizationvoip.h"
    51 #include "cphoneviewcustomizationvoip.h"
    60 #include "cphonestateutilsvoip.h"
    52 #include "cphonestateutilsvoip.h"
    61 #include "cphoneunattendedtransfercmdhandler.h"
    53 #include "cphoneunattendedtransfercmdhandler.h"
    62 #include "tphonecmdparampointer.h"
    54 #include "tphonecmdparampointer.h"
    63 #include "cphonenewcallcmdhandler.h"
    55 #include "cphonenewcallcmdhandler.h"
    64 // <-- QT PHONE START -->
       
    65 //#include "cphonevcchandler.h"
       
    66 // <-- QT PHONE END -->
       
    67 #include "cphonecallforwardqueryhandler.h"
    56 #include "cphonecallforwardqueryhandler.h"
    68 #include "cphonekeys.h"
    57 #include "cphonekeys.h"
    69 
    58 
    70 // CONSTANTS
    59 // CONSTANTS
    71 const TInt KMaxLengthForSIPURIFirstLine = 15;
    60 const TInt KMaxLengthForSIPURIFirstLine = 15;
    99     delete iCallForwardHandler;
    88     delete iCallForwardHandler;
   100     delete iExtensionHandler;
    89     delete iExtensionHandler;
   101     delete iPhoneViewCustomization;
    90     delete iPhoneViewCustomization;
   102     delete iTransferCmdHandler;
    91     delete iTransferCmdHandler;
   103     delete iNewCallCmdHandler;
    92     delete iNewCallCmdHandler;
   104     // <-- QT PHONE START -->
       
   105     //delete iVccHandler;
       
   106     // <-- QT PHONE END -->
       
   107     }
    93     }
   108 
    94 
   109 
    95 
   110 // -----------------------------------------------------------
    96 // -----------------------------------------------------------
   111 // CPhoneCustomizationVoip::ConstructL()
    97 // CPhoneCustomizationVoip::ConstructL()
   136     iTransferCmdHandler = CPhoneUnattendedTransferCmdHandler::NewL( 
   122     iTransferCmdHandler = CPhoneUnattendedTransferCmdHandler::NewL( 
   137         iStateMachine, iViewCommandHandle );
   123         iStateMachine, iViewCommandHandle );
   138         
   124         
   139     iNewCallCmdHandler = CPhoneNewCallCmdHandler::NewL( 
   125     iNewCallCmdHandler = CPhoneNewCallCmdHandler::NewL( 
   140         iStateMachine, iViewCommandHandle );
   126         iStateMachine, iViewCommandHandle );
   141     
   127         
   142     // <-- QT PHONE START -->    
       
   143     /*if ( FeatureManager::FeatureSupported( KFeatureIdFfVoiceCallContinuity ) )
       
   144         {
       
   145         iVccHandler = CPhoneVccHandler::NewL( iStateMachine, iViewCommandHandle );
       
   146         }*/
       
   147     // <-- QT PHONE END -->
       
   148     
       
   149     iCallForwardHandler = CPhoneCallForwardQueryHandler::NewL( 
   128     iCallForwardHandler = CPhoneCallForwardQueryHandler::NewL( 
   150         iStateMachine, iViewCommandHandle );
   129         iStateMachine, iViewCommandHandle );
   151     }
   130     }
   152 
   131 
   153 
   132 
   321                 {
   300                 {
   322                 if ( KNullDesC() != engineInfo.RemotePartyName( aCallId ) )
   301                 if ( KNullDesC() != engineInfo.RemotePartyName( aCallId ) )
   323                     {
   302                     {
   324                     // Telephone UI specification, 4.2.1 Call identification:
   303                     // Telephone UI specification, 4.2.1 Call identification:
   325                     // display name is used as the CLI if available.
   304                     // display name is used as the CLI if available.
   326 // <-- QT PHONE START --> 
       
   327                     aCommandParam->SetCLIText( 
   305                     aCommandParam->SetCLIText( 
   328                         engineInfo.RemotePartyName( aCallId ), 
   306                         engineInfo.RemotePartyName( aCallId ), 
   329                         TPhoneCmdParamCallHeaderData::ERight );
   307                         TPhoneCmdParamCallHeaderData::ERight );
   330 // <-- QT PHONE END --> 
       
   331                     // use line reserved for CNAP to show SIP URI
   308                     // use line reserved for CNAP to show SIP URI
   332                     aCommandParam->SetCNAPText( 
   309                     aCommandParam->SetCNAPText( 
   333                         engineInfo.RemotePhoneNumber( aCallId ), 
   310                         engineInfo.RemotePhoneNumber( aCallId ), 
   334 // <-- QT PHONE START -->
       
   335 //                        CBubbleManager::ERight
       
   336                         TPhoneCmdParamCallHeaderData::ERight
   311                         TPhoneCmdParamCallHeaderData::ERight
   337 // <-- QT PHONE END -->
       
   338                        );
   312                        );
   339                     }
   313                     }
   340                 else
   314                 else
   341                     {
   315                     {
   342                     TBuf<KMaxLengthForSIPURI> sipURI;
   316                     TBuf<KMaxLengthForSIPURI> sipURI;
   344                     HandleURIFittingToCallBubble( 
   318                     HandleURIFittingToCallBubble( 
   345                         aCommandParam->CLIText(),
   319                         aCommandParam->CLIText(),
   346                         sipURI,
   320                         sipURI,
   347                         sipURIDomainPart );
   321                         sipURIDomainPart );
   348                     
   322                     
   349 // <-- QT PHONE START --> 
       
   350                     aCommandParam->SetCLIText( sipURI, TPhoneCmdParamCallHeaderData::ERight );
   323                     aCommandParam->SetCLIText( sipURI, TPhoneCmdParamCallHeaderData::ERight );
   351 // <-- QT PHONE END --> 
       
   352                     aCommandParam->SetCNAPText( sipURIDomainPart,
   324                     aCommandParam->SetCNAPText( sipURIDomainPart,
   353 // <-- QT PHONE START -->
       
   354 //                        CBubbleManager::ERight );
       
   355                         TPhoneCmdParamCallHeaderData::ERight );
   325                         TPhoneCmdParamCallHeaderData::ERight );
   356 // <-- QT PHONE END -->
       
   357                     }
   326                     }
   358                 }
   327                 }
   359             else
   328             else
   360                 {
   329                 {
   361                 if ( KNullDesC() == engineInfo.RemotePartyName( aCallId ) )
   330                 if ( KNullDesC() == engineInfo.RemotePartyName( aCallId ) )
   362                     {
   331                     {
   363                     // Display name not available, set incall number text as a
   332                     // Display name not available, set incall number text as a
   364                     // CLI text. Text could be 'Call 1', 'Call 2', ...
   333                     // CLI text. Text could be 'Call 1', 'Call 2', ...
   365 // <-- QT PHONE START --> 
       
   366                     aCommandParam->SetCLIText( aInCallNumberText,
   334                     aCommandParam->SetCLIText( aInCallNumberText,
   367                         TPhoneCmdParamCallHeaderData::ERight );
   335                         TPhoneCmdParamCallHeaderData::ERight );
   368 // <-- QT PHONE END --> 
       
   369                     // change clipping direction of CNAP text
       
   370                     aCommandParam->SetCNAPText( 
   336                     aCommandParam->SetCNAPText( 
   371                         aCommandParam->CNAPText(),
   337                         aCommandParam->CNAPText(),
   372 // <-- QT PHONE START -->
       
   373 //                        CBubbleManager::ERight );
       
   374                         TPhoneCmdParamCallHeaderData::ERight );
   338                         TPhoneCmdParamCallHeaderData::ERight );
   375 // <-- QT PHONE END -->
       
   376                     }
   339                     }
   377                 }
   340                 }
   378             }
   341             }
   379         }
   342         }
   380     }
   343     }
   438             handled = ETrue;
   401             handled = ETrue;
   439             }
   402             }
   440             break;
   403             break;
   441             
   404             
   442         case EPhoneCmdHandoverToGsm:
   405         case EPhoneCmdHandoverToGsm:
   443             // <-- QT PHONE START -->
       
   444             //iVccHandler->StartManualHandoverL( EPhoneVoIPWaitHandoverFromWlan );
       
   445             // <-- QT PHONE END -->
       
   446             handled = ETrue;
   406             handled = ETrue;
   447             break;
   407             break;
   448 
   408 
   449         
   409         
   450         case EPhoneCmdHandoverToWlan:
   410         case EPhoneCmdHandoverToWlan:
   451             // <-- QT PHONE START -->
       
   452             //iVccHandler->StartManualHandoverL( EPhoneVoIPWaitHandoverFromGsm );
       
   453             // <-- QT PHONE END -->
       
   454             handled = ETrue;
   411             handled = ETrue;
   455             break;
   412             break;
   456             
   413             
   457         default:
   414         default:
   458             {
   415             {
   651 // -----------------------------------------------------------
   608 // -----------------------------------------------------------
   652 // From class MPhoneButtonCustomization.
   609 // From class MPhoneButtonCustomization.
   653 // CPhoneCustomizationVoip::CustomizeTouchPaneButtons
   610 // CPhoneCustomizationVoip::CustomizeTouchPaneButtons
   654 // -----------------------------------------------------------
   611 // -----------------------------------------------------------
   655 //
   612 //
   656 // <-- QT PHONE START --> 
   613 void CPhoneCustomizationVoip::CustomizeTouchPaneButtons()
   657 void CPhoneCustomizationVoip::CustomizeTouchPaneButtons(
       
   658         /*MBubbleTouchPaneInterface& aTouchPane*/ )
       
   659     {
   614     {
   660     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   615     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   661         "CPhoneCustomizationVoip::CustomizeTouchPaneButtons" );
   616         "CPhoneCustomizationVoip::CustomizeTouchPaneButtons" );
   662     
   617     }
   663     /*TRAPD( err, CustomizeTouchPaneUsingExtensionL( aTouchPane ) );
       
   664     
       
   665     if ( KErrNone != err )
       
   666         {
       
   667         // Extension plugin didn't handle touch pane dimming.
       
   668         TInt buttonCount = aTouchPane.NumberOfButtonsInPane();
       
   669             
       
   670         for ( TInt i=0; i < buttonCount; i++ )    
       
   671             {
       
   672             TInt commandId = aTouchPane.ButtonCommandId( i );
       
   673         
       
   674             switch ( commandId )
       
   675                 {              
       
   676                 case EPhoneInCallCmdCreateConference:
       
   677                 case EPhoneInCallCmdJoin:
       
   678                     {
       
   679                     if ( !IsFeatureSupported( EFeatureConference ) )
       
   680                         {
       
   681                         // Conference not supported -> set item dimmed
       
   682                         aTouchPane.SetButtonDimmed( commandId, ETrue );
       
   683                         }               
       
   684                     break;  
       
   685                     }
       
   686                 default:
       
   687                     break;                    
       
   688                 } // switch
       
   689             } // for    
       
   690         }*/
       
   691     }
       
   692 // <-- QT PHONE END --> 
       
   693 
   618 
   694 // -----------------------------------------------------------
   619 // -----------------------------------------------------------
   695 // CPhoneCustomizationVoip::VoIPSupportedL
   620 // CPhoneCustomizationVoip::VoIPSupportedL
   696 // -----------------------------------------------------------
   621 // -----------------------------------------------------------
   697 //
   622 //
  1138     CleanupStack::PopAndDestroy( &array );
  1063     CleanupStack::PopAndDestroy( &array );
  1139 
  1064 
  1140     return supported;
  1065     return supported;
  1141     }
  1066     }
  1142 
  1067 
  1143 
       
  1144 // -----------------------------------------------------------
       
  1145 // CPhoneCustomizationVoip::CustomizeTouchPaneUsingExtensionL
       
  1146 // -----------------------------------------------------------
       
  1147 //
       
  1148 // <-- QT PHONE START --> 
       
  1149 /*void CPhoneCustomizationVoip::CustomizeTouchPaneUsingExtensionL(
       
  1150         MBubbleTouchPaneInterface& aTouchPane )
       
  1151     {
       
  1152     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
       
  1153         "CPhoneCustomizationVoip::CustomizeTouchPaneUsingExtensionL" );
       
  1154     
       
  1155     RArray<CTelMenuExtension::TCallInfo> array;
       
  1156     CleanupClosePushL( array );
       
  1157     
       
  1158     GetActiveCallArrayL( array );
       
  1159 
       
  1160     // Use extensions for touch pane buttons dimming 
       
  1161     iExtensionHandler->CustomizeTouchPaneButtonsL(
       
  1162             ServiceIdForActivestCallL( array ),
       
  1163             array,
       
  1164             aTouchPane );
       
  1165     
       
  1166     __PHONELOG( EBasic, PhoneUIVoIPExtension,
       
  1167         "CPhoneCustomizationVoip::ModifyInCallMenuL() plugin exists" );
       
  1168     
       
  1169     CleanupStack::PopAndDestroy( &array );    
       
  1170     }*/
       
  1171 // <-- QT PHONE END --> 
       
  1172 
       
  1173 // -----------------------------------------------------------
  1068 // -----------------------------------------------------------
  1174 // CPhoneCustomizationVoip::LaunchEnablingServiceNoteL
  1069 // CPhoneCustomizationVoip::LaunchEnablingServiceNoteL
  1175 // -----------------------------------------------------------
  1070 // -----------------------------------------------------------
  1176 //
  1071 //
  1177 void CPhoneCustomizationVoip::LaunchEnablingServiceNoteL()
  1072 void CPhoneCustomizationVoip::LaunchEnablingServiceNoteL()
  1199         EPhoneVoIPEnablingServiceWaitNoteText ), serviceName ) );
  1094         EPhoneVoIPEnablingServiceWaitNoteText ), serviceName ) );
  1200     
  1095     
  1201     queryParam.SetDataText( &noteText );  
  1096     queryParam.SetDataText( &noteText );  
  1202     queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_CANCEL );
  1097     queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_CANCEL );
  1203     
  1098     
  1204     // <-- QT PHONE START -->
       
  1205     const TInt KEnableServiceTimeOutInMilliSecs = 60000;
  1099     const TInt KEnableServiceTimeOutInMilliSecs = 60000;
  1206     queryParam.SetTimeOut( KEnableServiceTimeOutInMilliSecs );
  1100     queryParam.SetTimeOut( KEnableServiceTimeOutInMilliSecs );
  1207     // <-- QT PHONE END -->
  1101 
  1208     // configure custom command mappings for user responses
  1102     // configure custom command mappings for user responses
  1209     queryParam.SetCbaCommandMapping( 
  1103     queryParam.SetCbaCommandMapping( 
  1210         EAknSoftkeyCancel, EPhoneCmdCancelServiceEnabling );
  1104         EAknSoftkeyCancel, EPhoneCmdCancelServiceEnabling );
  1211     queryParam.SetCbaCommandMapping( 
  1105     queryParam.SetCbaCommandMapping( 
  1212         KErrCancel, EPhoneCmdCancelServiceEnabling );
  1106         KErrCancel, EPhoneCmdCancelServiceEnabling );
  1409 void CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL( TInt /*aResourceId*/,
  1303 void CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL( TInt /*aResourceId*/,
  1410         CEikMenuPane& /*aMenuPane*/ )
  1304         CEikMenuPane& /*aMenuPane*/ )
  1411     {
  1305     {
  1412     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
  1306     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
  1413         "CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL" );
  1307         "CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL" );
  1414     
       
  1415     // Menu items to be added
       
  1416     // <-- QT PHONE START -->
       
  1417     /*if ( iVccHandler && AllowAlphaNumericMode() &&
       
  1418         ( aResourceId == R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU ||
       
  1419           aResourceId == R_PHONEUI_CALLWAITING_OPTIONS_MENU ||
       
  1420           aResourceId == R_PHONEUI_ACTIVEANDHELDCALL_OPTIONS_MENU ||
       
  1421           aResourceId == R_PHONEUI_ACTIVEANDHELDCONFCALL_OPTIONS_MENU ||
       
  1422           aResourceId == R_PHONEUI_CALLACTIVEHELDANDWAITING_OPTIONS_MENU 
       
  1423         ))
       
  1424         {        
       
  1425         RArray<CTelMenuExtension::TCallInfo> array;
       
  1426         CleanupClosePushL( array );
       
  1427         GetActiveCallArrayL( array );
       
  1428         
       
  1429         iVccHandler->AddHandoverMenuItemL( array, aResourceId, aMenuPane );
       
  1430         CleanupStack::PopAndDestroy( &array );   
       
  1431         }*/
       
  1432     // <-- QT PHONE END -->
       
  1433     }
  1308     }
  1434     
  1309     
  1435 // -----------------------------------------------------------
  1310 // -----------------------------------------------------------
  1436 // CPhoneCustomizationVoip::GetVoIPServiceIdsL
  1311 // CPhoneCustomizationVoip::GetVoIPServiceIdsL
  1437 // -----------------------------------------------------------
  1312 // -----------------------------------------------------------