phoneapp/phoneuistates/src/cphonealerting.cpp
branchRCL_3
changeset 25 5266b1f337bd
parent 24 41a7f70b3818
child 26 8baf28733c3d
equal deleted inserted replaced
24:41a7f70b3818 25:5266b1f337bd
     1 /*
     1 /*
     2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 // INCLUDES
    19 // INCLUDES
    20 #include <pevirtualengine.h>
    20 #include <pevirtualengine.h>
    21 #include <mpeengineinfo.h>
    21 #include <mpeengineinfo.h>
    22 #include <mpeclientinformation.h>
    22 #include <mpeclientinformation.h>
    23 #include <MediatorDomainUIDs.h>
    23 #include <MediatorDomainUIDs.h>
       
    24 #include <videotelcontrolmediatorapi.h>
    24 #include "cphonealerting.h"
    25 #include "cphonealerting.h"
    25 #include "mphonestatemachine.h"
    26 #include "mphonestatemachine.h"
    26 #include "tphonecmdparamboolean.h"
    27 #include "tphonecmdparamboolean.h"
    27 #include "tphonecmdparaminteger.h"
    28 #include "tphonecmdparaminteger.h"
    28 #include "tphonecmdparamcallstatedata.h"
    29 #include "tphonecmdparamcallstatedata.h"
   114                 }
   115                 }
   115             else
   116             else
   116                 {
   117                 {
   117                 // Show not allowed note
   118                 // Show not allowed note
   118                 SendGlobalErrorNoteL( 
   119                 SendGlobalErrorNoteL( 
   119                     EPhoneNoteTextNotAllowed, ETrue );
   120                     EPhoneNoteTextNotAllowed );
   120                 }
   121                 }
   121             break;
   122             break;
   122 
   123 
   123         // end-key
   124         // end-key
   124         case EKeyNo:
   125         case EKeyNo:
   129                 iStateMachine->SendPhoneEngineMessage(
   130                 iStateMachine->SendPhoneEngineMessage(
   130                     MPEPhoneModel::EPEMessageTerminateAllConnections ); 
   131                     MPEPhoneModel::EPEMessageTerminateAllConnections ); 
   131 
   132 
   132                 if ( IsNumberEntryUsedL() )
   133                 if ( IsNumberEntryUsedL() )
   133                     {
   134                     {
   134                     // Remove number entry from screen
   135                     CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
   135                     iViewCommandHandle->ExecuteCommandL( 
       
   136                         EPhoneViewRemoveNumberEntry );
       
   137                     // Do state-specific operation when number entry is cleared
       
   138                     HandleNumberEntryClearedL();
       
   139                     }
   136                     }
   140                 if ( !TopAppIsDisplayedL() )
   137                 if ( !TopAppIsDisplayedL() )
   141                     {
   138                     {
   142                     // Bring app to foreground
   139                     // Bring app to foreground
   143                     TPhoneCmdParamInteger uidParam;
   140                     TPhoneCmdParamInteger uidParam;
   172         "CPhoneAlerting::HandlePhoneEngineMessageL()");
   169         "CPhoneAlerting::HandlePhoneEngineMessageL()");
   173     
   170     
   174     switch ( aMessage )
   171     switch ( aMessage )
   175         {
   172         {
   176         case MEngineMonitor::EPEMessageConnected:
   173         case MEngineMonitor::EPEMessageConnected:
       
   174             {
   177             HandleConnectedL( aCallId );
   175             HandleConnectedL( aCallId );
       
   176             }
   178             break;
   177             break;
   179         
   178         
   180         case MEngineMonitor::EPEMessageDisconnecting:
   179         case MEngineMonitor::EPEMessageDisconnecting:
       
   180             {
   181             HandleDisconnectingL( aCallId );
   181             HandleDisconnectingL( aCallId );
       
   182             }
   182             break;
   183             break;
   183         
   184         
   184         case MEngineMonitor::EPEMessageRemoteTerminated:
   185         case MEngineMonitor::EPEMessageRemoteTerminated:
       
   186             {
   185             iViewCommandHandle->ExecuteCommandL( 
   187             iViewCommandHandle->ExecuteCommandL( 
   186                 EPhoneViewHideNaviPaneAudioVolume );
   188                 EPhoneViewHideNaviPaneAudioVolume );            
   187             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   189             }
   188             break;
   190             break;
   189         
   191         
   190         case MEngineMonitor::EPEMessageIncoming:
   192         case MEngineMonitor::EPEMessageIncoming:
   191             {
   193             {
   192             // If incoming message is received in alerting state, teardown of
   194             // If incoming message is received in alerting state, teardown of
   216                 
   218                 
   217                 return;
   219                 return;
   218                 }
   220                 }
   219             }
   221             }
   220             break;
   222             break;
       
   223                    
   221         
   224         
   222         default:
   225         default:
   223             break;
   226             break;
   224         }
   227         }
   225 
   228 
   232 //
   235 //
   233 EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId )
   236 EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId )
   234     {
   237     {
   235     __LOGMETHODSTARTEND( EPhoneUIStates,
   238     __LOGMETHODSTARTEND( EPhoneUIStates,
   236         "CPhoneAlerting::HandleConnectedL()");
   239         "CPhoneAlerting::HandleConnectedL()");
   237     // Keep Phone in the foreground
   240 
   238     TPhoneCmdParamBoolean booleanParam;
   241     // Close menu bar, if it is displayed
   239     booleanParam.SetBoolean( EFalse );
   242     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   240     iViewCommandHandle->ExecuteCommandL( 
       
   241         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
       
   242 
   243 
   243     BeginUiUpdateLC();
   244     BeginUiUpdateLC();
   244         
   245 
   245     // Update the single call
   246     // Update the single call
   246     UpdateSingleActiveCallL( aCallId );
   247     UpdateSingleActiveCallL( aCallId );
   247 
   248 
   248     SetTouchPaneButtons( EPhoneIncallButtons ); 
   249     SetTouchPaneButtons( EPhoneIncallButtons );
   249         
   250 
       
   251     SetToolbarDimming( EFalse );
       
   252 
   250     EndUiUpdate();
   253     EndUiUpdate();
   251     
   254     
   252     // Go to single state
   255     // Go to single state
   253     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   256     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   254     iStateMachine->ChangeState( EPhoneStateSingle );
   257     iStateMachine->ChangeState( EPhoneStateSingle );
   255     }
   258     }
   256 
   259 
   257 // -----------------------------------------------------------
   260 // -----------------------------------------------------------
       
   261 // CPhoneAlerting::OpenMenuBarL
       
   262 // -----------------------------------------------------------
       
   263 //
       
   264 EXPORT_C void CPhoneAlerting::OpenMenuBarL()
       
   265     {
       
   266     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   267         "CPhoneAlerting::OpenMenuBarL()");
       
   268     TInt resourceId;
       
   269 
       
   270     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   271         {
       
   272         resourceId = EPhoneDtmfDialerMenubar;
       
   273         }
       
   274     else if ( IsNumberEntryVisibleL() )
       
   275         {
       
   276         resourceId = EPhoneAlertingCallMenubarWithNumberEntry;
       
   277         }
       
   278     // Use different resources for alerting data, video and cs call
       
   279     else if( IsVideoCallAlertingL() )
       
   280         {
       
   281         resourceId = EPhoneAlertingVideoCallMenubar;
       
   282         }
       
   283     else
       
   284         {
       
   285         resourceId = EPhoneAlertingCallMenubar;
       
   286         }            
       
   287  
       
   288     TPhoneCmdParamInteger integerParam;
       
   289     integerParam.SetInteger( 
       
   290         CPhoneMainResourceResolver::Instance()->
       
   291         ResolveResourceID( resourceId ) );
       
   292     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   293         &integerParam );
       
   294     }
       
   295 
       
   296 // -----------------------------------------------------------
   258 // CPhoneAlerting::HandleCommandL
   297 // CPhoneAlerting::HandleCommandL
   259 // -----------------------------------------------------------
   298 // -----------------------------------------------------------
   260 //
   299 //
   261 EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand )
   300 EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand )
   262     {
   301     {
   263     __LOGMETHODSTARTEND( EPhoneUIStates,  
   302     __LOGMETHODSTARTEND( EPhoneUIStates,  
   264         "CPhoneAlerting::HandleCommandL()" );
   303         "CPhoneAlerting::HandleCommandL()" );
   265     return CPhoneGsmInCall::HandleCommandL( aCommand );
   304     TBool commandStatus = ETrue;
       
   305 
       
   306     switch( aCommand )
       
   307         {
       
   308         case EPhoneInCallCmdHelp:
       
   309             {
       
   310             TPtrC contextName;
       
   311             if ( IsVideoCallAlertingL() )
       
   312                 {
       
   313                 contextName.Set( KINCAL_HLP_VIDEOCALL() );    
       
   314                 }
       
   315             else
       
   316                 {
       
   317                 contextName.Set( KINCAL_HLP_CALL_HANDLING() );
       
   318                 }
       
   319             iViewCommandHandle->ExecuteCommandL(
       
   320                 EPhoneViewLaunchHelpApplication, 0, contextName );
       
   321             }
       
   322             break;
       
   323         default:
       
   324             commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
       
   325             break;
       
   326         }
       
   327     return commandStatus;
   266     }
   328     }
   267 
   329 
   268 // -----------------------------------------------------------
   330 // -----------------------------------------------------------
   269 // CPhoneAlerting::IsVideoCallAlertingL
   331 // CPhoneAlerting::IsVideoCallAlertingL
   270 // -----------------------------------------------------------
   332 // -----------------------------------------------------------
   305 //
   367 //
   306 EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId )
   368 EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId )
   307     {
   369     {
   308     __LOGMETHODSTARTEND( EPhoneUIStates,  
   370     __LOGMETHODSTARTEND( EPhoneUIStates,  
   309             "CPhoneAlerting::HandleDisconnectingL()" );
   371             "CPhoneAlerting::HandleDisconnectingL()" );
       
   372     
       
   373     if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aCallId ) == EPECallOriginSAT )
       
   374         {
       
   375         // User has hangup alerting SAT call, complete sat request
       
   376         CompleteSatRequestL( aCallId );
       
   377         }
       
   378     
   310     CPhoneGsmInCall::HandleDisconnectingL( aCallId );
   379     CPhoneGsmInCall::HandleDisconnectingL( aCallId );
   311     }
   380     }
   312 
   381 
   313 
   382 
   314 
   383