phoneapp/phoneuicontrol/src/cphonestateidle.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 22 6bb1b21d2484
parent 46 bc5a64e5bc3c
--- a/phoneapp/phoneuicontrol/src/cphonestateidle.cpp	Tue Jun 15 14:14:38 2010 +0100
+++ b/phoneapp/phoneuicontrol/src/cphonestateidle.cpp	Thu Jul 22 16:33:21 2010 +0100
@@ -28,7 +28,6 @@
 #include <featmgr.h>
 #include <settingsinternalcrkeys.h>
 #include <mpeengineinfo.h>
-#include <activeidle2domainpskeys.h>
 #include <mpeclientinformation.h>
 #include <bldvariant.hrh>
 
@@ -38,8 +37,8 @@
 #include "tphonecmdparaminteger.h"
 #include "tphonecmdparamboolean.h"
 #include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamkeycapture.h"
 #include "tphonecmdparamstring.h"
-#include "tphonecmdparamspeeddial.h"
 #include "tphonecmdparamboolean.h"
 #include "mphonestatemachine.h"
 #include "phonestatedefinitions.h"
@@ -279,22 +278,6 @@
                 }
             break;
             
-        // number key
-        case KPhoneDtmf1Character:
-        case KPhoneDtmf2Character:
-        case KPhoneDtmf3Character:
-        case KPhoneDtmf4Character:
-        case KPhoneDtmf5Character:
-        case KPhoneDtmf6Character:
-        case KPhoneDtmf7Character:
-        case KPhoneDtmf8Character:
-        case KPhoneDtmf9Character:
-            if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
-                {
-                HandleNumberLongKeyPressL();
-                }
-            break;
-
 #ifdef RD_INTELLIGENT_TEXT_INPUT   
         case EKeyEnter:
             if ( IsNumberEntryVisibleL() )
@@ -361,7 +344,7 @@
             break;
             
         case MEngineMonitor::EPEMessageInValidEmergencyNumber:                
-            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );                           
+            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue );                           
             break;
             
         case MEngineMonitor::EPEMessageValidEmergencyNumber:
@@ -440,8 +423,6 @@
 
     BeginTransEffectLC( ENumberEntryClose );
     BeginUiUpdateLC();
-    
-    SetNumberEntryVisibilityL(EFalse);
 
     // Display call setup 
     DisplayCallSetupL( aCallId );  
@@ -536,7 +517,7 @@
             }
         
         case EPhoneNumberAcqCmdCall:
-            HandleVoiceCallCommandL( EFalse );
+            HandleVoiceCallCommandL();
             break;
         case EPhoneNumberAcqCmdSendCommand:
             HandleSendCommandL();
@@ -688,17 +669,9 @@
         else
 #endif // _DEBUG
             {
-            if ( IsSpeedDialNumber( (*phoneNumber) ) )
-                {
-                // Handle speed dial
-                SpeedDialL( (*phoneNumber)[0], EDialMethodMenuSelection );
-                }
-            else
-                {
-                // call the number
-                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
-                DialMultimediaCallL();
-                }
+            // call the number
+            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+            DialMultimediaCallL();
 
             CleanupStack::PopAndDestroy( phoneNumber );
             }
@@ -720,6 +693,10 @@
     // Remove any phone dialogs if they are displayed
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
 
+    TPhoneCmdParamKeyCapture captureParam;
+    captureParam.SetKeyCode( EKeyNo );
+    iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
+    
     // Capture keys when there is an incoming call
     CaptureKeysDuringCallNotificationL( ETrue );
 
@@ -764,6 +741,10 @@
     // Close menu bar, if it is displayed
     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
 
+    TPhoneCmdParamKeyCapture captureParam;
+    captureParam.SetKeyCode( EKeyNo );
+    iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam );
+    
     // Capture keys when the phone is dialling
     CaptureKeysDuringCallNotificationL( ETrue );
 
@@ -858,116 +839,6 @@
     // Remove all notes and dialogs
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );    
     }
- 
-// -----------------------------------------------------------
-// CPhoneStateIdle::SpeedDialL
-// -----------------------------------------------------------
-//   
-EXPORT_C void CPhoneStateIdle::SpeedDialL( const TUint& aDigit, 
-        TDialInitiationMethod aDialMethod )
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialL( ) ");
-    
-    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
-    
-    TPhoneCmdParamSpeedDial speedDialParam;
-    HBufC* phoneNumber = NumberForSpeedDialLocationL( aDigit, speedDialParam );
-
-    // Store serviceId received from vmbx handler
-    iStateMachine->PhoneEngineInfo()->SetServiceIdCommand( speedDialParam.ServiceId() );
-    CleanupStack::PushL( phoneNumber );
-    
-    if ( NULL != phoneNumber && KNullDesC() != *phoneNumber )
-        {
-
-
-        DialL( *phoneNumber, speedDialParam.NumberType(), aDialMethod );
-        
-        if ( IsNumberEntryUsedL()  ) 
-            {
-            BeginTransEffectLC( ENumberEntryClose ); 
-            
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
-            
-            // Set Idle background, if still idle
-            if ( iStateMachine->State() == this )
-                {
-                SetupIdleScreenInBackgroundL();
-                }
-            
-            EndTransEffect();
-            }
-        }
-    else
-        {
-        // User cancelled dialog or didn't give a valid number
-        SpeedDialCanceledL( aDigit );
-        }
-    
-    CleanupStack::PopAndDestroy( phoneNumber );
-    }
-
-// -----------------------------------------------------------
-// CPhoneStateIdle:SpeedDialCanceledL
-// -----------------------------------------------------------
-//
-EXPORT_C void CPhoneStateIdle::SpeedDialCanceledL( const TUint& aDigit )
-
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialCanceledL( ) ");
-    if ( IsNumberEntryUsedL() )
-        {
-        if ( aDigit == KPhoneDtmf1Character || 
-                  ( aDigit == KPhoneDtmf2Character && 
-                    iViewCommandHandle->HandleCommandL( 
-                     EPhoneViewIsStraightCallToVideoMailBox ) == EPhoneViewResponseSuccess ) ) 
-            {
-            // Remove number entry and set idle background on non-touch products
-            if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
-                {
-                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
-                
-                // Set Idle background, if still idle ( f.e not incoming call arrived )
-                if ( iStateMachine->State() == this )
-                    {
-                    // idle screen in the background
-                    SetupIdleScreenInBackgroundL();
-                    }
-                }
-            }
-        }        
-    }
-
-// -----------------------------------------------------------
-// CPhoneStateIdle::HandleNumberLongKeyPressL()
-// -----------------------------------------------------------
-//
-EXPORT_C void CPhoneStateIdle::HandleNumberLongKeyPressL()
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, 
-        "CPhoneStateIdle::HandleNumberLongKeyPressL( ) ");
-    
-    HBufC* phoneNumber = PhoneNumberFromEntryLC();
-    
-    if ( phoneNumber && IsSpeedDialNumber ( *phoneNumber ) )
-        {
-        SpeedDialL( (*phoneNumber)[0], EDialMethodOneKeyDialing );
-        }
-    
-    CleanupStack::PopAndDestroy( phoneNumber );
-    }
-
-// -----------------------------------------------------------
-// CPhoneStateIdle::IsSpeedDialNumber()
-// -----------------------------------------------------------
-//
-EXPORT_C TBool CPhoneStateIdle::IsSpeedDialNumber( 
-        const TDesC& aNumber ) const
-    {
-    return ( aNumber.Length() == KPhoneDtmfSpeedDialPrefixLength 
-            && aNumber[0] >= KPhoneDtmf1Character 
-            && aNumber[0] <= KPhoneDtmf9Character );
-    }
 
 // -----------------------------------------------------------
 // CPhoneStateIdle::HandleSendCommandL()
@@ -978,7 +849,7 @@
     __LOGMETHODSTARTEND(
         EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
     
-    HandleVoiceCallCommandL( ETrue );
+    HandleVoiceCallCommandL();
     }
 
 // -----------------------------------------------------------
@@ -1157,46 +1028,7 @@
 //
 void CPhoneStateIdle::ChangeMannerModeL()
     {
-    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) ");
-
-    // Get the profile information
-    const TInt profileId = 
-        iStateMachine->PhoneEngineInfo()->ProfileId();
-    TInt newProfile;
-    
-    if ( profileId == EProfileSilentId )
-        {
-        newProfile = EProfileGeneralId;
-        }
-    else
-        {
-        newProfile = EProfileSilentId;    
-        }
-        
-    if ( !iEngine )
-        {
-        iEngine = CreateProfileEngineL();
-        }
-
-    iEngine->SetActiveProfileL( newProfile );
-    
-    // Stop playing DTMF tone
-    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); 
-    
-    if ( !iOnScreenDialer )
-        {
-        // Remove the number entry
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
-        }
-    else
-        {
-        NumberEntryClearL();
-        }
-    
-    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
- 
-     // Bring Idle app to the top app
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );            
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) ");         
     }
 
 // -----------------------------------------------------------
@@ -1318,35 +1150,10 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneStateIdle::NumberForSpeedDialLocationL
-// -----------------------------------------------------------
-// 
-HBufC* CPhoneStateIdle::NumberForSpeedDialLocationL( 
-        const TUint& aDigit,
-        TPhoneCmdParamSpeedDial& aSpeedDialParam ) const
-    {
-    // Set the speed dial location from the digit in buffer. Character
-    // '1' means location 1, and so on.
-    const TInt location = aDigit - KPhoneDtmf1Character + 1;
-    aSpeedDialParam.SetLocation( location );
-    
-    // Get the number and type from the speed dial location.
-    HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
-    
-    TPtr ptr( phoneNumber->Des() );
-    aSpeedDialParam.SetPhoneNumber( &ptr );
-    iViewCommandHandle->HandleCommandL( 
-        EPhoneViewGetNumberFromSpeedDialLocation, &aSpeedDialParam );
-
-    CleanupStack::Pop( phoneNumber );
-    return phoneNumber;
-    }
-
-// -----------------------------------------------------------
 // CPhoneStateIdle::HandleVoiceCallCommandL()
 // -----------------------------------------------------------
 //
-void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey )
+void CPhoneStateIdle::HandleVoiceCallCommandL()
     {
     __LOGMETHODSTARTEND(
         EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" );
@@ -1374,18 +1181,9 @@
         else
 #endif // _DEBUG
             {
-            if ( IsSpeedDialNumber( *phoneNumber ) )
-                {
-                // Handle speed dial
-                SpeedDialL( (*phoneNumber)[0], aSendKey ? EDialMethodSendCommand : EDialMethodMenuSelection );
-                }
-            else
-                {
-                // call the number
-                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
-                DialVoiceCallL();
-                }
-            
+            // call the number
+            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+            DialVoiceCallL();
             CleanupStack::PopAndDestroy( phoneNumber );
             }
         }