terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp
branchRCL_3
changeset 15 007508d6e57b
parent 13 86979fe66c4c
child 16 915074efc433
equal deleted inserted replaced
14:504e41245867 15:007508d6e57b
    60 //
    60 //
    61 CSCPQueryDialog::CSCPQueryDialog(   TDes& aDataText,
    61 CSCPQueryDialog::CSCPQueryDialog(   TDes& aDataText,
    62                                     RSCPClient::TSCPButtonConfig aButtonsShown, 
    62                                     RSCPClient::TSCPButtonConfig aButtonsShown, 
    63                                     TInt aMinLength,
    63                                     TInt aMinLength,
    64                                     TInt aMaxLength,
    64                                     TInt aMaxLength,
    65                                     TBool aECSSupport
    65                                     TBool aECSSupport,
       
    66                                     TKeypadContext aContextSensitive /*= EContextSensitive*/
    66                                     )
    67                                     )
    67             : CAknTextQueryDialog(aDataText, ENoTone),
    68             : CAknTextQueryDialog(aDataText, ENoTone),
    68 			  iMinLength(aMinLength),
    69 			  iMinLength(aMinLength),
    69 			  iMaxLength(aMaxLength),
    70 			  iMaxLength(aMaxLength),
    70 			  iValidTextLen( 0 ),
    71 			  iValidTextLen( 0 ),
    74 			  iEMCallActivated( EFalse ),
    75 			  iEMCallActivated( EFalse ),
    75 			  iShowingEMNumber( EFalse ),
    76 			  iShowingEMNumber( EFalse ),
    76 			  iPreviousCharacterWasInvalid( EFalse ),
    77 			  iPreviousCharacterWasInvalid( EFalse ),
    77 			  iPrioritySet( EFalse ),
    78 			  iPrioritySet( EFalse ),
    78 			  iPriorityDropped( EFalse ),
    79 			  iPriorityDropped( EFalse ),
    79 			  iKeyUsed ( NULL )
    80 			  iKeyUsed ( NULL ),
    80 	{		 
    81 			  iContextSensitive(aContextSensitive)
       
    82 	{
    81         def_mode = 0;
    83         def_mode = 0;
    82         iAppKey = 0;
    84         iAppKey = 0;
    83         iMode = KSCPModeNormal;
    85         iMode = KSCPModeNormal;
    84 	}
    86 	}
    85 	
    87 	
    91 //
    93 //
    92 CSCPQueryDialog::~CSCPQueryDialog()
    94 CSCPQueryDialog::~CSCPQueryDialog()
    93 	{
    95 	{
    94 	Dprint( (_L("CSCPQueryDialog::~CSCPQueryDialog()")) );
    96 	Dprint( (_L("CSCPQueryDialog::~CSCPQueryDialog()")) );
    95 	
    97 	
    96 	    if ( AknLayoutUtils::PenEnabled() )
    98    if (iDeviceLockStatusObserver)
    97         {
    99         delete iDeviceLockStatusObserver;
    98         TRAP_IGNORE ( SetIncallBubbleAllowedInUsualL( ETrue ) );
   100     
    99         }
   101     if (iCallStatusObserver)
   100 
   102         delete iCallStatusObserver;
   101 	
   103 	    
   102 	if (iFront)
   104 	if (iFront)
   103 		{
   105 		{
   104 		// Uncapture keys, if they were captured
   106 		// Uncapture keys, if they were captured
   105 		if ( iMode == KSCPModeRestricted )		
   107 		if ( iMode == KSCPModeRestricted )		
   106 			{
   108 			{
   107 			RWindowGroup& groupWin=iCoeEnv->RootWin();
   109 			RWindowGroup& groupWin=iCoeEnv->RootWin();
   108 			groupWin.CancelCaptureKeyUpAndDowns(iAppKey);
   110 			groupWin.CancelCaptureKeyUpAndDowns(iAppKey);
   109 			groupWin.CancelCaptureKeyUpAndDowns(iVoiceKey2);
   111 			groupWin.CancelCaptureKeyUpAndDowns(iVoiceKey2);
   110 			groupWin.CancelCaptureKey(iVoiceKey1);						
   112 			groupWin.CancelCaptureKey(iVoiceKey1);
   111 			}
   113 			}
   112 
   114 
   113 		if ( iPrioritySet )
   115 		if ( iPrioritySet )
   114 		    {
   116 		    {
   115     		// Return normal high-priority in case there are other notifiers active 
   117     		// Return normal high-priority in case there are other notifiers active 
   116 	    	// and were are not going to lose foregroung right after following call	
   118 	    	// and were are not going to lose foregroung right after following call	
   117 		    iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
   119 		    iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
   118 		    }
   120 		    }
   119 		 						
   121 		 						
   120 		iEikonEnv->BringForwards(EFalse);	
   122 		iEikonEnv->BringForwards(EFalse);	
   121 		iEikonEnv->EikAppUi()->RemoveFromStack(this);
   123 		iEikonEnv->EikAppUi()->RemoveFromStack(this);
   122 		
   124 		
   130 		    delete iEcsDetector;
   132 		    delete iEcsDetector;
   131             }
   133             }
   132 		
   134 		
   133 		iFront = EFalse;
   135 		iFront = EFalse;
   134 		}
   136 		}
   135 	
   137 }
   136 	if (iDeviceLockStatusObserver)
   138 
   137 		delete iDeviceLockStatusObserver;
   139 void CSCPQueryDialog :: PostLayoutDynInitL() {
   138 		if (iCallStatusObserver)
   140     Dprint( (_L("[CSCPQueryDialog]-> PostLayoutDynInitL() >>>") ));    
   139 		delete iCallStatusObserver;
   141     iDeviceLockStatusObserver = CSCPLockObserver::NewL(this);
   140 	}
   142     iCallStatusObserver = CSCPLockObserver::NewL(this, ESecUiCallStateObserver);
       
   143     Dprint( (_L("[CSCPQueryDialog]-> PostLayoutDynInitL() <<<") ));
       
   144 }
       
   145 
   141 //
   146 //
   142 // ----------------------------------------------------------
   147 // ----------------------------------------------------------
   143 // CSCPQueryDialog::PreLayoutDynInitL()
   148 // CSCPQueryDialog::PreLayoutDynInitL()
   144 // Called by framework before dialog is shown 
   149 // Called by framework before dialog is shown 
   145 // ----------------------------------------------------------
   150 // ----------------------------------------------------------
   146 //
   151 //
   147 void CSCPQueryDialog::PreLayoutDynInitL()
   152 void CSCPQueryDialog :: PreLayoutDynInitL()
   148     {
   153     {
   149     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL()") ));
   154     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL()") ));
   150     
   155     
   151     /* CEikSecretEditor* queryControl = 
       
   152                     static_cast<CEikSecretEditor*>(
       
   153                         QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) 
       
   154                        ); 
       
   155     queryControl->EnableSCT(EFalse); */
       
   156     
       
   157     CAknTextQueryDialog::PreLayoutDynInitL();
   156     CAknTextQueryDialog::PreLayoutDynInitL();
   158     
   157     
   159     //disable in call bubble.
   158     //disable in call bubble.
   160     if ( AknLayoutUtils::PenEnabled() )
   159     if ( AknLayoutUtils::PenEnabled() )
   161         {
   160         {
   162         SetIncallBubbleAllowedInUsualL( EFalse );
   161         SetIncallBubbleAllowedInUsualL( EFalse );
   163         }
   162         }
   164 
       
   165     
   163     
   166     // Create the ECS detector object if required
   164     // Create the ECS detector object if required
   167     if ( iECSSupport )
   165     if ( iECSSupport )
   168         {
   166         {
   169         Dprint( (_L(" Creating ECS detector") ));
   167         Dprint( (_L(" Creating ECS detector") ));
   171         iEcsDetector->SetObserver( this );
   169         iEcsDetector->SetObserver( this );
   172         }    
   170         }    
   173     
   171     
   174     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Set input mode") ));
   172     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Set input mode") ));
   175         
   173         
   176     /* The default input mode of the lock code query must be set on the basis of the
   174     switch(iContextSensitive) {
   177     very first character of the current lock code. If the first character of the current
   175         case EContextSensitive: {
   178     lock code is numeric, the default input mode will also be numeric. Otherwise, the 
   176             Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = EContextSensitive"));
   179     default input mode will be alphabetic */
   177             /* The default input mode of the lock code query must be set on the basis of the
   180     
   178             very first character of the current lock code. If the first character of the current
   181     CRepository* repository;
   179             lock code is numeric, the default input mode will also be numeric. Otherwise, the 
   182     repository = CRepository::NewL( KCRUidSCPParameters );
   180             default input mode will be alphabetic */
   183     CleanupStack::PushL( repository );
   181             
   184     
   182             CRepository* repository = CRepository :: NewL(KCRUidSCPParameters);
   185     User::LeaveIfError(repository->Get( KSCPLockCodeDefaultInputMode , def_mode) );
   183             CleanupStack :: PushL(repository);
   186     
   184             User :: LeaveIfError(repository->Get(KSCPLockCodeDefaultInputMode, def_mode));            
   187     CleanupStack::PopAndDestroy( repository );
   185             CleanupStack :: PopAndDestroy(repository);
   188     repository = NULL;   
   186 
   189     
   187             if (def_mode == 0) {
   190     if (def_mode == 0)
   188                 Dprint(_L("[CSCPQueryDialog]-> Context determined as Numeric"));
   191     	SetDefaultInputMode( EAknEditorNumericInputMode ); 
   189                 SetDefaultInputMode(EAknEditorNumericInputMode);
   192     else
   190             }
   193     	SetDefaultInputMode( EAknEditorSecretAlphaInputMode );
   191             else {
       
   192                 Dprint(_L("[CSCPQueryDialog]-> Context determined as Alphanumeric"));
       
   193                 SetDefaultInputMode(EAknEditorSecretAlphaInputMode);
       
   194             }
       
   195         }
       
   196         break;
       
   197         case ENumeric:
       
   198             Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = ENumeric"));
       
   199             SetDefaultInputMode( EAknEditorNumericInputMode );
       
   200             break;
       
   201         case EAlphaNumeric:
       
   202             Dprint(_L("[CSCPQueryDialog]-> iContextSensitive = EAlphaNumeric"));
       
   203             SetDefaultInputMode( EAknEditorSecretAlphaInputMode );
       
   204             break;
       
   205     };
   194     
   206     
   195     // Set the mode, we use this to determine the functionality for special keys
   207     // Set the mode, we use this to determine the functionality for special keys
   196     if ( ( iButtons == RSCPClient::SCP_OK ) || ( iButtons == RSCPClient::SCP_OK_CANCEL ) )
   208     if ( ( iButtons == RSCPClient::SCP_OK ) || ( iButtons == RSCPClient::SCP_OK_CANCEL ) )
   197         {
   209         {
   198         // Normal mode
   210         // Normal mode
   257     TInt myWgId = iEikonEnv->RootWin().Identifier();
   269     TInt myWgId = iEikonEnv->RootWin().Identifier();
   258     
   270     
   259     TInt wgPrio = wsSession.GetWindowGroupOrdinalPriority(myWgId);
   271     TInt wgPrio = wsSession.GetWindowGroupOrdinalPriority(myWgId);
   260 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): wgPrio %d"),wgPrio ));
   272 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): wgPrio %d"),wgPrio ));
   261 	TInt var;
   273 	TInt var;
   262 	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState,var);
   274 	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, var);
   263 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"),var ));
   275 	Dprint((_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"), var));
   264     // we are already on forgeround, need to update priority differently
       
   265 	if (var != EPSCTsyCallStateNone)
       
   266 	{
       
   267 		// If the call is made during device startup have the priority as normal
       
   268 		if (iECSSupport && (iButtons == RSCPClient::SCP_OK))
       
   269 		{
       
   270 		iEikonEnv->RootWin().SetOrdinalPosition(1,ECoeWinPriorityNormal);
       
   271 		}
       
   272 	
   276 	
   273 	}
   277     // If the call is made during device startup have the priority as normal
   274     else if ((wgPrio == ECoeWinPriorityAlwaysAtFront)&&(iECSSupport))
   278     if (iECSSupport)
   275         {
   279     {
   276         Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): ECoeWinPriorityAlwaysAtFront+1") ));	
   280         switch(var) {
   277         iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1);
   281             default:
   278         iPrioritySet = ETrue;
   282             case EPSCTsyCallStateNone:
   279         }
   283                 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Maximized...")));
   280         
   284                 iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
       
   285                 iPrioritySet = ETrue;
       
   286                 break;
       
   287             case EPSCTsyCallStateAlerting:
       
   288             case EPSCTsyCallStateHold:
       
   289             case EPSCTsyCallStateRinging:
       
   290             case EPSCTsyCallStateDialling:
       
   291             case EPSCTsyCallStateAnswering:
       
   292             case EPSCTsyCallStateConnected: {
       
   293                 switch(iButtons) {
       
   294                     case RSCPClient::SCP_OK:
       
   295                     case RSCPClient::SCP_OK_ETEL: {
       
   296                         Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Minimized...")));
       
   297                         iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
       
   298                         break;
       
   299                     }
       
   300                     default:
       
   301                         break;
       
   302                 }
       
   303             }
       
   304         }
       
   305     }
       
   306 	        
   281    // this must be done always to keep the reference count in synch  
   307    // this must be done always to keep the reference count in synch  
   282    // this does not have any effect if autoforwarding has not been set true (normal application.)
   308    // this does not have any effect if autoforwarding has not been set true (normal application.)
   283    iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1);
   309    iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1);
   284 
   310 
   285 	/// -- Change Window Priority for dialog and CBA 
   311 	/// -- Change Window Priority for dialog and CBA 
   286 	if (iECSSupport)
   312 	if (iECSSupport)
   287 		{
   313 		{
   288 		Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));			
   314 		Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));			
   289 		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
   315 		DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
   290 		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); 	
   316 		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); 	
   291 		}
   317 		}
   292 	else
   318 	else
   293 		{
   319 		{
   294 		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1); //
   320 		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1); //
   303 	    	                                                             
   329 	    	                                                             
   304 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground();
   330 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground();
   305 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
   331 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
   306 
   332 
   307 	iFront = ETrue;
   333 	iFront = ETrue;
   308 	
   334 }
   309 	Dprint( (_L("CSCPQueryDialog::CSCPLockObserver") ));
       
   310 	iDeviceLockStatusObserver = CSCPLockObserver::NewL(this);
       
   311 	iCallStatusObserver = CSCPLockObserver::NewL(this,ESecUiCallStateObserver);
       
   312 
       
   313 	}
       
   314 //
   335 //
   315 // ---------------------------------------------------------
   336 // ---------------------------------------------------------
   316 // CSCPQueryDialog::OfferKeyEventL
   337 // CSCPQueryDialog::OfferKeyEventL
   317 // called by framework when any key is pressed
   338 // called by framework when any key is pressed
   318 // ---------------------------------------------------------
   339 // ---------------------------------------------------------
   420             if (iECSSupport)
   441             if (iECSSupport)
   421                 {
   442                 {
   422                 if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch ||
   443                 if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch ||
   423                      iEcsDetector->State() == CAknEcsDetector::EServiceNumMatch )
   444                      iEcsDetector->State() == CAknEcsDetector::EServiceNumMatch )
   424                     {
   445                     {
   425                     iEcsDetector->AddChar( (TText)(EKeyPhoneSend) );
   446                     Dprint( (_L("CSCPQueryDialog::OfferKeyEventL(): adding EKeyPhoneSend to detector")));
   426                     
   447                     
       
   448                     switch(iButtons) {
       
   449                         case RSCPClient::SCP_OK:
       
   450                         case RSCPClient::SCP_OK_ETEL:
       
   451                             //Required only during device startup
       
   452                             iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
       
   453                             break;
       
   454                         default:
       
   455                             break;
       
   456                     }
       
   457                     
       
   458                     iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );
   427                     }   
   459                     }   
   428                 else
   460                 else
   429                     {
   461                     {
   430                     Dprint( (_L("CSCPQueryDialog::OfferKeyEventL(): ShowWarningNoteL") ));
   462                     Dprint( (_L("CSCPQueryDialog::OfferKeyEventL(): ShowWarningNoteL") ));
   431                     ShowWarningNoteL();
   463                     ShowWarningNoteL();
   522             }
   554             }
   523         if ( aType == EEventKey ) 
   555         if ( aType == EEventKey ) 
   524             {
   556             {
   525             iEcsDetector->SetBuffer(iTextBuffer.Left(KAknEcsMaxMatchingLength));
   557             iEcsDetector->SetBuffer(iTextBuffer.Left(KAknEcsMaxMatchingLength));
   526             }
   558             }
   527         if ( aType == EEventKey )
   559         /*if ( aType == EEventKey )
   528             {
   560             {
   529         if ( iEMCallActivated )
   561         if ( iEMCallActivated )
   530             {
   562             {
   531             TryExitL( ESecUiEmergencyCall );
   563             TryExitL( ESecUiEmergencyCall );
   532             return EKeyWasConsumed;
   564             return EKeyWasConsumed;
   533             }
   565             }
   534         }
   566         }*/
   535         // Retrieve the editor control ptr, we know it is a secret editor..
   567         // Retrieve the editor control ptr, we know it is a secret editor..
   536         CEikSecretEditor* queryControl = static_cast<CEikSecretEditor*>( 
   568         CEikSecretEditor* queryControl = static_cast<CEikSecretEditor*>( 
   537             QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) );                
   569             QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) );                
   538         
   570         
   539          // Further check to ensure that the matched number is the entire buffer
   571          // Further check to ensure that the matched number is the entire buffer
   675     	Dprint( (_L("CSCPQueryDialog::OkToExitL EAknSoftkeyCancel ")) );	
   707     	Dprint( (_L("CSCPQueryDialog::OkToExitL EAknSoftkeyCancel ")) );	
   676 	    ret = CAknTextQueryDialog::OkToExitL(aButtonId);
   708 	    ret = CAknTextQueryDialog::OkToExitL(aButtonId);
   677 		}
   709 		}
   678 		
   710 		
   679     // Emergency call, exit
   711     // Emergency call, exit
   680     if ( aButtonId == ESecUiEmergencyCall )
   712     if (aButtonId == ESecUiEmergencyCall || aButtonId == EAknSoftkeyEmergencyCall)
   681         {
   713     {
   682 		Dprint( (_L("CSCPQueryDialog::OkToExitL(): ESecUiEmergencyCall") ));
       
   683         ret = ETrue;
       
   684         }
       
   685     if (aButtonId == EAknSoftkeyEmergencyCall)
       
   686         {
       
   687         //add EKeyPhonesend to ecs detector. 
   714         //add EKeyPhonesend to ecs detector. 
   688         ret = ETrue;
   715 //        ret = ETrue;
       
   716 //        CAknTextQueryDialog::OkToExitL(aButtonId);
   689         Dprint( (_L("CSCPQueryDialog::OkToExitL(): adding EKeyPhoneSend to detector") ));
   717         Dprint( (_L("CSCPQueryDialog::OkToExitL(): adding EKeyPhoneSend to detector") ));
   690          iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );
   718         
   691         CAknTextQueryDialog::OkToExitL(aButtonId);
   719         switch(iButtons) {
   692         }
   720             case RSCPClient::SCP_OK:
       
   721             case RSCPClient::SCP_OK_ETEL:
       
   722                 //Required only during device startup
       
   723                 iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityLow);
       
   724                 break;
       
   725             default:
       
   726                 break;
       
   727         }
       
   728         
       
   729         iEMCallActivated = ETrue;
       
   730         iEcsDetector->AddChar( (TText)(EKeyPhoneSend ) );
       
   731     }
   693    
   732    
   694 	Dprint( (_L("CSCPQueryDialog::OkToExitL() done") ));   
   733 	Dprint( (_L("CSCPQueryDialog::OkToExitL() done") ));   
   695 	return ret;
   734 	return ret;
   696 	}
   735 	}
   697 
   736 
   715         serviceCallEnabled = FeatureManager::FeatureSupported( 
   754         serviceCallEnabled = FeatureManager::FeatureSupported( 
   716             KFeatureIdFfServiceCallWhilePhoneLocked );
   755             KFeatureIdFfServiceCallWhilePhoneLocked );
   717         FeatureManager::UnInitializeLib();
   756         FeatureManager::UnInitializeLib();
   718         }
   757         }
   719 
   758 
   720     if ( ( aUpdatedState == CAknEcsDetector::ECompleteMatchThenSendKey ) || 
   759     /*if ( ( aUpdatedState == CAknEcsDetector::ECompleteMatchThenSendKey ) || 
   721          ( aUpdatedState == CAknEcsDetector::ECallAttempted ) )
   760          ( aUpdatedState == CAknEcsDetector::ECallAttempted ) )
   722         {
   761         {
   723         // Call attempted, cancel the query
   762         // Call attempted, cancel the query
   724         iEMCallActivated = ETrue; // OfferKeyEventL will close the dialog         
   763         iEMCallActivated = ETrue; // OfferKeyEventL will close the dialog         
   725         }
   764         }
   726     else if ( aUpdatedState == CAknEcsDetector::ECompleteMatch ||
   765     else*/ if ( aUpdatedState == CAknEcsDetector::ECompleteMatch ||
   727               ( serviceCallEnabled && aUpdatedState == CAknEcsDetector::EServiceNumMatch ) )
   766               ( serviceCallEnabled && aUpdatedState == CAknEcsDetector::EServiceNumMatch ) )
   728         {
   767         {
   729         iShowingEMNumber = ETrue;
   768         iShowingEMNumber = ETrue;
   730         }
   769         }
   731     else if ( iShowingEMNumber )
   770     else if ( iShowingEMNumber )
   798     CleanupStack::PopAndDestroy();
   837     CleanupStack::PopAndDestroy();
   799     }
   838     }
   800 	
   839 	
   801 // Call from the SCPObserver
   840 // Call from the SCPObserver
   802 	
   841 	
   803 void CSCPQueryDialog::TryCancelQueryL(TInt aReason)
   842 void CSCPQueryDialog::TryCancelQueryL(TInt aReason) {
   804     {
       
   805     Dprint( (_L("CSCPQueryDialog::TryCancelQueryL()")) );
   843     Dprint( (_L("CSCPQueryDialog::TryCancelQueryL()")) );
   806     
   844     
   807 	if (EPSCTsyCallStateDisconnecting == aReason)
   845     switch(aReason) {
   808 	{
   846         case CSCPLockObserver :: EEnded:
   809 	Dprint( (_L("CSCPQueryDialog::TryCancelQueryL() -SetOrdinalPosition ->0")) );
   847             Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): Call ended, raising priority...")));
   810 	iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1);
   848             
   811 	iPrioritySet = ETrue;
   849             switch(iButtons) {
   812 	}
   850                 case RSCPClient::SCP_OK:
   813 	else
   851                 case RSCPClient::SCP_OK_ETEL:
   814 	{
   852                     if(iEMCallActivated) {
   815 	Dprint( (_L("CSCPQueryDialog::TryExitL(EAknSoftkeyCancel)")) );
   853                         TryExitL(EAknSoftkeyCancel);
   816     TryExitL(EAknSoftkeyCancel);
   854                     }
   817 	}
   855                     else {
       
   856                         iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
       
   857                         iPrioritySet = ETrue;
       
   858                     }
       
   859                     break;
       
   860                 default:
       
   861                     break;
       
   862             }
       
   863             break;
       
   864         case CSCPLockObserver :: EInProgress:
       
   865             Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): received call in progress event...")));
       
   866             
       
   867 //            if(iEMCallActivated) {
       
   868                 Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): EM active, exiting...")));
       
   869                 TryExitL(EAknSoftkeyCancel);
       
   870 //            }
       
   871             break;
       
   872         case ESecUiDeviceLocked:
       
   873             Dprint(_L("[CSCPQueryDialog]-> TryExitL 4"));
       
   874             TryExitL(EAknSoftkeyCancel);
       
   875             break;
       
   876         default:
       
   877             break;
   818     }
   878     }
       
   879 }
   819 
   880 
   820     
   881     
   821 // End of file
   882 // End of file
   822 
   883