phoneapp/phoneuistates/src/cphonealerting.cpp
branchRCL_3
changeset 24 41a7f70b3818
parent 23 40a3f856b14d
child 25 5266b1f337bd
equal deleted inserted replaced
23:40a3f856b14d 24:41a7f70b3818
     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>
       
    25 #include "cphonealerting.h"
    24 #include "cphonealerting.h"
    26 #include "mphonestatemachine.h"
    25 #include "mphonestatemachine.h"
    27 #include "tphonecmdparamboolean.h"
    26 #include "tphonecmdparamboolean.h"
    28 #include "tphonecmdparaminteger.h"
    27 #include "tphonecmdparaminteger.h"
    29 #include "tphonecmdparamcallstatedata.h"
    28 #include "tphonecmdparamcallstatedata.h"
   115                 }
   114                 }
   116             else
   115             else
   117                 {
   116                 {
   118                 // Show not allowed note
   117                 // Show not allowed note
   119                 SendGlobalErrorNoteL( 
   118                 SendGlobalErrorNoteL( 
   120                     EPhoneNoteTextNotAllowed );
   119                     EPhoneNoteTextNotAllowed, ETrue );
   121                 }
   120                 }
   122             break;
   121             break;
   123 
   122 
   124         // end-key
   123         // end-key
   125         case EKeyNo:
   124         case EKeyNo:
   130                 iStateMachine->SendPhoneEngineMessage(
   129                 iStateMachine->SendPhoneEngineMessage(
   131                     MPEPhoneModel::EPEMessageTerminateAllConnections ); 
   130                     MPEPhoneModel::EPEMessageTerminateAllConnections ); 
   132 
   131 
   133                 if ( IsNumberEntryUsedL() )
   132                 if ( IsNumberEntryUsedL() )
   134                     {
   133                     {
   135                     CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose );
   134                     // Remove number entry from screen
       
   135                     iViewCommandHandle->ExecuteCommandL( 
       
   136                         EPhoneViewRemoveNumberEntry );
       
   137                     // Do state-specific operation when number entry is cleared
       
   138                     HandleNumberEntryClearedL();
   136                     }
   139                     }
   137                 if ( !TopAppIsDisplayedL() )
   140                 if ( !TopAppIsDisplayedL() )
   138                     {
   141                     {
   139                     // Bring app to foreground
   142                     // Bring app to foreground
   140                     TPhoneCmdParamInteger uidParam;
   143                     TPhoneCmdParamInteger uidParam;
   169         "CPhoneAlerting::HandlePhoneEngineMessageL()");
   172         "CPhoneAlerting::HandlePhoneEngineMessageL()");
   170     
   173     
   171     switch ( aMessage )
   174     switch ( aMessage )
   172         {
   175         {
   173         case MEngineMonitor::EPEMessageConnected:
   176         case MEngineMonitor::EPEMessageConnected:
   174             {
       
   175             HandleConnectedL( aCallId );
   177             HandleConnectedL( aCallId );
   176             }
       
   177             break;
   178             break;
   178         
   179         
   179         case MEngineMonitor::EPEMessageDisconnecting:
   180         case MEngineMonitor::EPEMessageDisconnecting:
   180             {
       
   181             HandleDisconnectingL( aCallId );
   181             HandleDisconnectingL( aCallId );
   182             }
       
   183             break;
   182             break;
   184         
   183         
   185         case MEngineMonitor::EPEMessageRemoteTerminated:
   184         case MEngineMonitor::EPEMessageRemoteTerminated:
   186             {
       
   187             iViewCommandHandle->ExecuteCommandL( 
   185             iViewCommandHandle->ExecuteCommandL( 
   188                 EPhoneViewHideNaviPaneAudioVolume );            
   186                 EPhoneViewHideNaviPaneAudioVolume );
   189             }
   187             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   190             break;
   188             break;
   191         
   189         
   192         case MEngineMonitor::EPEMessageIncoming:
   190         case MEngineMonitor::EPEMessageIncoming:
   193             {
   191             {
   194             // If incoming message is received in alerting state, teardown of
   192             // If incoming message is received in alerting state, teardown of
   218                 
   216                 
   219                 return;
   217                 return;
   220                 }
   218                 }
   221             }
   219             }
   222             break;
   220             break;
   223                    
       
   224         
   221         
   225         default:
   222         default:
   226             break;
   223             break;
   227         }
   224         }
   228 
   225 
   235 //
   232 //
   236 EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId )
   233 EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId )
   237     {
   234     {
   238     __LOGMETHODSTARTEND( EPhoneUIStates,
   235     __LOGMETHODSTARTEND( EPhoneUIStates,
   239         "CPhoneAlerting::HandleConnectedL()");
   236         "CPhoneAlerting::HandleConnectedL()");
   240 
   237     // Keep Phone in the foreground
   241     // Close menu bar, if it is displayed
   238     TPhoneCmdParamBoolean booleanParam;
   242     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   239     booleanParam.SetBoolean( EFalse );
       
   240     iViewCommandHandle->ExecuteCommandL( 
       
   241         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   243 
   242 
   244     BeginUiUpdateLC();
   243     BeginUiUpdateLC();
   245 
   244         
   246     // Update the single call
   245     // Update the single call
   247     UpdateSingleActiveCallL( aCallId );
   246     UpdateSingleActiveCallL( aCallId );
   248 
   247 
   249     SetTouchPaneButtons( EPhoneIncallButtons );
   248     SetTouchPaneButtons( EPhoneIncallButtons ); 
   250 
   249         
   251     SetToolbarDimming( EFalse );
       
   252 
       
   253     EndUiUpdate();
   250     EndUiUpdate();
   254     
   251     
   255     // Go to single state
   252     // Go to single state
   256     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   253     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   257     iStateMachine->ChangeState( EPhoneStateSingle );
   254     iStateMachine->ChangeState( EPhoneStateSingle );
   258     }
   255     }
   259 
   256 
   260 // -----------------------------------------------------------
   257 // -----------------------------------------------------------
   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 // -----------------------------------------------------------
       
   297 // CPhoneAlerting::HandleCommandL
   258 // CPhoneAlerting::HandleCommandL
   298 // -----------------------------------------------------------
   259 // -----------------------------------------------------------
   299 //
   260 //
   300 EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand )
   261 EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand )
   301     {
   262     {
   302     __LOGMETHODSTARTEND( EPhoneUIStates,  
   263     __LOGMETHODSTARTEND( EPhoneUIStates,  
   303         "CPhoneAlerting::HandleCommandL()" );
   264         "CPhoneAlerting::HandleCommandL()" );
   304     TBool commandStatus = ETrue;
   265     return CPhoneGsmInCall::HandleCommandL( aCommand );
   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;
       
   328     }
   266     }
   329 
   267 
   330 // -----------------------------------------------------------
   268 // -----------------------------------------------------------
   331 // CPhoneAlerting::IsVideoCallAlertingL
   269 // CPhoneAlerting::IsVideoCallAlertingL
   332 // -----------------------------------------------------------
   270 // -----------------------------------------------------------
   367 //
   305 //
   368 EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId )
   306 EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId )
   369     {
   307     {
   370     __LOGMETHODSTARTEND( EPhoneUIStates,  
   308     __LOGMETHODSTARTEND( EPhoneUIStates,  
   371             "CPhoneAlerting::HandleDisconnectingL()" );
   309             "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     
       
   379     CPhoneGsmInCall::HandleDisconnectingL( aCallId );
   310     CPhoneGsmInCall::HandleDisconnectingL( aCallId );
   380     }
   311     }
   381 
   312 
   382 
   313 
   383 
   314