phoneapp/phoneuistates/src/cphonegsmincall.cpp
branchRCL_3
changeset 25 5266b1f337bd
parent 24 41a7f70b3818
equal deleted inserted replaced
24:41a7f70b3818 25:5266b1f337bd
    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"
    38 
    39 
    39 // ================= MEMBER FUNCTIONS =======================
    40 // ================= MEMBER FUNCTIONS =======================
    40 
    41 
    41 // C++ default constructor can NOT contain any code, that
    42 // C++ default constructor can NOT contain any code, that
    42 // might leave.
    43 // might leave.
   104         "CPhoneGsmInCall::HandlePhoneEngineMessageL() ");
   105         "CPhoneGsmInCall::HandlePhoneEngineMessageL() ");
   105     switch ( aMessage )
   106     switch ( aMessage )
   106         {
   107         {
   107         case MEngineMonitor::EPEMessageRemoteHeld:
   108         case MEngineMonitor::EPEMessageRemoteHeld:
   108             CPhoneState::SendGlobalInfoNoteL( 
   109             CPhoneState::SendGlobalInfoNoteL( 
   109                 EPhoneInformationRemotePutOnHoldNote, ETrue );
   110                 EPhoneInformationRemotePutOnHoldNote );
   110             break;
   111             break;
   111         
   112         
   112         case MEngineMonitor::EPEMessageRemoteResumed:
   113         case MEngineMonitor::EPEMessageRemoteResumed:
   113             CPhoneState::SendGlobalInfoNoteL( 
   114             CPhoneState::SendGlobalInfoNoteL( 
   114                 EPhoneInformationConnectedNote, ETrue );
   115                 EPhoneInformationConnectedNote );
   115             break;
   116             break;
   116             
   117             
   117         case MEngineMonitor::EPEMessageRemoteCreatedConference:
   118         case MEngineMonitor::EPEMessageRemoteCreatedConference:
   118             CPhoneState::SendGlobalInfoNoteL( 
   119             CPhoneState::SendGlobalInfoNoteL( 
   119                 EPhoneInformationRemoteCreateConferenceNote, ETrue );
   120                 EPhoneInformationRemoteCreateConferenceNote );
   120             break;        
   121             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 		
   121         case MEngineMonitor::EPEMessageIncCallIsForw:  // fall through
   133         case MEngineMonitor::EPEMessageIncCallIsForw:  // fall through
   122         case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
   134         case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
   123         case MEngineMonitor::EPEMessageCallBarred: // fall through
   135         case MEngineMonitor::EPEMessageCallBarred: // fall through
   124         case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
   136         case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
   125         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   137         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   126         case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
   138         case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
   127         case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
   139         case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
   128         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
   140         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
   129         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   141         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   130             {
   142 			{
   131             CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
   143 			CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
   132                 CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
   144 				CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
   133                                                        *iViewCommandHandle,
   145 													   *iViewCommandHandle,
   134                                                        *this );
   146 													   *this );
   135             CleanupStack::PushL( gsmMsgHandler );
   147 			CleanupStack::PushL( gsmMsgHandler );
   136             gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
   148 			gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
   137             CleanupStack::PopAndDestroy( gsmMsgHandler );
   149 			CleanupStack::PopAndDestroy( gsmMsgHandler );
   138             
   150 			
   139             // Needed also in non-touch, if call waiting request (*43#) 
   151             // Needed also in non-touch, if call waiting request (*43#) 
   140             // is sent during active call at least.
   152             // is sent during active call at least.
   141             UpdateCbaL( EPhoneCallHandlingInCallCBA );
   153 			if ( aMessage == MEngineMonitor::EPEMessageIncCallIsForw )
       
   154 				{
       
   155 				UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   156 				}
       
   157 			else 
       
   158 				{
       
   159 				UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   160 				}						
   142 			}
   161 			}
   143 			break;
   162 			break;
   144 			
   163 			
   145         case MEngineMonitor::EPEMessageColpNumberAvailable:
   164         case MEngineMonitor::EPEMessageColpNumberAvailable:
   146             {
   165             {
   173                 CPEPhoneModelIF::EPEMessageAnswer );
   192                 CPEPhoneModelIF::EPEMessageAnswer );
   174             break;
   193             break;
   175         
   194         
   176         // 'Replace' from menu            
   195         // 'Replace' from menu            
   177         case EPhoneInCallCmdReplace:
   196         case EPhoneInCallCmdReplace:
   178             ReplaceCallL();
   197         	ReplaceCallL();
   179             break;
   198             break;
   180         
   199         
   181         case EPhoneInCallCmdSwap:
   200         case EPhoneInCallCmdSwap:
   182             iStateMachine->SendPhoneEngineMessage(
   201             iStateMachine->SendPhoneEngineMessage(
   183                 CPEPhoneModelIF::EPEMessageSwap ); 
   202                 CPEPhoneModelIF::EPEMessageSwap ); 
   229 
   248 
   230     MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
   249     MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
   231     
   250     
   232     TPhoneCmdParamGlobalNote globalNoteParam;
   251     TPhoneCmdParamGlobalNote globalNoteParam;
   233     globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
   252     globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
   234     globalNoteParam.SetType( EPhoneNotificationDialog );
   253     globalNoteParam.SetType( EAknGlobalInformationNote );
   235     globalNoteParam.SetTextResourceId( 
   254     globalNoteParam.SetTextResourceId( 
   236             CPhoneMainResourceResolver::Instance()->
   255             CPhoneMainResourceResolver::Instance()->
   237 	        ResolveResourceID( EPhoneColpConnected ) );
   256 	        ResolveResourceID( EPhoneColpConnected ) );
   238     globalNoteParam.SetNotificationDialog( ETrue );
   257     globalNoteParam.SetTone( EAvkonSIDInformationTone );
   239 	        
   258 	        
   240     iViewCommandHandle->ExecuteCommandL( 
   259     iViewCommandHandle->ExecuteCommandL( 
   241             EPhoneViewShowGlobalNote, &globalNoteParam );
   260             EPhoneViewShowGlobalNote, &globalNoteParam );
   242     
   261     
   243     }
   262     }
   247 // -----------------------------------------------------------
   266 // -----------------------------------------------------------
   248 //
   267 //
   249 void CPhoneGsmInCall::BringIncomingToForegroundL()
   268 void CPhoneGsmInCall::BringIncomingToForegroundL()
   250     {
   269     {
   251     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) ");
   270     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) ");
       
   271 
       
   272     // Close menu bar, if it is displayed
       
   273     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   252 
   274 
   253     // Remove any phone dialogs if they are displayed
   275     // Remove any phone dialogs if they are displayed
   254     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   276     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   255 
   277 
   256     // Capture keys when there is an incoming call
   278     // Capture keys when there is an incoming call
   283 void CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL( 
   305 void CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL( 
   284     TPhoneCmdParamBoolean& aCommandParam )
   306     TPhoneCmdParamBoolean& aCommandParam )
   285     {
   307     {
   286     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL() ");
   308     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL() ");
   287 
   309 
   288     if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
   310     iViewCommandHandle->ExecuteCommandL( 
       
   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() )
   289         {
   324         {
   290         SetNumberEntryVisibilityL(EFalse);
   325         SetNumberEntryVisibilityL(EFalse);
   291         }
   326         }
   292     }
   327     }
   293 
   328 
   296 // -----------------------------------------------------------
   331 // -----------------------------------------------------------
   297 //
   332 //
   298 EXPORT_C void CPhoneGsmInCall::HandlePhoneForegroundEventL()
   333 EXPORT_C void CPhoneGsmInCall::HandlePhoneForegroundEventL()
   299     {
   334     {
   300     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandlePhoneForegroundEventL( ) ");
   335     __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         }
   301      }
   349      }
   302 
   350 
   303 // -----------------------------------------------------------
   351 // -----------------------------------------------------------
   304 // CPhoneGsmInCall::HandleHoldNoteL
   352 // CPhoneGsmInCall::HandleHoldNoteL
   305 // -----------------------------------------------------------
   353 // -----------------------------------------------------------
   342         delete tmp;
   390         delete tmp;
   343         tmp = NULL;  
   391         tmp = NULL;  
   344         }
   392         }
   345          
   393          
   346     globalNoteParam.SetText( holdText ); 
   394     globalNoteParam.SetText( holdText ); 
   347     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   395     globalNoteParam.SetType( EAknGlobalConfirmationNote );
       
   396     globalNoteParam.SetTone( EAvkonSIDInformationTone );
   348         
   397         
   349     iViewCommandHandle->ExecuteCommandL( 
   398     iViewCommandHandle->ExecuteCommandL( 
   350             EPhoneViewShowGlobalNote, &globalNoteParam ); 
   399             EPhoneViewShowGlobalNote, &globalNoteParam ); 
   351     }
   400     }
   352 
   401 
   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