phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
--- a/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Thu Aug 19 09:54:27 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Tue Aug 31 15:14:29 2010 +0300
@@ -122,14 +122,15 @@
         case EKeyYes:
             if( IsNumberEntryVisibleL() )
                 {
-                CPhoneState::CallFromNumberEntryL();
+                CPhoneState::CallFromNumberEntryL();                            
                 }
             else
                 {
                 // Number entry is behind waiting call bubble
                 // We can't answer to waiting call in this state
-                // so display Not allowed -note.
-                CPhoneState::SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+                // so display Not allowed -note.                        
+                CPhoneState::SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed, ETrue );
                 }
             break;
             
@@ -148,18 +149,11 @@
                 
                 if ( CPhoneState::IsNumberEntryUsedL() )
                     {
-                    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
-                        {
-                        CloseDTMFEditorL();
-                        } 
-                    else
-                        {
-                        // Remove number entry from screen
-                        iViewCommandHandle->ExecuteCommandL( 
-                            EPhoneViewRemoveNumberEntry );
-                        // Do state-specific operation when number entry is cleared
-                        HandleNumberEntryClearedL();
-                        }
+                    // Remove number entry from screen
+                    iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewRemoveNumberEntry );
+                    // Do state-specific operation when number entry is cleared
+                    HandleNumberEntryClearedL();
                     }
                 if ( !TopAppIsDisplayedL() )
                     {
@@ -173,7 +167,7 @@
             else
                 {
                 // handle end key
-                DisconnectOutgoingCallL();
+                DisconnectOutgoingCallL();              
                 }
             break;
             
@@ -196,35 +190,25 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnecting:
-            {
             iAlerting = ETrue;
             HandleConnectingL( aCallId );
-            }
             break;
         
         case MEngineMonitor::EPEMessageConnected:
-            {
             HandleConnectedL( aCallId );
-            }
             break;
         
         case MEngineMonitor::EPEMessageIdle:
-            {
             HandleIdleL( aCallId );
-            }
             break;
                     
         case MEngineMonitor::EPEMessageRemoteBusy:
-            {
             // If call setup failed then stop capturing keys.
-            // Flow through to default branch.
             CaptureKeysDuringCallNotificationL( EFalse );
-            }
-           
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
         default:
-            {
             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
-            }
             break;
         }
     }
@@ -254,7 +238,6 @@
             
         case EPhoneDtmfDialerCancel:
             {
-            CloseDTMFEditorL();
             }
             break;    
             
@@ -267,58 +250,6 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneSingleAndCallSetupAndWaiting::HandleErrorL
-// -----------------------------------------------------------
-//
-EXPORT_C void CPhoneSingleAndCallSetupAndWaiting::HandleErrorL( 
-        const TPEErrorInfo& aErrorInfo )
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleErrorL()");
-    
-    if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
-        {
-        // Should not shown "No Answer" note
-        __PHONELOG1( EBasic, EPhoneUIStates,
-       "PhoneUIStates: CPhoneSingleAndCallSetupAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ",
-            aErrorInfo.iErrorCode);
-        }
-    else
-        {
-        CPhoneState::HandleErrorL( aErrorInfo );
-        }
-    }
-
-// -----------------------------------------------------------
-// CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL
-// -----------------------------------------------------------
-//
-void CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL()
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL() ");
-    TInt resourceId;
-
-    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
-        {
-        resourceId = EPhoneDtmfDialerMenubar;
-        }
-    else if ( IsNumberEntryVisibleL() )
-        {
-        resourceId = EPhoneAlertingHeldAndWaitingCallMenuBarWithNumberEntry;
-        }
-    else
-        {
-        resourceId = EPhoneAlertingHeldAndWaitingCallMenuBar;
-        }
-
-    TPhoneCmdParamInteger integerParam;
-    integerParam.SetInteger( 
-        CPhoneMainResourceResolver::Instance()->
-        ResolveResourceID( resourceId ) );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
-        &integerParam );
-    }
-
-// -----------------------------------------------------------
 // CPhoneSingleAndCallSetupAndWaiting:HandleIdleL
 // -----------------------------------------------------------
 //
@@ -415,7 +346,7 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
     
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -456,9 +387,11 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
-  
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
 
     // Show bubble
     TPhoneCmdParamCallHeaderData callHeaderParam;
@@ -471,7 +404,7 @@
     CaptureKeysDuringCallNotificationL( EFalse );
     
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -498,9 +431,6 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
     // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
-        
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
     
     // Reset Hold flag to view
     TPhoneCmdParamBoolean holdFlag;
@@ -510,7 +440,6 @@
     BeginUiUpdateLC();
     
     SetTouchPaneButtons( EPhoneCallSetupButtons );
-    SetToolbarDimming( ETrue );
     SetToolbarButtonLoudspeakerEnabled();
     
     EndUiUpdate();
@@ -539,9 +468,6 @@
         booleanParam.SetBoolean( ETrue );
         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
         }
-
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
     
         // Set Hold flag to view
     TPhoneCmdParamBoolean holdFlag;
@@ -568,11 +494,8 @@
     // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
 
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
-
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -587,8 +510,8 @@
     SetTouchPaneButtons( EPhoneCallSetupButtons );
     
     EndUiUpdate();
-	// Go to Single And Alerting state
-	UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    // Go to Single And Alerting state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
     }
 
@@ -599,11 +522,10 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
+        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
 
     BeginUiUpdateLC();
     
-    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
     
     EndUiUpdate();
@@ -620,12 +542,11 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
+        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
 
     BeginUiUpdateLC();
     
     SetTouchPaneButtons( EPhoneWaitingCallButtons );
-    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
     
     EndUiUpdate();