phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp
branchRCL_3
changeset 23 40a3f856b14d
parent 20 3c221667e687
child 24 41a7f70b3818
--- a/phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp	Thu Jul 15 18:38:16 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp	Thu Aug 19 09:54:27 2010 +0300
@@ -43,8 +43,7 @@
         MPhoneStateMachine& aStateMachine ) 
         : iManagerUtility ( aManagerUtility ),
           iStateMachine ( aStateMachine ),
-          iCallHeaderType ( CBubbleManager::ENormal ),
-          iSetDivertIndication ( EFalse )
+          iCallHeaderType ( CBubbleManager::ENormal )
     {
     }
 
@@ -226,23 +225,13 @@
 //
 void TPhoneCallHeaderParam::SetBasicCallHeaderParamsL(
         const TInt aCallId, 
-        TPhoneCmdParamCallHeaderData* aCallHeaderData,
-        TBool aInitializing )
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
     {
     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( ) ");
     // Set call header call state
-    if( aInitializing )
-        {
-        // fake state to initializing call this way we get correct bubble to screen.
-        aCallHeaderData->SetCallState( EPEStateDialing );
-        }
-    else
-        {
-        aCallHeaderData->SetCallState( 
-                iStateMachine.PhoneEngineInfo()->CallState( aCallId ) );
-        }
-    
-    // Set call header type.
+    aCallHeaderData->SetCallState( 
+            iStateMachine.PhoneEngineInfo()->CallState( aCallId ) );
+    // Set call header type
     aCallHeaderData->SetCallType( GetCallType( aCallId, aCallHeaderData ) );
     aCallHeaderData->SetCallFlag( CallHeaderType() );
     
@@ -498,7 +487,8 @@
     TPhoneCmdParamCallHeaderData* aCallHeaderData )
     {
     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( ) ");
-    if( iSetDivertIndication )
+    TBool forwarded = iStateMachine.PhoneEngineInfo()->CallForwarded( aCallId );
+    if ( forwarded )
         {
         aCallHeaderData->AddCallFlag( CBubbleManager::EDiverted );
         }
@@ -512,19 +502,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// TPhoneCallHeaderParam::SetDivertIndication
-// ---------------------------------------------------------------------------
-//
-void TPhoneCallHeaderParam::SetDivertIndication( const TBool aDivertIndication )
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndication( ) ");
-    iSetDivertIndication = aDivertIndication;           
-    __PHONELOG1( EBasic, EPhoneControl, 
-                "TPhoneCallHeaderParam::SetDivertIndication() - iSetDivertIndication: %d ", 
-                iSetDivertIndication )
-    }
-
-// ---------------------------------------------------------------------------
 //  TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL
 // ---------------------------------------------------------------------------
 //
@@ -536,7 +513,7 @@
     {
     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL( ) ");
     // Set basic params must be called before update is called.
-    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData, EFalse );
+    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
     
     // Set call header labels
     SetCallHeaderTexts( 
@@ -561,28 +538,13 @@
     {
     __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( ) ");
     // Set basic params must be called before update is called.
-    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData, EFalse );
+    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
     // Set call header labels
     SetCallHeaderLabels( aCallHeaderData );
     SetCliParamatersL( aCallId, aCallHeaderData );
     }
 
 // ---------------------------------------------------------------------------
-//  TPhoneCallHeaderParam::SetIniticalizingCallHeaderParamsL
-// ---------------------------------------------------------------------------
-//
-void TPhoneCallHeaderParam::SetIniticalizingCallHeaderParamsL(
-        const TInt aCallId,
-        TPhoneCmdParamCallHeaderData* aCallHeaderData )
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetIniticalizingCallHeaderParamsL( ) ");
-    // Set basic params must be called before update is called.
-    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData, ETrue );
-    // Set call header labels
-    SetCallHeaderLabels( aCallHeaderData );
-    }
-
-// ---------------------------------------------------------------------------
 //  TPhoneCallHeaderParam::SetCallHeaderLabels
 // ---------------------------------------------------------------------------
 //
@@ -635,7 +597,15 @@
         else
             {
             aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
-                RemotePhoneNumber( aCallId ), CBubbleManager::ELeft );       
+                RemotePhoneNumber( aCallId ), CBubbleManager::ELeft );
+
+            // No contact name, use phonenumber when available.
+            if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() 
+                    && !ContactInfoAvailable( aCallId ) )
+                {
+                aCallHeaderData->SetParticipantListCLI(
+                        TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
+                }
             }
         }
     else
@@ -675,6 +645,9 @@
     SetCallerImage( 
             aCallId, 
             aCallHeaderData ); 
+    
+    // Update divert indication
+    SetDivertIndicatorToCallHeader( aCallId, aCallHeaderData );
     }
 
 // ---------------------------------------------------------------------------