phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 45 6b911d05207e
child 50 377c906a8701
child 56 5bcb308bd24d
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
    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 );
   103             SendGlobalInfoNoteL( EPhoneActiveBarrings, ETrue );
   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 );
   111             SendGlobalInfoNoteL( EPhoneMtCallDiverting, ETrue );
   112             break;
   112             break;
   113             
   113             
   114         case MEngineMonitor::EPEMessageOutCallForwToC:
   114         case MEngineMonitor::EPEMessageOutCallForwToC:
   115             SendGlobalInfoNoteL( EPhoneDiverting );
   115             SendGlobalInfoNoteL( EPhoneDiverting, ETrue );
   116             break;
   116             break;
   117 
   117 
   118         case MEngineMonitor::EPEMessageShowVersion:
       
   119             HandleShowVersionL();
       
   120             break;
       
   121             
       
   122         case MEngineMonitor::EPEMessageIssuedSSRequest:
   118         case MEngineMonitor::EPEMessageIssuedSSRequest:
   123             {
   119             {
   124             __PHONELOG(
   120             __PHONELOG(
   125                 EBasic, 
   121                 EBasic, 
   126                 EPhoneUIStates,
   122                 EPhoneUIStates,
   195             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
   191             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
   196             break;
   192             break;
   197             }
   193             }
   198 
   194 
   199         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   195         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
   200             SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject );
   196             SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject, ETrue );
   201             break;
   197             break;
   202             
   198             
   203         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
   199         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
   204             SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted );
   200             SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted, ETrue );
   205             break;
   201             break;
   206             
   202             
   207         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   203         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
   208             SendGlobalInfoNoteL( EPhoneActiveDiverts );
   204             SendGlobalInfoNoteL( EPhoneActiveDiverts, ETrue );
   209             break;
   205             break;
   210 
   206 
   211         default:
   207         default:
   212             break;
   208             break;
   213         }
   209         }
   215 
   211 
   216 // ---------------------------------------------------------
   212 // ---------------------------------------------------------
   217 // CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
   213 // CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
   218 // ---------------------------------------------------------
   214 // ---------------------------------------------------------
   219 //
   215 //
   220 void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( TInt aResourceId )
   216 void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( 
       
   217         TInt aResourceId, TBool aNotificationDialog )
   221     {
   218     {
   222     __LOGMETHODSTARTEND( EPhoneUIStates, 
   219     __LOGMETHODSTARTEND( EPhoneUIStates, 
   223         "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
   220         "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
   224     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   221     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   225     if ( CPhonePubSubProxy::Instance()->Value( 
   222     if ( CPhonePubSubProxy::Instance()->Value( 
   236         globalNoteParam.SetType( EAknGlobalInformationNote );
   233         globalNoteParam.SetType( EAknGlobalInformationNote );
   237         globalNoteParam.SetTextResourceId( 
   234         globalNoteParam.SetTextResourceId( 
   238             CPhoneMainResourceResolver::Instance()->
   235             CPhoneMainResourceResolver::Instance()->
   239             ResolveResourceID( aResourceId ) );
   236             ResolveResourceID( aResourceId ) );
   240         globalNoteParam.SetTone( EAvkonSIDInformationTone );
   237         globalNoteParam.SetTone( EAvkonSIDInformationTone );
       
   238         globalNoteParam.SetNotificationDialog( aNotificationDialog );
   241 
   239 
   242         iViewCommandHandle.ExecuteCommandL( 
   240         iViewCommandHandle.ExecuteCommandL( 
   243             EPhoneViewShowGlobalNote, &globalNoteParam );    
   241             EPhoneViewShowGlobalNote, &globalNoteParam );    
   244         }
   242         }
   245     }
   243     }
   255     
   253     
   256     iActiveState.SetDivertIndication( ETrue );
   254     iActiveState.SetDivertIndication( ETrue );
   257     
   255     
   258     }
   256     }
   259 
   257 
   260 // -----------------------------------------------------------
       
   261 // CPhoneGeneralGsmMessagesHandler::HandleShowVersionL
       
   262 // -----------------------------------------------------------
       
   263 //
       
   264 void CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()
       
   265     {
       
   266     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   267         "CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()" );
       
   268     if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer )  )  
       
   269         {
       
   270         iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );       
       
   271         }
       
   272     else
       
   273         {
       
   274         // Remove number entry from screen
       
   275         iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
       
   276         } 
       
   277 
       
   278 
       
   279 #ifdef __SYNCML_DM
       
   280     // Launch DM UI 
       
   281     RWsSession sess = CCoeEnv::Static()->WsSession();
       
   282     RApaLsSession apaLsSession;        
       
   283   
       
   284     TApaTaskList appList( sess );
       
   285     TApaTask bring = appList.FindApp( KDeviceManagerUid );
       
   286 
       
   287     if ( bring.Exists() )
       
   288         {
       
   289         bring.BringToForeground();
       
   290         }
       
   291     else
       
   292         {
       
   293         if( !apaLsSession.Handle() )
       
   294             {
       
   295             User::LeaveIfError(apaLsSession.Connect());
       
   296             }
       
   297         CleanupClosePushL( apaLsSession );
       
   298         TThreadId thread;
       
   299         User::LeaveIfError( apaLsSession.StartDocument(KNullDesC, KDeviceManagerUid, thread) );
       
   300         CleanupStack::PopAndDestroy( &apaLsSession );  
       
   301         }
       
   302 
       
   303     // Stop dtmf tone. Long key press case key up event go to 
       
   304     // device manager application.
       
   305     iStateMachine.SendPhoneEngineMessage(
       
   306         MPEPhoneModel::EPEMessageEndDTMF );
       
   307     
       
   308 #else    
       
   309     // Fetch version number
       
   310     TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine.
       
   311         PhoneEngineInfo()->PhoneIdentityParameters();
       
   312 
       
   313     // Add it to the resource string
       
   314     HBufC* buf = HBufC::NewLC( KSysUtilVersionTextLength );
       
   315     buf->Des().Format( phoneIdentityParameters.iRevision );
       
   316         
       
   317     TPhoneCmdParamNote noteParam;
       
   318     noteParam.SetType( EPhoneNoteCustom );
       
   319     noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
       
   320         ResolveResourceID( EPhoneInformationWaitNote ) );
       
   321     noteParam.SetText( *buf );
       
   322     
       
   323     // Display note
       
   324     iViewCommandHandle.ExecuteCommandL( EPhoneViewShowNote, &noteParam );
       
   325     
       
   326     CleanupStack::PopAndDestroy( buf );
       
   327 #endif
       
   328     }
       
   329 
       
   330 // ---------------------------------------------------------
   258 // ---------------------------------------------------------
   331 //  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
   259 //  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
   332 // ---------------------------------------------------------
   260 // ---------------------------------------------------------
   333 //
   261 //
   334 void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( TInt aResourceId )
   262 void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( 
       
   263         TInt aResourceId, TBool aNotificationDialog )
   335     {
   264     {
   336     __LOGMETHODSTARTEND( EPhoneUIStates, 
   265     __LOGMETHODSTARTEND( EPhoneUIStates, 
   337         "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
   266         "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
   338     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   267     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   339 
   268 
   350         globalNoteParam.SetType( EAknGlobalErrorNote );
   279         globalNoteParam.SetType( EAknGlobalErrorNote );
   351         globalNoteParam.SetTextResourceId( 
   280         globalNoteParam.SetTextResourceId( 
   352             CPhoneMainResourceResolver::Instance()->
   281             CPhoneMainResourceResolver::Instance()->
   353             ResolveResourceID( aResourceId ) );
   282             ResolveResourceID( aResourceId ) );
   354         globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
   283         globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
   355 
   284         globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   285         
   356         iViewCommandHandle.ExecuteCommandL( 
   286         iViewCommandHandle.ExecuteCommandL( 
   357             EPhoneViewShowGlobalNote, &globalNoteParam );
   287             EPhoneViewShowGlobalNote, &globalNoteParam );
   358         }
   288         }
   359     }
   289     }
   360 
   290