phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
child 69 8baf28733c3d
--- a/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Tue Aug 31 15:14:29 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Wed Sep 01 12:30:10 2010 +0100
@@ -122,15 +122,14 @@
         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, ETrue );
+                // so display Not allowed -note.
+                CPhoneState::SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
                 }
             break;
             
@@ -149,11 +148,18 @@
                 
                 if ( CPhoneState::IsNumberEntryUsedL() )
                     {
-                    // Remove number entry from screen
-                    iViewCommandHandle->ExecuteCommandL( 
-                        EPhoneViewRemoveNumberEntry );
-                    // Do state-specific operation when number entry is cleared
-                    HandleNumberEntryClearedL();
+                    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                        {
+                        CloseDTMFEditorL();
+                        } 
+                    else
+                        {
+                        // Remove number entry from screen
+                        iViewCommandHandle->ExecuteCommandL( 
+                            EPhoneViewRemoveNumberEntry );
+                        // Do state-specific operation when number entry is cleared
+                        HandleNumberEntryClearedL();
+                        }
                     }
                 if ( !TopAppIsDisplayedL() )
                     {
@@ -167,7 +173,7 @@
             else
                 {
                 // handle end key
-                DisconnectOutgoingCallL();              
+                DisconnectOutgoingCallL();
                 }
             break;
             
@@ -190,25 +196,35 @@
     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 );
+            }
+           
+        default:
+            {
             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
-            break;
-        default:
-            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            }
             break;
         }
     }
@@ -238,6 +254,7 @@
             
         case EPhoneDtmfDialerCancel:
             {
+            CloseDTMFEditorL();
             }
             break;    
             
@@ -250,6 +267,58 @@
     }
 
 // -----------------------------------------------------------
+// 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
 // -----------------------------------------------------------
 //
@@ -346,7 +415,7 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
     
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -387,11 +456,9 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
-    // Keep Phone in the foreground
-    TPhoneCmdParamBoolean booleanParam;
-    booleanParam.SetBoolean( EFalse );
-    iViewCommandHandle->ExecuteCommandL( 
-        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+  
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
 
     // Show bubble
     TPhoneCmdParamCallHeaderData callHeaderParam;
@@ -404,7 +471,7 @@
     CaptureKeysDuringCallNotificationL( EFalse );
     
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -431,6 +498,9 @@
     __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;
@@ -440,6 +510,7 @@
     BeginUiUpdateLC();
     
     SetTouchPaneButtons( EPhoneCallSetupButtons );
+    SetToolbarDimming( ETrue );
     SetToolbarButtonLoudspeakerEnabled();
     
     EndUiUpdate();
@@ -468,6 +539,9 @@
         booleanParam.SetBoolean( ETrue );
         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
         }
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
     
         // Set Hold flag to view
     TPhoneCmdParamBoolean holdFlag;
@@ -494,8 +568,11 @@
     // 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() )
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -510,8 +587,8 @@
     SetTouchPaneButtons( EPhoneCallSetupButtons );
     
     EndUiUpdate();
-    // Go to Single And Alerting state
-    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+	// Go to Single And Alerting state
+	UpdateCbaL( EPhoneCallHandlingInCallCBA );
     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
     }
 
@@ -522,10 +599,11 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
+	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
 
     BeginUiUpdateLC();
     
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
     
     EndUiUpdate();
@@ -542,11 +620,12 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
+	    "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
 
     BeginUiUpdateLC();
     
     SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
     
     EndUiUpdate();