phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
child 81 c26cc2a7c548
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
    41 TPhoneCallHeaderParam::TPhoneCallHeaderParam(
    41 TPhoneCallHeaderParam::TPhoneCallHeaderParam(
    42         MPhoneCallHeaderManagerUtility& aManagerUtility,
    42         MPhoneCallHeaderManagerUtility& aManagerUtility,
    43         MPhoneStateMachine& aStateMachine ) 
    43         MPhoneStateMachine& aStateMachine ) 
    44         : iManagerUtility ( aManagerUtility ),
    44         : iManagerUtility ( aManagerUtility ),
    45           iStateMachine ( aStateMachine ),
    45           iStateMachine ( aStateMachine ),
    46           iCallHeaderType ( EPECallTypeUninitialized ),
    46           iCallHeaderType ( CBubbleManager::ENormal )
    47           iSetDivertIndication ( EFalse )
       
    48     {
    47     {
    49     }
    48     }
    50 
    49 
    51 // -----------------------------------------------------------
    50 // -----------------------------------------------------------
    52 // TPhoneCallHeaderParam::SetCallHeaderTexts
    51 // TPhoneCallHeaderParam::SetCallHeaderTexts
    70     const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ));
    69     const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ));
    71     
    70     
    72     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli );
    71     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli );
    73     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine );
    72     __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine );
    74     
    73     
    75     if ( !cli && !cnap && numberType != EPEPrivateNumber && numberType != EPEUnknownNumber )
    74     if ( !cli && !cnap && ( numberType != EPEPrivateNumber ) )
    76         {
    75         {
    77         if ( auxLine )
    76         if ( auxLine )
    78             {
    77             {
    79             if ( aWaitingCall )
    78             if ( aWaitingCall )
    80                 {
    79                 {
   153     
   152     
   154     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
   153     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
   155          ( !ContactInfoAvailable( aCallId ) ) )
   154          ( !ContactInfoAvailable( aCallId ) ) )
   156         {
   155         {
   157         // Set phonenumber/URI as the CLI text for the call header      
   156         // Set phonenumber/URI as the CLI text for the call header      
   158        aCallHeaderData->SetCLIText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
   157         aCallHeaderData->SetCLIText( 
   159                  TPhoneCmdParamCallHeaderData::ELeft );
   158                 iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
       
   159                 CBubbleManager::ELeft );
   160             
   160             
   161         // No contact name, use phonenumber when available.
   161         // No contact name, use phonenumber when available.
   162         aCallHeaderData->SetParticipantListCLI(
   162         aCallHeaderData->SetParticipantListCLI(
   163                 TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
   163                 TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
   164         }
   164         }
   165     else
   165     else
   166         {
   166         {
   167         TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection = TPhoneCmdParamCallHeaderData::ERight;
   167         CBubbleManager::TPhoneClippingDirection cnapClippingDirection = CBubbleManager::ERight;
   168         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   168         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   169  
       
   170         TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText );
       
   171         cnapClippingDirection = TPhoneCmdParamCallHeaderData::ELeft;
       
   172 
       
   173         aCallHeaderData->SetCLIText( remoteInfoText,  TPhoneCmdParamCallHeaderData::ERight );
       
   174         
   169         
   175         if (secondaryCli)
   170         /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
   176             {
   171         * will set SetIdentitySpecificCallHeaderData parameters therefore
   177             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), 
   172         * there is no need to call GetRemoteInfoDataL.*/  
       
   173         if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
       
   174             {
       
   175             GetRemoteInfoDataL( aCallId, remoteInfoText );
       
   176             cnapClippingDirection = CBubbleManager::ELeft;
       
   177             }
       
   178         
       
   179         // Set remote info data as the CLI text for the call header 
       
   180         aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::ERight );
       
   181         aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), 
   178                 cnapClippingDirection );
   182                 cnapClippingDirection );
   179             }
       
   180         }
   183         }
   181     
   184     
   182     SetCallerImage( aCallId, aCallHeaderData );
   185     SetCallerImage( aCallId, aCallHeaderData );
   183 
   186 
   184     // Set the Caller text
   187     // Set the Caller text
   225         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   228         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   226     {
   229     {
   227     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( ) ");
   230     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( ) ");
   228     // Set call header call state
   231     // Set call header call state
   229     aCallHeaderData->SetCallState( 
   232     aCallHeaderData->SetCallState( 
   230         iStateMachine.PhoneEngineInfo()->CallState( aCallId ) );
   233             iStateMachine.PhoneEngineInfo()->CallState( aCallId ) );
   231 
   234     // Set call header type
   232     // Set call header type            
       
   233     aCallHeaderData->SetCallType( GetCallType( aCallId, aCallHeaderData ) );
   235     aCallHeaderData->SetCallType( GetCallType( aCallId, aCallHeaderData ) );
       
   236     aCallHeaderData->SetCallFlag( CallHeaderType() );
   234     
   237     
   235     // Set call header voice privacy status
   238     // Set call header voice privacy status
   236     aCallHeaderData->SetCiphering( 
   239     aCallHeaderData->SetCiphering( 
   237         iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) );
   240         iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) );
   238     aCallHeaderData->SetCipheringIndicatorAllowed( 
   241     aCallHeaderData->SetCipheringIndicatorAllowed( 
   263         const TInt aCallId,
   266         const TInt aCallId,
   264         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   267         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   265     {
   268     {
   266     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCallType( ) ");
   269     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCallType( ) ");
   267     // Set call header type.
   270     // Set call header type.
   268     TPECallType callType = 
   271     TPECallType callType = iStateMachine.PhoneEngineInfo()->CallType( aCallId );
   269         iStateMachine.PhoneEngineInfo()->CallType( aCallId );
   272     switch ( callType )
   270     SetCallHeaderType( callType );
   273        {
   271     
   274        case EPECallTypeCSVoice:
   272     if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) 
   275            {
   273          == CCCECallParameters::ECCELineTypeAux )
   276            if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) 
   274         {
   277                 == CCCECallParameters::ECCELineTypeAux )
   275         aCallHeaderData->SetLine2( ETrue );
   278                {
   276         }
   279                SetCallHeaderType( CBubbleManager::ELine2 );
   277 
   280                aCallHeaderData->SetLine2( ETrue );
       
   281                }
       
   282            else
       
   283                {
       
   284                SetCallHeaderType( CBubbleManager::ENormal );
       
   285                }
       
   286            }
       
   287            break;
       
   288        case EPECallTypeVideo:
       
   289            SetCallHeaderType( CBubbleManager::EVideo );
       
   290            break;
       
   291        case EPECallTypeVoIP:
       
   292            SetCallHeaderType( CBubbleManager::EVoIPCall );
       
   293            break;
       
   294          default:
       
   295            // None
       
   296            break;     
       
   297        }
   278     __PHONELOG1( EBasic, EPhoneControl, 
   298     __PHONELOG1( EBasic, EPhoneControl, 
   279                 "TPhoneCallHeaderParam::GetCallType() - callType: %d ", 
   299                 "TPhoneCallHeaderParam::GetCallType() - callType: %d ", 
   280                 callType )
   300                 callType )
   281     return callType;
   301     return callType;
   282     }
   302     }
   284 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
   285 //  TPhoneCallHeaderParam::SetCallHeaderType
   305 //  TPhoneCallHeaderParam::SetCallHeaderType
   286 // ---------------------------------------------------------------------------
   306 // ---------------------------------------------------------------------------
   287 //
   307 //
   288 void TPhoneCallHeaderParam::SetCallHeaderType( 
   308 void TPhoneCallHeaderParam::SetCallHeaderType( 
   289     TInt aCallHeaderType )
   309     const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType )
   290     {
   310     {
   291     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderType( ) ");
   311     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderType( ) ");
   292     iCallHeaderType = aCallHeaderType;
   312     iCallHeaderType = aCallHeaderType;
   293     __PHONELOG1( EBasic, EPhoneControl, 
   313     __PHONELOG1( EBasic, EPhoneControl, 
   294                     "TPhoneCallHeaderParam::SetCallHeaderType() - iCallHeaderType: %d ", 
   314                     "TPhoneCallHeaderParam::SetCallHeaderType() - iCallHeaderType: %d ", 
   297 
   317 
   298 // ---------------------------------------------------------------------------
   318 // ---------------------------------------------------------------------------
   299 //  TPhoneCallHeaderParam::CallHeaderType
   319 //  TPhoneCallHeaderParam::CallHeaderType
   300 // ---------------------------------------------------------------------------
   320 // ---------------------------------------------------------------------------
   301 //
   321 //
   302 TInt TPhoneCallHeaderParam::CallHeaderType() const
   322 CBubbleManager::TPhoneCallTypeFlags TPhoneCallHeaderParam::CallHeaderType() const
   303     {
   323     {
   304     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::CallHeaderType( ) ");
   324     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::CallHeaderType( ) ");
   305     __PHONELOG1( EBasic, EPhoneControl, 
   325     __PHONELOG1( EBasic, EPhoneControl, 
   306                         "TPhoneCallHeaderParam::CallHeaderType() - iCallHeaderType: %d ", 
   326                         "TPhoneCallHeaderParam::CallHeaderType() - iCallHeaderType: %d ", 
   307                         iCallHeaderType )
   327                         iCallHeaderType )
   343 
   363 
   344     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
   364     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
   345          ( !ContactInfoAvailable( aCallId ) ) && 
   365          ( !ContactInfoAvailable( aCallId ) ) && 
   346          ( !info.ShowNumber() ) )
   366          ( !info.ShowNumber() ) )
   347         {
   367         {
   348         // No contact info data available; use the phone number
   368         // No contact info data available use the phone number.
   349         aCallHeaderData->SetCLIText(
   369         aCallHeaderData->SetCLIText(
   350                 iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
   370                 iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
   351                 TPhoneCmdParamCallHeaderData::ELeft);
   371                 CBubbleManager::ELeft);
   352         
   372         
   353         // No contact name, use phonenumber when available.
   373         // No contact name, use phonenumber when available.
   354         aCallHeaderData->SetParticipantListCLI( 
   374         aCallHeaderData->SetParticipantListCLI( 
   355                 TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
   375                 TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
   356         }
   376         }
   357     else
   377     else
   358         {
   378         {
   359         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   379         TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   360         
   380         
   361         GetRemoteInfoDataL( aCallId, remoteInfoText );
   381         /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
   362         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   382         * will set SetIdentitySpecificCallHeaderData parameters therefore
       
   383         * there is no need to call GetRemoteInfoDataL.*/        
       
   384         if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
       
   385             {
       
   386             GetRemoteInfoDataL( aCallId, remoteInfoText );
       
   387             }
       
   388         
       
   389         // Set remote info data as the CLI text for the call header
       
   390         aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::ERight );
   363         }
   391         }
   364 
   392 
   365     // Fetch CNAP text and clipping direction
   393     // Fetch CNAP text and clipping direction
   366     TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection;
   394     CBubbleManager::TPhoneClippingDirection cnapClippingDirection; 
   367     GetCNAPText( aCallId, cnapText, cnapClippingDirection );
   395     GetCNAPText( aCallId, cnapText, cnapClippingDirection );
   368     
   396     
   369     // Set CNAP data 
   397     // Set CNAP data 
   370     aCallHeaderData->SetCNAPText( cnapText, cnapClippingDirection );
   398     aCallHeaderData->SetCNAPText( cnapText, cnapClippingDirection );
   371     
   399     
   380     
   408     
   381     // Set the call header CNAP data ( Contains possible CNAP name or received skype identification ).
   409     // Set the call header CNAP data ( Contains possible CNAP name or received skype identification ).
   382     if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
   410     if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
   383         {
   411         {
   384         aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ), 
   412         aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ), 
   385                 TPhoneCmdParamCallHeaderData::ERight );
   413                 CBubbleManager::ERight );
   386         }
   414         }
   387     }
   415     }
   388 
   416 
   389 // ---------------------------------------------------------------------------
   417 // ---------------------------------------------------------------------------
   390 //  TPhoneCallHeaderParam::GetCNAPText
   418 //  TPhoneCallHeaderParam::GetCNAPText
   391 // ---------------------------------------------------------------------------
   419 // ---------------------------------------------------------------------------
   392 //
   420 //
   393 void TPhoneCallHeaderParam::GetCNAPText( 
   421 void TPhoneCallHeaderParam::GetCNAPText( 
   394     const TInt aCallId,
   422        const TInt aCallId,
   395        TDes& aData, 
   423        TDes& aData, 
   396        TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection& aDirection ) const
   424        CBubbleManager::TPhoneClippingDirection& aDirection ) const
   397     {
   425     {
   398     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCNAPText( ) ");
   426     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCNAPText( ) ");
   399     
   427     
   400     // Set clipping direction  
   428     // Set clipping direction  
   401     aDirection = TPhoneCmdParamCallHeaderData::ERight;
   429     aDirection = CBubbleManager::ERight;
   402     
   430     
   403     // If it's not a private number show further info
   431     // If it's not a private number show further info
   404     if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) != 
   432     if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) != 
   405         EPEPrivateNumber )
   433         EPEPrivateNumber )
   406         {
   434         {
   411             {
   439             {
   412             // Use the phone number for the CNAP display
   440             // Use the phone number for the CNAP display
   413             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
   441             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
   414             
   442             
   415             // Clipping direction for non-private number
   443             // Clipping direction for non-private number
   416             aDirection = TPhoneCmdParamCallHeaderData::ELeft;
   444             aDirection = CBubbleManager::ELeft;
   417             }
   445             }
   418         }
   446         }
   419     }
   447     }
   420 
   448 
   421 // ---------------------------------------------------------------------------
   449 // ---------------------------------------------------------------------------
   457 void TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( 
   485 void TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( 
   458     const TInt aCallId, 
   486     const TInt aCallId, 
   459     TPhoneCmdParamCallHeaderData* aCallHeaderData )
   487     TPhoneCmdParamCallHeaderData* aCallHeaderData )
   460     {
   488     {
   461     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( ) ");
   489     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( ) ");
   462     if( iSetDivertIndication )
   490     TBool forwarded = iStateMachine.PhoneEngineInfo()->CallForwarded( aCallId );
   463         {
   491     if ( forwarded )
   464         aCallHeaderData->SetDiverted( ETrue );
   492         {
       
   493         aCallHeaderData->AddCallFlag( CBubbleManager::EDiverted );
   465         }
   494         }
   466     
   495     
   467     if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux )
   496     if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux )
   468         {
   497         {
   469         __PHONELOG( EBasic, EPhoneControl, 
   498         __PHONELOG( EBasic, EPhoneControl, 
   470                 "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader - CallALSLine() == CCCECallParameters::ECCELineTypeAux");
   499                 "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader - CallALSLine() == CCCECallParameters::ECCELineTypeAux");
   471         aCallHeaderData->SetLine2( ETrue );    
   500         aCallHeaderData->SetLine2( ETrue );    
   472         }        
   501         }        
   473     }
       
   474 
       
   475 // ---------------------------------------------------------------------------
       
   476 // TPhoneCallHeaderParam::SetDivertIndication
       
   477 // ---------------------------------------------------------------------------
       
   478 //
       
   479 void TPhoneCallHeaderParam::SetDivertIndication( const TBool aDivertIndication )
       
   480     {
       
   481     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndication( ) ");
       
   482     iSetDivertIndication = aDivertIndication;           
       
   483     __PHONELOG1( EBasic, EPhoneControl, 
       
   484                 "TPhoneCallHeaderParam::SetDivertIndication() - iSetDivertIndication: %d ", 
       
   485                 iSetDivertIndication )
       
   486     }
   502     }
   487 
   503 
   488 // ---------------------------------------------------------------------------
   504 // ---------------------------------------------------------------------------
   489 //  TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL
   505 //  TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL
   490 // ---------------------------------------------------------------------------
   506 // ---------------------------------------------------------------------------
   521         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   537         TPhoneCmdParamCallHeaderData* aCallHeaderData )
   522     {
   538     {
   523     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( ) ");
   539     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( ) ");
   524     // Set basic params must be called before update is called.
   540     // Set basic params must be called before update is called.
   525     SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
   541     SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
   526     
       
   527     // Set call header labels
   542     // Set call header labels
       
   543     SetCallHeaderLabels( aCallHeaderData );
       
   544     SetCliParamatersL( aCallId, aCallHeaderData );
       
   545     }
       
   546 
       
   547 // ---------------------------------------------------------------------------
       
   548 //  TPhoneCallHeaderParam::SetCallHeaderLabels
       
   549 // ---------------------------------------------------------------------------
       
   550 //
       
   551 void TPhoneCallHeaderParam::SetCallHeaderLabels( 
       
   552        TPhoneCmdParamCallHeaderData* aCallHeaderData )
       
   553     {
   528     if ( aCallHeaderData->CallType() == EPECallTypeVideo )
   554     if ( aCallHeaderData->CallType() == EPECallTypeVideo )
   529         {
   555         {
   530         iManagerUtility.LoadCallHeaderTexts( 
   556         iManagerUtility.LoadCallHeaderTexts( 
   531                 EPhoneOutgoingVideoCallLabel, 
   557                 EPhoneOutgoingVideoCallLabel, 
   532                 EPhoneOutgoingVideoCallLabelShort, 
   558                 EPhoneOutgoingVideoCallLabelShort, 
   537         iManagerUtility.LoadCallHeaderTexts( 
   563         iManagerUtility.LoadCallHeaderTexts( 
   538                 EPhoneOutgoingCallLabel, 
   564                 EPhoneOutgoingCallLabel, 
   539                 EPhoneOutgoingCallLabelShort, 
   565                 EPhoneOutgoingCallLabelShort, 
   540                 aCallHeaderData );
   566                 aCallHeaderData );
   541         }
   567         }
   542     
       
   543     SetCliParamatersL( aCallId, aCallHeaderData );
       
   544     }
   568     }
   545 
   569 
   546 // ---------------------------------------------------------------------------
   570 // ---------------------------------------------------------------------------
   547 //  TPhoneCallHeaderParam::UpdateCallHeaderInfoL
   571 //  TPhoneCallHeaderParam::UpdateCallHeaderInfoL
   548 // ---------------------------------------------------------------------------
   572 // ---------------------------------------------------------------------------
   557     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   581     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   558     TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   582     TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
   559     
   583     
   560     // Set call header type
   584     // Set call header type
   561     GetCallType( aCallId, aCallHeaderData );
   585     GetCallType( aCallId, aCallHeaderData );
       
   586     aCallHeaderData->SetCallFlag( CallHeaderType() );
   562     
   587     
   563     // Set CLI text for the call header
   588     // Set CLI text for the call header
   564     TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText );
   589     GetRemoteInfoDataL( aCallId, remoteInfoText );
   565     if ( remoteInfoText != KNullDesC )
   590     if ( remoteInfoText != KNullDesC )
   566         {
   591         {
   567         aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
   592         aCallHeaderData->SetCLIText( remoteInfoText, CBubbleManager::ERight );
   568         if ( secondaryCli )
   593         if ( IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
       
   594             {
       
   595             aCallHeaderData->SetCNAPText( remoteInfoText, CBubbleManager::ERight );
       
   596             }
       
   597         else
   569             {
   598             {
   570             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
   599             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
   571                 RemotePhoneNumber( aCallId ), TPhoneCmdParamCallHeaderData::ELeft );       
   600                 RemotePhoneNumber( aCallId ), CBubbleManager::ELeft );
       
   601 
       
   602             // No contact name, use phonenumber when available.
       
   603             if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() 
       
   604                     && !ContactInfoAvailable( aCallId ) )
       
   605                 {
       
   606                 aCallHeaderData->SetParticipantListCLI(
       
   607                         TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
       
   608                 }
   572             }
   609             }
   573         }
   610         }
   574     else
   611     else
   575         {
   612         {
   576         aCallHeaderData->SetCLIText( 
   613         aCallHeaderData->SetCLIText( 
   577             iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
   614             iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
   578             TPhoneCmdParamCallHeaderData::ELeft );
   615             CBubbleManager::ERight );
   579         }
   616         }
   580 
   617 
   581     // If KTelephonyLVFlagUUS is enabled it will over write RemotePartyName setting.
   618     // If KTelephonyLVFlagUUS is enabled it will over write RemotePartyName setting.
   582     // Contains possible CNAP name or received skype identification
   619     // Contains possible CNAP name or received skype identification
   583     if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
   620     if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
   586         remotePartyName.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
   623         remotePartyName.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
   587        
   624        
   588         if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging )
   625         if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging )
   589             {
   626             {
   590             // Set CNAP text  
   627             // Set CNAP text  
   591             aCallHeaderData->SetCNAPText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight );
   628             aCallHeaderData->SetCNAPText( remotePartyName, CBubbleManager::ERight );
   592             }
   629             }
   593         else
   630         else
   594             {
   631             {
   595             aCallHeaderData->SetCLIText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight );
   632             aCallHeaderData->SetCLIText( remotePartyName, CBubbleManager::ERight );
   596             }
   633             }
   597         }   
   634         }   
       
   635 
   598     
   636     
   599     // Set call header labels
   637     // Set call header labels
   600     SetCallHeaderTexts( 
   638     SetCallHeaderTexts( 
   601             aCallId, 
   639             aCallId, 
   602             aWaitingCall, 
   640             aWaitingCall, 
   605             
   643             
   606     // Update caller image
   644     // Update caller image
   607     SetCallerImage( 
   645     SetCallerImage( 
   608             aCallId, 
   646             aCallId, 
   609             aCallHeaderData ); 
   647             aCallHeaderData ); 
   610     }
   648     
   611 
   649     // Update divert indication
   612 
   650     SetDivertIndicatorToCallHeader( aCallId, aCallHeaderData );
       
   651     }
       
   652 
       
   653 // ---------------------------------------------------------------------------
       
   654 // TPhoneCallHeaderParam::IsCallPrivateOrPayPhone
       
   655 // ---------------------------------------------------------------------------
       
   656 //
       
   657 TBool TPhoneCallHeaderParam::IsCallPrivateOrPayPhone( const TInt aCallId, TDes& aData ) const 
       
   658     {
       
   659     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() ");
       
   660     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
       
   661     TBool ret( EFalse );
       
   662     const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
       
   663     if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) == EPEPrivateNumber ) ||
       
   664             identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || 
       
   665             identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
       
   666         {
       
   667         SetIdentitySpecificCallHeaderData( aCallId, aData );
       
   668         ret = ETrue;
       
   669         }
       
   670     
       
   671     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() - returns = %d ", ret);
       
   672     return ret;  
       
   673     }
   613 
   674 
   614 // ---------------------------------------------------------------------------
   675 // ---------------------------------------------------------------------------
   615 //  TPhoneCallHeaderParam::GetRemoteInfoDataL
   676 //  TPhoneCallHeaderParam::GetRemoteInfoDataL
   616 // ---------------------------------------------------------------------------
   677 // ---------------------------------------------------------------------------
   617 //
   678 //
   618 TBool TPhoneCallHeaderParam::GetRemoteInfoDataL( 
   679 void TPhoneCallHeaderParam::GetRemoteInfoDataL( 
   619         const TInt aCallId, 
   680         const TInt aCallId, 
   620         TDes& aData ) const 
   681         TDes& aData ) const 
   621     {
   682     {
   622     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() ");
   683     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() ");
   623     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId);
   684     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId);
   624     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   685     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   625     
       
   626     TBool secondaryCli(EFalse);
       
   627         
       
   628     if ( aCallId == KEmergencyCallId )
   686     if ( aCallId == KEmergencyCallId )
   629         {
   687         {
   630         // Set emergency label text
   688         // Set emergency label text
   631         iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader );
   689         iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader );
   632         }
   690         }
   633     else
   691     else
   634         {
   692         {
   635         const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
       
   636         // Note next if-statements are in priority order so be careful if you change order
   693         // Note next if-statements are in priority order so be careful if you change order
   637         // or add new if-statements.
   694         // or add new if-statements.
   638         if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() )
   695         if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() )
   639             {
   696             {
   640             // Display the contact name if it is available
   697             // Display the contact name if it is available
   641             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) );
   698             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) );
   642             secondaryCli = ETrue;
       
   643             }
   699             }
   644         else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
   700         else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
   645             {
   701             {
   646             // Display the CNAP or UUS info if it is available.
   702             // Display the CNAP or UUS info if it is available.
   647             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
   703             aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
   648             secondaryCli = ETrue;
       
   649             }
   704             }
   650         else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
   705         else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
   651             {
   706             {
   652             // Display the company name if it is available
   707             // Display the company name if it is available
   653             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
   708             aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
   654             }
   709             }
   655         else if ( iStateMachine.PhoneEngineInfo()->CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
   710         else if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging  )
   656             {
   711             {
   657             if ( EPEPrivateNumber == iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) )
   712             SetIdentitySpecificCallHeaderData( aCallId, aData );
   658                 {
   713            }
   659                 if ( EPECallTypeVoIP == CallHeaderType() )
   714         else
   660                     {
   715             {
   661                     iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
   716             if ( ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateDialing ) && 
   662                     }
   717                  ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateRinging ) &&
   663                 else
   718                  ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateAnswering ) )
   664                     {
   719                 {
   665                     // private number
   720                 iManagerUtility.GetInCallNumberTextL( aCallId, aData );
   666                     iManagerUtility.LoadResource( aData, EPhoneCLIWithheld );
   721                 }
   667                     }
   722             }
   668                 }
   723         }
   669             else if ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || 
   724     }
   670                     identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
   725 
   671                 {
   726 // ---------------------------------------------------------------------------
   672                 __PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL : payphone" );
   727 // TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData
   673                 // Display "Payphone".
   728 // ---------------------------------------------------------------------------
   674                 iManagerUtility.LoadResource( aData, EPhoneCLIPayphone );
   729 //
   675                 }
   730 void TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData( const TInt aCallId,  TDes& aData ) const 
   676             else if ( identity == RMobileCall::ERemoteIdentityUnknown )
   731     {
   677                 {
   732     __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() ")
   678                 __PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL : unknown number" );
   733     __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
   679                 // Display "Unknown Number".
   734     
   680                 iManagerUtility.LoadResource( aData, EPhoneCallCLIUnknown );
   735     const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
   681                 }
   736     const TPEPhoneNumberIdType idType = iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId );
   682             else if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() )
   737     
   683                 {
   738     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - RemoteIdentity: %d ", 
   684                 // Display the number if it is available
   739             identity )
   685                 aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
   740     __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - idType: %d ", 
   686                 }            
   741             idType )
   687             }
   742     // If ringing call is emergency call then do not set identity specific info to call header
   688 
   743     // because emergency call header doesnt contain identity specific information.
   689         }
   744     if ( aCallId == KEmergencyCallId )
   690     return secondaryCli;
   745             {
   691     }
   746             // do nothing.
   692 
   747             }
       
   748     else if ( idType == EPEPrivateNumber )
       
   749         {
       
   750         // If call header has customized items and callheadertype is voip
       
   751         // then load customized text.
       
   752         if ( ( iManagerUtility.Customization() ) && ( CallHeaderType() == CBubbleManager::EVoIPCall ) )
       
   753             {
       
   754             // Display private address
       
   755             iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
       
   756             }
       
   757         else
       
   758             {
       
   759             // Display "private number".
       
   760             iManagerUtility.LoadResource( aData, EPhoneCLIWithheld );  
       
   761             }       
       
   762         }
       
   763     else if( ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone ) ||
       
   764              ( identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone ) )
       
   765         {
       
   766         // Display "Payphone".
       
   767         iManagerUtility.LoadResource( aData, EPhoneCLIPayphone );
       
   768         }
       
   769     else if ( identity == RMobileCall::ERemoteIdentityUnknown  )
       
   770         {
       
   771         // Display "Call".
       
   772         iManagerUtility.LoadResource( aData, EPhoneCall );
       
   773         }
       
   774     }
       
   775