phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 22 6bb1b21d2484
parent 45 6b911d05207e
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
    70     const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ));
    70     const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ));
    71     
    71     
    72     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli );
    72     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli );
    73     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine );
    73     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine );
    74     
    74     
    75     if ( !cli && !cnap && ( numberType != EPEPrivateNumber ) )
    75     if ( !cli && !cnap && numberType != EPEPrivateNumber && numberType != EPEUnknownNumber )
    76         {
    76         {
    77         if ( auxLine )
    77         if ( auxLine )
    78             {
    78             {
    79             if ( aWaitingCall )
    79             if ( aWaitingCall )
    80                 {
    80                 {
   165     else
   165     else
   166         {
   166         {
   167         TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection = TPhoneCmdParamCallHeaderData::ERight;
   167         TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection = TPhoneCmdParamCallHeaderData::ERight;
   168         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   168         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   169  
   169  
   170         /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
   170         TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText );
   171         * will set SetIdentitySpecificCallHeaderData parameters therefore
   171         cnapClippingDirection = TPhoneCmdParamCallHeaderData::ELeft;
   172         * there is no need to call GetRemoteInfoDataL.*/  
   172 
   173         if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
       
   174             {
       
   175             GetRemoteInfoDataL( aCallId, remoteInfoText );
       
   176             cnapClippingDirection = TPhoneCmdParamCallHeaderData::ELeft;
       
   177             }
       
   178         aCallHeaderData->SetCLIText( remoteInfoText,  TPhoneCmdParamCallHeaderData::ERight );
   173         aCallHeaderData->SetCLIText( remoteInfoText,  TPhoneCmdParamCallHeaderData::ERight );
   179         aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), 
   174         
       
   175         if (secondaryCli)
       
   176             {
       
   177             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), 
   180                 cnapClippingDirection );
   178                 cnapClippingDirection );
       
   179             }
   181         }
   180         }
   182     
   181     
   183     SetCallerImage( aCallId, aCallHeaderData );
   182     SetCallerImage( aCallId, aCallHeaderData );
   184 
   183 
   185     // Set the Caller text
   184     // Set the Caller text
   357         }
   356         }
   358     else
   357     else
   359         {
   358         {
   360         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   359         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   361         
   360         
   362         /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
   361         GetRemoteInfoDataL( aCallId, remoteInfoText );
   363         * will set SetIdentitySpecificCallHeaderData parameters therefore
       
   364         * there is no need to call GetRemoteInfoDataL.*/        
       
   365         if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
       
   366             {
       
   367             GetRemoteInfoDataL( aCallId, remoteInfoText );
       
   368             }
       
   369         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   362         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   370         }
   363         }
   371 
   364 
   372     // Fetch CNAP text and clipping direction
   365     // Fetch CNAP text and clipping direction
   373     TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection;
   366     TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection;
   566     
   559     
   567     // Set call header type
   560     // Set call header type
   568     GetCallType( aCallId, aCallHeaderData );
   561     GetCallType( aCallId, aCallHeaderData );
   569     
   562     
   570     // Set CLI text for the call header
   563     // Set CLI text for the call header
   571     GetRemoteInfoDataL( aCallId, remoteInfoText );
   564     TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText );
   572     if ( remoteInfoText != KNullDesC )
   565     if ( remoteInfoText != KNullDesC )
   573         {
   566         {
   574         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   567         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   575         if ( IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
   568         if ( secondaryCli )
   576             {
       
   577             aCallHeaderData->SetCNAPText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
       
   578             }
       
   579         else
       
   580             {
   569             {
   581             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
   570             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
   582                 RemotePhoneNumber( aCallId ), TPhoneCmdParamCallHeaderData::ELeft );       
   571                 RemotePhoneNumber( aCallId ), TPhoneCmdParamCallHeaderData::ELeft );       
   583             }
   572             }
   584         }
   573         }
   618     SetCallerImage( 
   607     SetCallerImage( 
   619             aCallId, 
   608             aCallId, 
   620             aCallHeaderData ); 
   609             aCallHeaderData ); 
   621     }
   610     }
   622 
   611 
   623 // ---------------------------------------------------------------------------
   612 
   624 // TPhoneCallHeaderParam::IsCallPrivateOrPayPhone
       
   625 // ---------------------------------------------------------------------------
       
   626 //
       
   627 TBool TPhoneCallHeaderParam::IsCallPrivateOrPayPhone( const TInt aCallId, TDes& aData ) const 
       
   628     {
       
   629     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() ");
       
   630     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
       
   631     TBool ret( EFalse );
       
   632     const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
       
   633     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) == EPEPrivateNumber ) ||
       
   634             identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || 
       
   635             identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
       
   636         {
       
   637         SetIdentitySpecificCallHeaderData( aCallId, aData );
       
   638         ret = ETrue;
       
   639         }
       
   640     
       
   641     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() - returns = %d ", ret);
       
   642     return ret;  
       
   643     }
       
   644 
   613 
   645 // ---------------------------------------------------------------------------
   614 // ---------------------------------------------------------------------------
   646 //  TPhoneCallHeaderParam::GetRemoteInfoDataL
   615 //  TPhoneCallHeaderParam::GetRemoteInfoDataL
   647 // ---------------------------------------------------------------------------
   616 // ---------------------------------------------------------------------------
   648 //
   617 //
   649 void TPhoneCallHeaderParam::GetRemoteInfoDataL( 
   618 TBool TPhoneCallHeaderParam::GetRemoteInfoDataL( 
   650         const TInt aCallId, 
   619         const TInt aCallId, 
   651         TDes& aData ) const 
   620         TDes& aData ) const 
   652     {
   621     {
   653     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() ");
   622     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() ");
   654     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId);
   623     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId);
   655     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   624     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
       
   625     
       
   626     TBool secondaryCli(EFalse);
       
   627         
   656     if ( aCallId == KEmergencyCallId )
   628     if ( aCallId == KEmergencyCallId )
   657         {
   629         {
   658         // Set emergency label text
   630         // Set emergency label text
   659         iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader );
   631         iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader );
   660         }
   632         }
   661     else
   633     else
   662         {
   634         {
       
   635         const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
   663         // Note next if-statements are in priority order so be careful if you change order
   636         // Note next if-statements are in priority order so be careful if you change order
   664         // or add new if-statements.
   637         // or add new if-statements.
   665         if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() )
   638         if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() )
   666             {
   639             {
   667             // Display the contact name if it is available
   640             // Display the contact name if it is available
   668             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) );
   641             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) );
       
   642             secondaryCli = ETrue;
   669             }
   643             }
   670         else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
   644         else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
   671             {
   645             {
   672             // Display the CNAP or UUS info if it is available.
   646             // Display the CNAP or UUS info if it is available.
   673             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
   647             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
       
   648             secondaryCli = ETrue;
   674             }
   649             }
   675         else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
   650         else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
   676             {
   651             {
   677             // Display the company name if it is available
   652             // Display the company name if it is available
   678             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
   653             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
   679             }
   654             }
   680         else if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging  )
   655         else if ( iStateMachine.PhoneEngineInfo()->CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
   681             {
   656             {
   682             SetIdentitySpecificCallHeaderData( aCallId, aData );
   657             if ( EPEPrivateNumber == iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) )
   683            }
   658                 {
   684         else
   659                 if ( EPECallTypeVoIP == CallHeaderType() )
   685             {
   660                     {
   686             if ( ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateDialing ) && 
   661                     iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
   687                  ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateRinging ) &&
   662                     }
   688                  ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateAnswering ) )
   663                 else
   689                 {
   664                     {
   690                 iManagerUtility.GetInCallNumberTextL( aCallId, aData );
   665                     // private number
   691                 }
   666                     iManagerUtility.LoadResource( aData, EPhoneCLIWithheld );
   692             }
   667                     }
   693         }
   668                 }
   694     }
   669             else if ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || 
   695 
   670                     identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
   696 // ---------------------------------------------------------------------------
   671                 {
   697 // TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData
   672                 __PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL br2.5: payphone" );
   698 // ---------------------------------------------------------------------------
   673                 // Display "Payphone".
   699 //
   674                 iManagerUtility.LoadResource( aData, EPhoneCLIPayphone );
   700 void TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData( const TInt aCallId,  TDes& aData ) const 
   675                 }
   701     {
   676             else if ( identity == RMobileCall::ERemoteIdentityUnknown )
   702     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() ")
   677                 {
   703     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   678                 __PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL br2.6: unknown number" );
   704     
   679                 // Display "Unknown Number".
   705     const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
   680                 iManagerUtility.LoadResource( aData, EPhoneCallCLIUnknown );
   706     const TPEPhoneNumberIdType idType = iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId );
   681                 }
   707     
   682             }
   708     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - RemoteIdentity: %d ", 
   683         else if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() )
   709             identity )
   684             {
   710     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - idType: %d ", 
   685             // Display the number if it is available
   711             idType )
   686             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
   712     // If ringing call is emergency call then do not set identity specific info to call header
   687             }
   713     // because emergency call header doesnt contain identity specific information.
   688         }
   714     if ( aCallId == KEmergencyCallId )
   689     return secondaryCli;
   715             {
   690     }
   716             // do nothing.
   691 
   717             }
       
   718     else if ( idType == EPEPrivateNumber )
       
   719         {
       
   720         // If call header has customized items and callheadertype is voip
       
   721         // then load customized text.
       
   722         if ( ( iManagerUtility.Customization() ) && ( CallHeaderType() == EPECallTypeVoIP ) )
       
   723             {
       
   724             // Display private address
       
   725             iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
       
   726             }
       
   727         else
       
   728             {
       
   729             // Display "private number".
       
   730             iManagerUtility.LoadResource( aData, EPhoneCLIWithheld );  
       
   731             }       
       
   732         }
       
   733     else if( ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone ) ||
       
   734              ( identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone ) )
       
   735         {
       
   736         // Display "Payphone".
       
   737         iManagerUtility.LoadResource( aData, EPhoneCLIPayphone );
       
   738         }
       
   739     else if ( identity == RMobileCall::ERemoteIdentityUnknown  )
       
   740         {
       
   741         // Display "Call".
       
   742         iManagerUtility.LoadResource( aData, EPhoneCall );
       
   743         }
       
   744     }
       
   745