phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
child 81 c26cc2a7c548
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
    98         "CPhoneGeneralGsmMessagesHandler::HandlePhoneEngineMessageL()" );
    98         "CPhoneGeneralGsmMessagesHandler::HandlePhoneEngineMessageL()" );
    99 
    99 
   100     switch ( aMessage )
   100     switch ( aMessage )
   101         {
   101         {
   102         case MEngineMonitor::EPEMessageCallBarred:
   102         case MEngineMonitor::EPEMessageCallBarred:
   103             SendGlobalInfoNoteL( EPhoneActiveBarrings, ETrue );
   103             SendGlobalInfoNoteL( EPhoneActiveBarrings );
   104             break;
   104             break;
   105         
   105         
   106         case MEngineMonitor::EPEMessageIncCallIsForw:
   106         case MEngineMonitor::EPEMessageIncCallIsForw:
   107             HandleIncomingCallForwardedL();
   107             HandleIncomingCallForwardedL();
   108             break;
   108             break;
   109             
   109             
   110         case MEngineMonitor::EPEMessageIncCallForwToC:
   110         case MEngineMonitor::EPEMessageIncCallForwToC:
   111             SendGlobalInfoNoteL( EPhoneMtCallDiverting, ETrue );
   111             SendGlobalInfoNoteL( EPhoneMtCallDiverting );
   112             break;
   112             break;
   113             
   113             
   114         case MEngineMonitor::EPEMessageOutCallForwToC:
   114         case MEngineMonitor::EPEMessageOutCallForwToC:
   115             SendGlobalInfoNoteL( EPhoneDiverting, ETrue );
   115             SendGlobalInfoNoteL( EPhoneDiverting );
   116             break;
   116             break;
   117 
   117 
       
   118         case MEngineMonitor::EPEMessageShowVersion:
       
   119             HandleShowVersionL();
       
   120             break;
       
   121             
   118         case MEngineMonitor::EPEMessageIssuedSSRequest:
   122         case MEngineMonitor::EPEMessageIssuedSSRequest:
   119             {
   123             {
   120             __PHONELOG(
   124             __PHONELOG(
   121                 EBasic, 
   125                 EBasic, 
   122                 EPhoneUIStates,
   126                 EPhoneUIStates,
   123                 "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuedSSRequest" );
   127                 "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuedSSRequest" );
       
   128 
       
   129             TPhoneCmdParamBoolean booleanParam;
       
   130             booleanParam.SetBoolean( EFalse );
       
   131             iViewCommandHandle.ExecuteCommandL( 
       
   132                 EPhoneViewSetBlockingDialogStatus, 
       
   133                 &booleanParam );
   124             break;
   134             break;
   125             }
   135             }
   126             
   136             
   127         case MEngineMonitor::EPEMessageIssuingSSRequest:
   137         case MEngineMonitor::EPEMessageIssuingSSRequest:
   128             {
   138             {
   153             globalNotifierParam.SetBoolean( EFalse );
   163             globalNotifierParam.SetBoolean( EFalse );
   154             iViewCommandHandle.ExecuteCommandL( 
   164             iViewCommandHandle.ExecuteCommandL( 
   155                 EPhoneViewSetGlobalNotifiersDisabled,
   165                 EPhoneViewSetGlobalNotifiersDisabled,
   156                 &globalNotifierParam );
   166                 &globalNotifierParam );
   157             
   167             
       
   168             TPhoneCmdParamBoolean booleanParam;
       
   169             booleanParam.SetBoolean( ETrue );
       
   170             iViewCommandHandle.ExecuteCommandL( 
       
   171                 EPhoneViewSetBlockingDialogStatus, 
       
   172                 &booleanParam );
       
   173             
   158             // Get active call count
   174             // Get active call count
   159             TPhoneCmdParamInteger activeCallCount;
   175             TPhoneCmdParamInteger activeCallCount;
   160             iViewCommandHandle.ExecuteCommandL(
   176             iViewCommandHandle.ExecuteCommandL(
   161                 EPhoneViewGetCountOfActiveCalls, &activeCallCount );
   177                 EPhoneViewGetCountOfActiveCalls, &activeCallCount );
   162             
   178             
       
   179             if( !activeCallCount.Integer() )
       
   180                 {
       
   181                 __PHONELOG(
       
   182                     EBasic, 
       
   183                     EPhoneUIStates,
       
   184                     "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuingSSRequest no active call" );
       
   185                 // Ensure that the dialer is activated to display local notes and dialogs properly.
       
   186                 TPhoneCmdParamAppInfo param;
       
   187                 param.SetAppUid( KUidPhoneApplication );
       
   188                 param.SetViewUid( KUidViewId );
       
   189                 param.SetCustomMessageId( TUid::Uid( KTouchDiallerViewCommand ) );
       
   190                 iViewCommandHandle.ExecuteCommandL( 
       
   191                     EPhoneViewActivateAppViewWithCustomMessage, 
       
   192                     &param );
       
   193                 }
   163             // Remove phoneumber query
   194             // Remove phoneumber query
   164             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
   195             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
   165             break;
   196             break;
   166             }
   197             }
   167 
   198 
   168         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   199         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   169             SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject, ETrue );
   200             SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject );
   170             break;
   201             break;
   171             
   202             
   172         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
   203         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
   173             SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted, ETrue );
   204             SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted );
   174             break;
   205             break;
   175             
   206             
   176         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   207         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   177             SendGlobalInfoNoteL( EPhoneActiveDiverts, ETrue );
   208             SendGlobalInfoNoteL( EPhoneActiveDiverts );
   178             break;
   209             break;
   179 
   210 
   180         default:
   211         default:
   181             break;
   212             break;
   182         }
   213         }
   184 
   215 
   185 // ---------------------------------------------------------
   216 // ---------------------------------------------------------
   186 // CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
   217 // CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
   187 // ---------------------------------------------------------
   218 // ---------------------------------------------------------
   188 //
   219 //
   189 void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( 
   220 void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( TInt aResourceId )
   190         TInt aResourceId, TBool aNotificationDialog )
       
   191     {
   221     {
   192     __LOGMETHODSTARTEND( EPhoneUIStates, 
   222     __LOGMETHODSTARTEND( EPhoneUIStates, 
   193         "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
   223         "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
   194     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   224     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   195     if ( CPhonePubSubProxy::Instance()->Value( 
   225     if ( CPhonePubSubProxy::Instance()->Value( 
   200         globalNotifierParam.SetBoolean( EFalse );
   230         globalNotifierParam.SetBoolean( EFalse );
   201         iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   231         iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   202             &globalNotifierParam );
   232             &globalNotifierParam );
   203             
   233             
   204         TPhoneCmdParamGlobalNote globalNoteParam;
   234         TPhoneCmdParamGlobalNote globalNoteParam;
   205         PhoneNotificationType type = aNotificationDialog ? 
       
   206                 EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   207         globalNoteParam.SetType( type );
       
   208       
   235       
       
   236         globalNoteParam.SetType( EAknGlobalInformationNote );
   209         globalNoteParam.SetTextResourceId( 
   237         globalNoteParam.SetTextResourceId( 
   210             CPhoneMainResourceResolver::Instance()->
   238             CPhoneMainResourceResolver::Instance()->
   211             ResolveResourceID( aResourceId ) );
   239             ResolveResourceID( aResourceId ) );
   212         globalNoteParam.SetNotificationDialog( aNotificationDialog );
   240         globalNoteParam.SetTone( EAvkonSIDInformationTone );
   213 
   241 
   214         iViewCommandHandle.ExecuteCommandL( 
   242         iViewCommandHandle.ExecuteCommandL( 
   215             EPhoneViewShowGlobalNote, &globalNoteParam );    
   243             EPhoneViewShowGlobalNote, &globalNoteParam );    
   216         }
   244         }
   217     }
   245     }
   222 //
   250 //
   223 void CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()
   251 void CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()
   224     {
   252     {
   225     __LOGMETHODSTARTEND( EPhoneUIStates, 
   253     __LOGMETHODSTARTEND( EPhoneUIStates, 
   226         "CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()" );
   254         "CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()" );
       
   255     }
       
   256 
       
   257 // -----------------------------------------------------------
       
   258 // CPhoneGeneralGsmMessagesHandler::HandleShowVersionL
       
   259 // -----------------------------------------------------------
       
   260 //
       
   261 void CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()
       
   262     {
       
   263     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   264         "CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()" );
       
   265     if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer )  )  
       
   266         {
       
   267         iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );       
       
   268         }
       
   269     else
       
   270         {
       
   271         // Remove number entry from screen
       
   272         iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
       
   273         } 
       
   274 
       
   275 
       
   276 #ifdef __SYNCML_DM
       
   277     // Launch DM UI 
       
   278     RWsSession sess = CCoeEnv::Static()->WsSession();
       
   279     RApaLsSession apaLsSession;        
       
   280   
       
   281     TApaTaskList appList( sess );
       
   282     TApaTask bring = appList.FindApp( KDeviceManagerUid );
       
   283 
       
   284     if ( bring.Exists() )
       
   285         {
       
   286         bring.BringToForeground();
       
   287         }
       
   288     else
       
   289         {
       
   290         if( !apaLsSession.Handle() )
       
   291             {
       
   292             User::LeaveIfError(apaLsSession.Connect());
       
   293             }
       
   294         CleanupClosePushL( apaLsSession );
       
   295         TThreadId thread;
       
   296         User::LeaveIfError( apaLsSession.StartDocument(KNullDesC, KDeviceManagerUid, thread) );
       
   297         CleanupStack::PopAndDestroy( &apaLsSession );  
       
   298         }
       
   299 
       
   300     // Stop dtmf tone. Long key press case key up event go to 
       
   301     // device manager application.
       
   302     iStateMachine.SendPhoneEngineMessage(
       
   303         MPEPhoneModel::EPEMessageEndDTMF );
   227     
   304     
   228     iActiveState.SetDivertIndication( ETrue );
   305 #else    
       
   306     // Fetch version number
       
   307     TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine.
       
   308         PhoneEngineInfo()->PhoneIdentityParameters();
       
   309 
       
   310     // Add it to the resource string
       
   311     HBufC* buf = HBufC::NewLC( KSysUtilVersionTextLength );
       
   312     buf->Des().Format( phoneIdentityParameters.iRevision );
       
   313         
       
   314     TPhoneCmdParamNote noteParam;
       
   315     noteParam.SetType( EPhoneNoteCustom );
       
   316     noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
       
   317         ResolveResourceID( EPhoneInformationWaitNote ) );
       
   318     noteParam.SetText( *buf );
   229     
   319     
       
   320     // Display note
       
   321     iViewCommandHandle.ExecuteCommandL( EPhoneViewShowNote, &noteParam );
       
   322     
       
   323     CleanupStack::PopAndDestroy( buf );
       
   324 #endif
   230     }
   325     }
   231 
   326 
   232 // ---------------------------------------------------------
   327 // ---------------------------------------------------------
   233 //  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
   328 //  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
   234 // ---------------------------------------------------------
   329 // ---------------------------------------------------------
   235 //
   330 //
   236 void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( 
   331 void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( TInt aResourceId )
   237         TInt aResourceId, TBool aNotificationDialog )
       
   238     {
   332     {
   239     __LOGMETHODSTARTEND( EPhoneUIStates, 
   333     __LOGMETHODSTARTEND( EPhoneUIStates, 
   240         "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
   334         "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
   241     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   335     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   242 
   336 
   248         globalNotifierParam.SetBoolean( EFalse );
   342         globalNotifierParam.SetBoolean( EFalse );
   249         iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   343         iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   250             &globalNotifierParam );
   344             &globalNotifierParam );
   251             
   345             
   252         TPhoneCmdParamGlobalNote globalNoteParam;
   346         TPhoneCmdParamGlobalNote globalNoteParam;
   253         PhoneNotificationType type = aNotificationDialog ? 
   347         globalNoteParam.SetType( EAknGlobalErrorNote );
   254                 EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   255         globalNoteParam.SetType( type );
       
   256         globalNoteParam.SetTextResourceId( 
   348         globalNoteParam.SetTextResourceId( 
   257             CPhoneMainResourceResolver::Instance()->
   349             CPhoneMainResourceResolver::Instance()->
   258             ResolveResourceID( aResourceId ) );
   350             ResolveResourceID( aResourceId ) );
   259         globalNoteParam.SetNotificationDialog( aNotificationDialog );
   351         globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
   260         
   352 
   261         iViewCommandHandle.ExecuteCommandL( 
   353         iViewCommandHandle.ExecuteCommandL( 
   262             EPhoneViewShowGlobalNote, &globalNoteParam );
   354             EPhoneViewShowGlobalNote, &globalNoteParam );
   263         }
   355         }
   264     }
   356     }
   265 
   357