phoneapp/phoneuistates/src/cphonegsmincall.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    33 #include "cphonemainresourceresolver.h"
    33 #include "cphonemainresourceresolver.h"
    34 #include "phoneui.hrh"
    34 #include "phoneui.hrh"
    35 
    35 
    36 #include "tphonecmdparamcallstatedata.h"
    36 #include "tphonecmdparamcallstatedata.h"
    37 #include "tphonecmdparamcallheaderdata.h"
    37 #include "tphonecmdparamcallheaderdata.h"
    38 #include "mphonesecuritymodeobserver.h"
       
    39 
    38 
    40 // ================= MEMBER FUNCTIONS =======================
    39 // ================= MEMBER FUNCTIONS =======================
    41 
    40 
    42 // C++ default constructor can NOT contain any code, that
    41 // C++ default constructor can NOT contain any code, that
    43 // might leave.
    42 // might leave.
   105         "CPhoneGsmInCall::HandlePhoneEngineMessageL() ");
   104         "CPhoneGsmInCall::HandlePhoneEngineMessageL() ");
   106     switch ( aMessage )
   105     switch ( aMessage )
   107         {
   106         {
   108         case MEngineMonitor::EPEMessageRemoteHeld:
   107         case MEngineMonitor::EPEMessageRemoteHeld:
   109             CPhoneState::SendGlobalInfoNoteL( 
   108             CPhoneState::SendGlobalInfoNoteL( 
   110                 EPhoneInformationRemotePutOnHoldNote );
   109                 EPhoneInformationRemotePutOnHoldNote, ETrue );
   111             break;
   110             break;
   112         
   111         
   113         case MEngineMonitor::EPEMessageRemoteResumed:
   112         case MEngineMonitor::EPEMessageRemoteResumed:
   114             CPhoneState::SendGlobalInfoNoteL( 
   113             CPhoneState::SendGlobalInfoNoteL( 
   115                 EPhoneInformationConnectedNote );
   114                 EPhoneInformationConnectedNote, ETrue );
   116             break;
   115             break;
   117             
   116             
   118         case MEngineMonitor::EPEMessageRemoteCreatedConference:
   117         case MEngineMonitor::EPEMessageRemoteCreatedConference:
   119             CPhoneState::SendGlobalInfoNoteL( 
   118             CPhoneState::SendGlobalInfoNoteL( 
   120                 EPhoneInformationRemoteCreateConferenceNote );
   119                 EPhoneInformationRemoteCreateConferenceNote, ETrue );
   121             break;        
   120             break;        
   122 			
       
   123 		case MEngineMonitor::EPEMessageShowVersion:
       
   124 			{
       
   125 			if ( iStateMachine->SecurityMode()->IsSecurityMode() )
       
   126 				{
       
   127 				// Do nothing if security mode is enabled.
       
   128 				return;
       
   129 				}
       
   130 			}
       
   131 		// Fall through
       
   132 		
       
   133         case MEngineMonitor::EPEMessageIncCallIsForw:  // fall through
   121         case MEngineMonitor::EPEMessageIncCallIsForw:  // fall through
   134         case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
   122         case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
   135         case MEngineMonitor::EPEMessageCallBarred: // fall through
   123         case MEngineMonitor::EPEMessageCallBarred: // fall through
   136         case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
   124         case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
   137         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   125         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   138         case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
   126         case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
   139         case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
   127         case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
   140         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
   128         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
   141         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   129         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   142 			{
   130             {
   143 			CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
   131             CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
   144 				CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
   132                 CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
   145 													   *iViewCommandHandle,
   133                                                        *iViewCommandHandle,
   146 													   *this );
   134                                                        *this );
   147 			CleanupStack::PushL( gsmMsgHandler );
   135             CleanupStack::PushL( gsmMsgHandler );
   148 			gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
   136             gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
   149 			CleanupStack::PopAndDestroy( gsmMsgHandler );
   137             CleanupStack::PopAndDestroy( gsmMsgHandler );
   150 			
   138             
   151             // Needed also in non-touch, if call waiting request (*43#) 
   139             // Needed also in non-touch, if call waiting request (*43#) 
   152             // is sent during active call at least.
   140             // is sent during active call at least.
   153 			if ( aMessage == MEngineMonitor::EPEMessageIncCallIsForw )
   141             UpdateCbaL( EPhoneCallHandlingInCallCBA );
   154 				{
       
   155 				UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   156 				}
       
   157 			else 
       
   158 				{
       
   159 				UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   160 				}						
       
   161 			}
   142 			}
   162 			break;
   143 			break;
   163 			
   144 			
   164         case MEngineMonitor::EPEMessageColpNumberAvailable:
   145         case MEngineMonitor::EPEMessageColpNumberAvailable:
   165             {
   146             {
   192                 CPEPhoneModelIF::EPEMessageAnswer );
   173                 CPEPhoneModelIF::EPEMessageAnswer );
   193             break;
   174             break;
   194         
   175         
   195         // 'Replace' from menu            
   176         // 'Replace' from menu            
   196         case EPhoneInCallCmdReplace:
   177         case EPhoneInCallCmdReplace:
   197         	ReplaceCallL();
   178             ReplaceCallL();
   198             break;
   179             break;
   199         
   180         
   200         case EPhoneInCallCmdSwap:
   181         case EPhoneInCallCmdSwap:
   201             iStateMachine->SendPhoneEngineMessage(
   182             iStateMachine->SendPhoneEngineMessage(
   202                 CPEPhoneModelIF::EPEMessageSwap ); 
   183                 CPEPhoneModelIF::EPEMessageSwap ); 
   248 
   229 
   249     MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
   230     MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
   250     
   231     
   251     TPhoneCmdParamGlobalNote globalNoteParam;
   232     TPhoneCmdParamGlobalNote globalNoteParam;
   252     globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
   233     globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
   253     globalNoteParam.SetType( EAknGlobalInformationNote );
   234     globalNoteParam.SetType( EPhoneNotificationDialog );
   254     globalNoteParam.SetTextResourceId( 
   235     globalNoteParam.SetTextResourceId( 
   255             CPhoneMainResourceResolver::Instance()->
   236             CPhoneMainResourceResolver::Instance()->
   256 	        ResolveResourceID( EPhoneColpConnected ) );
   237 	        ResolveResourceID( EPhoneColpConnected ) );
   257     globalNoteParam.SetTone( EAvkonSIDInformationTone );
   238     globalNoteParam.SetNotificationDialog( ETrue );
   258 	        
   239 	        
   259     iViewCommandHandle->ExecuteCommandL( 
   240     iViewCommandHandle->ExecuteCommandL( 
   260             EPhoneViewShowGlobalNote, &globalNoteParam );
   241             EPhoneViewShowGlobalNote, &globalNoteParam );
   261     
   242     
   262     }
   243     }
   266 // -----------------------------------------------------------
   247 // -----------------------------------------------------------
   267 //
   248 //
   268 void CPhoneGsmInCall::BringIncomingToForegroundL()
   249 void CPhoneGsmInCall::BringIncomingToForegroundL()
   269     {
   250     {
   270     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) ");
   251     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) ");
   271 
       
   272     // Close menu bar, if it is displayed
       
   273     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   274 
   252 
   275     // Remove any phone dialogs if they are displayed
   253     // Remove any phone dialogs if they are displayed
   276     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   254     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   277 
   255 
   278     // Capture keys when there is an incoming call
   256     // Capture keys when there is an incoming call
   305 void CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL( 
   283 void CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL( 
   306     TPhoneCmdParamBoolean& aCommandParam )
   284     TPhoneCmdParamBoolean& aCommandParam )
   307     {
   285     {
   308     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL() ");
   286     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL() ");
   309 
   287 
   310     iViewCommandHandle->ExecuteCommandL( 
   288     if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
   311         EPhoneViewAllowWaitingCallHeader, 
       
   312         &aCommandParam );
       
   313     
       
   314     // Non-touch :Hide number entry if it exists on 
       
   315     // Touch : an internal operation ongoing 
       
   316     // -> do not hide dialer
       
   317     if ( !iOnScreenDialer )
       
   318         {   
       
   319         SetNumberEntryVisibilityL(EFalse);
       
   320         }
       
   321     // If param is true and number entry is open only then
       
   322     // hide number entry.
       
   323     else if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
       
   324         {
   289         {
   325         SetNumberEntryVisibilityL(EFalse);
   290         SetNumberEntryVisibilityL(EFalse);
   326         }
   291         }
   327     }
   292     }
   328 
   293 
   331 // -----------------------------------------------------------
   296 // -----------------------------------------------------------
   332 //
   297 //
   333 EXPORT_C void CPhoneGsmInCall::HandlePhoneForegroundEventL()
   298 EXPORT_C void CPhoneGsmInCall::HandlePhoneForegroundEventL()
   334     {
   299     {
   335     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandlePhoneForegroundEventL( ) ");
   300     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandlePhoneForegroundEventL( ) ");
   336     if ( iOnScreenDialer && IsNumberEntryUsedL() )
       
   337         {
       
   338         // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
       
   339         // to ensure that numberentry/dialler is drawn to UI.
       
   340         TPhoneViewResponseId respond = 
       
   341             iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
       
   342                 
       
   343         if ( respond && IsNumberEntryVisibleL() )
       
   344             {
       
   345             // Set Number Entry CBA
       
   346             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
       
   347             }
       
   348         }
       
   349      }
   301      }
   350 
   302 
   351 // -----------------------------------------------------------
   303 // -----------------------------------------------------------
   352 // CPhoneGsmInCall::HandleHoldNoteL
   304 // CPhoneGsmInCall::HandleHoldNoteL
   353 // -----------------------------------------------------------
   305 // -----------------------------------------------------------
   390         delete tmp;
   342         delete tmp;
   391         tmp = NULL;  
   343         tmp = NULL;  
   392         }
   344         }
   393          
   345          
   394     globalNoteParam.SetText( holdText ); 
   346     globalNoteParam.SetText( holdText ); 
   395     globalNoteParam.SetType( EAknGlobalConfirmationNote );
   347     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   396     globalNoteParam.SetTone( EAvkonSIDInformationTone );
       
   397         
   348         
   398     iViewCommandHandle->ExecuteCommandL( 
   349     iViewCommandHandle->ExecuteCommandL( 
   399             EPhoneViewShowGlobalNote, &globalNoteParam ); 
   350             EPhoneViewShowGlobalNote, &globalNoteParam ); 
   400     }
   351     }
   401 
   352 
       
   353 
       
   354 // ---------------------------------------------------------
       
   355 // CPhoneGsmInCall::SetDivertIndication
       
   356 // ---------------------------------------------------------
       
   357 //
       
   358 EXPORT_C void CPhoneGsmInCall::SetDivertIndication( const TBool aDivertIndication )
       
   359     {
       
   360     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneGsmInCall::SetDivertIndication()");
       
   361            
       
   362     CPhoneState::SetDivertIndication( aDivertIndication );    
       
   363     
       
   364     TRAP_IGNORE( HandeDivertIndicationL() );
       
   365     }
       
   366 
       
   367 // ---------------------------------------------------------
       
   368 // CPhoneGsmInCall::HandeDivertIndicationL
       
   369 // ---------------------------------------------------------
       
   370 //
       
   371 void CPhoneGsmInCall::HandeDivertIndicationL()
       
   372     {
       
   373     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneGsmInCall::HandeDivertIndicationL()");
       
   374        
       
   375     TBuf< KPhoneContactNameMaxLength > remoteInfoText( KNullDesC );
       
   376     TInt ringingCallId ( KErrNotFound );
       
   377         
       
   378     ringingCallId = GetRingingCallL();
       
   379     
       
   380     if( ringingCallId > KErrNotFound )
       
   381        {
       
   382        TPhoneCmdParamCallHeaderData divertData;
       
   383     
       
   384         divertData.SetDiverted( ETrue );
       
   385        
       
   386        GetRemoteInfoDataL( ringingCallId, remoteInfoText );
       
   387        divertData.SetCLIText( 
       
   388                   remoteInfoText,
       
   389                   TPhoneCmdParamCallHeaderData::ERight );
       
   390        
       
   391        divertData.SetCiphering(
       
   392            iStateMachine->PhoneEngineInfo()->IsSecureCall( ringingCallId ) );
       
   393        divertData.SetCipheringIndicatorAllowed(
       
   394            iStateMachine->PhoneEngineInfo()->SecureSpecified() );
       
   395            
       
   396        iViewCommandHandle->ExecuteCommandL( 
       
   397            EPhoneViewUpdateCallHeaderRemoteInfoData, ringingCallId,
       
   398            &divertData );
       
   399         }
       
   400     }
       
   401 
   402 // End of File
   402 // End of File