phoneapp/phoneuicontrol/src/cphonestateincall.cpp
changeset 45 6b911d05207e
parent 37 ba76fc04e6c2
child 46 bc5a64e5bc3c
--- a/phoneapp/phoneuicontrol/src/cphonestateincall.cpp	Fri Jun 04 10:19:18 2010 +0100
+++ b/phoneapp/phoneuicontrol/src/cphonestateincall.cpp	Wed Jun 23 18:12:20 2010 +0300
@@ -204,19 +204,6 @@
         case MEngineMonitor::EPEMessageDTMFSendingAborted:
             CancelDTMFSendingL();
             break;
-
-        case MEngineMonitor::EPEMessagePromptSpeedDial:
-            HandleDTMFPromptSpeedDialL();
-            break;
-
-        case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
-            CPhoneState::SendGlobalErrorNoteL( 
-                EPhoneDtmfSpeedDialNotAssigned );
-            break;
-
-        case MEngineMonitor::EPEMessageInvalidSpeedDial:
-            CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial );
-            break;
             
         case MEngineMonitor::EPEMessageAudioVolumeChanged:
             HandleAudioVolumeChangedL();
@@ -285,6 +272,13 @@
     __LOGMETHODSTARTEND(EPhoneControl,  
         "CPhoneStateInCall::HandleIdleL()" );
     __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    TBool showDialer( EFalse );
+    HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( phoneNumber->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+
     // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   
@@ -295,40 +289,39 @@
     SetDefaultFlagsL();
     if ( IsNumberEntryUsedL() )
         {
-        // Show the number entry if it exists and update cba's.
-        SetNumberEntryVisibilityL( ETrue );
-        
-        // Close dtmf dialer when call is disconnected.
-        if ( IsDTMFEditorVisibleL() )
-            {      
-            CloseDTMFEditorL();
-            
-            // Display idle screen and update CBA's
-            DisplayIdleScreenL();
-            }
-        else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
             {            
             CloseCustomizedDialerL();
-            // Display idle screen and update CBA's
-            DisplayIdleScreenL();
-            }          
+            }
+        else 
+            {
+            iViewCommandHandle->ExecuteCommand(
+                    EPhoneViewGetNumberFromEntry,
+                    &stringParam );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+            showDialer = ETrue;
+            }
         }
-    else
-        {
-        // Close menu bar, if it is displayed
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
         
-        if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
-            {        
-            // Continue displaying current app but set up the 
-            // idle screen in the background
-            SetupIdleScreenInBackgroundL();
-            }
-        else
-            {
-            // Display idle screen and update CBAs
-            DisplayIdleScreenL();
-            }
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    
+    if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
+        {        
+        // Continue displaying current app but set up the 
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+    else if ( showDialer )
+        {
+        // Open dialer
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam );
+        }
+    else 
+        {
+        // Display idle screen and update CBAs
+        DisplayIdleScreenL();
         }
         
     DeleteTouchPaneButtons();        
@@ -337,6 +330,7 @@
     // Display call termination note, if necessary
     DisplayCallTerminationNoteL();
 
+    CleanupStack::PopAndDestroy( phoneNumber );
     // Go to idle state
     iStateMachine->ChangeState( EPhoneStateIdle );
     }
@@ -528,35 +522,6 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneStateInCall::HandleDtmfPromptSpeedDialL
-// -----------------------------------------------------------
-//
-void CPhoneStateInCall::HandleDTMFPromptSpeedDialL()
-    {
-    __LOGMETHODSTARTEND(EPhoneControl,  
-        "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" );
-    // Remove the Sending... note
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
-
-    // Prompt for speed dial number
-    HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
-    TPtr ptr( emptyString->Des() );
-
-    // If the Search softkey is selected before a speed dial number is entered,
-    // revert back to the DTMF query   
-    ShowDtmfTextQueryL( 
-        CPhoneMainResourceResolver::Instance()->
-            ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ),
-        CPhoneMainResourceResolver::Instance()->
-            ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
-        CPhoneMainResourceResolver::Instance()->
-            ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ),
-        &ptr );
-
-    CleanupStack::PopAndDestroy( emptyString );
-    }
-
-// -----------------------------------------------------------
 // CPhoneStateInCall::HandleCommandL
 // -----------------------------------------------------------
 //
@@ -641,11 +606,6 @@
             SendDtmfL();
             break;
 
-        // DTMF Speed entry - Ok
-        case EPhoneCmdDtmfSpeedDialOk:
-            SendDtmfSpeedDialNumberL();
-            break;
-
         // DTMF sending - Cancel
         case EPhoneInCallCmdCancelSendingDtmfString:
             // Stop the asynchronous sending operation the 
@@ -971,34 +931,6 @@
     
     CleanupStack::PopAndDestroy( content );
     }
-    
-// -----------------------------------------------------------
-// CPhoneStateInCall::SendDtmfSpeedDialNumberL
-// -----------------------------------------------------------
-//
-void CPhoneStateInCall::SendDtmfSpeedDialNumberL()
-    {
-    __LOGMETHODSTARTEND(EPhoneControl,  
-        "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" );
-    // First get the DTMF sequence from dialog
-    TPhoneCmdParamString dtmfSequence;
-    HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
-    TPtr ptr( content->Des() );
-    dtmfSequence.SetString( &ptr );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
-        &dtmfSequence );
-
-    // Prefix the query content string with the speed dial character '+'
-    _LIT( KSpeedDialPrefix, "+" );
-    ptr.Insert( 0, KSpeedDialPrefix );
-
-    // Send the DTMF
-    iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
-    iStateMachine->SendPhoneEngineMessage(
-        MPEPhoneModel::EPEMessageSendDTMF );    
-
-    CleanupStack::PopAndDestroy( content );
-    }
 
 // -----------------------------------------------------------
 // CPhoneStateInCall::LaunchDtmfManualQueryL