terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp
branchRCL_3
changeset 27 5cc2995847ea
parent 26 19bba8228ff0
equal deleted inserted replaced
26:19bba8228ff0 27:5cc2995847ea
    20 #include <eikseced.h>
    20 #include <eikseced.h>
    21 #include <aknsoundsystem.h>
    21 #include <aknsoundsystem.h>
    22 #include <StringLoader.h>
    22 #include <StringLoader.h>
    23 #include <aknappui.h> 
    23 #include <aknappui.h> 
    24 #include <avkon.rsg>
    24 #include <avkon.rsg>
    25 #include <SecUi.rsg>
    25 #include <secui.rsg>
    26 // Include the SecUi definitions
    26 // Include the SecUi definitions
    27 #include <secui.hrh>
    27 #include <secui.hrh>
    28 #include "SCPDebug.h"
    28 #include "SCPDebug.h"
    29 #include <SCPNotifier.rsg>
    29 #include <scpnotifier.rsg>
    30 // For Central Repository
    30 // For Central Repository
    31 #include <centralrepository.h>
    31 #include <centralrepository.h>
    32 #include <AknIncallBubbleNotify.h>
    32 #include <AknIncallBubbleNotify.h>
    33 #include <e32property.h>
    33 #include <e32property.h>
    34 #include <ctsydomainpskeys.h>
    34 #include <ctsydomainpskeys.h>
    35 #include "SCPCodePrivateCRKeys.h"
    35 #include "SCPCodePrivateCRKeys.h"
    36 #include <DevManInternalCRKeys.h>
    36 #include <DevManInternalCRKeys.h>
    37 #include <featmgr.h>
    37 #include <featmgr.h>
       
    38 #include <aknglobalpopupprioritycontroller.h>
    38 
    39 
    39 /*#ifdef _DEBUG
    40 /*#ifdef _DEBUG
    40 #define __SCP_DEBUG
    41 #define __SCP_DEBUG
    41 #endif // _DEBUG
    42 #endif // _DEBUG
    42 
    43 
   280 	TInt var;
   281 	TInt var;
   281 	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, var);
   282 	RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, var);
   282 	Dprint((_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"), var));
   283 	Dprint((_L("CSCPQueryDialog::PreLayoutDynInitL(): EPSCTsyCallStateNone %d"), var));
   283 	
   284 	
   284     // If the call is made during device startup have the priority as normal
   285     // If the call is made during device startup have the priority as normal
   285     if (iECSSupport)
   286     if (iECSSupport) {
   286     {
   287     
   287         switch(var) {
   288         switch(var) {
   288             default:
   289             default:
   289             case EPSCTsyCallStateNone:
   290             case EPSCTsyCallStateNone:
   290                 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Maximized...")));
   291                 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Started Maximized...")));
   291                 iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
   292                 iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
       
   293                 AknGlobalPopupPriorityController :: SetPopupPriorityL(*this, 1);
   292                 iPrioritySet = ETrue;
   294                 iPrioritySet = ETrue;
   293                 break;
   295                 break;
   294             case EPSCTsyCallStateAlerting:
   296             case EPSCTsyCallStateAlerting:
   295             case EPSCTsyCallStateHold:
   297             case EPSCTsyCallStateHold:
   296             case EPSCTsyCallStateRinging:
   298             case EPSCTsyCallStateRinging:
   307                     default:
   309                     default:
   308                         break;
   310                         break;
   309                 }
   311                 }
   310             }
   312             }
   311         }
   313         }
       
   314 	        
       
   315         Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));
       
   316         DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
       
   317         ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
   312     }
   318     }
   313 	        
   319     else {
   314    // this must be done always to keep the reference count in synch  
   320         AknGlobalPopupPriorityController :: SetPopupPriorityL(*this, 0);
   315    // this does not have any effect if autoforwarding has not been set true (normal application.)
   321         DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal);
   316    iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1);
   322         ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal);
   317 
   323     }
   318 	/// -- Change Window Priority for dialog and CBA 
   324 
   319 	if (iECSSupport)
   325     // this must be done always to keep the reference count in synch  
   320 		{
   326     // this does not have any effect if autoforwarding has not been set true (normal application.)
   321 		Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") ));
   327     iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1);
   322 		DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
   328 
   323 		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
   329     Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") ));
   324 		}
   330     // Key sounds
   325 	else
   331     static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PushContextL(R_AVKON_DEFAULT_SKEY_LIST);
   326 		{
   332     static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground();
   327 		DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1); //
   333     static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
   328 		ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1);
   334     iFront = ETrue;
   329 		}	
   335 	
   330 
       
   331 	Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") ));
       
   332 	// Key sounds
       
   333 
       
   334 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->
       
   335 	    PushContextL(R_AVKON_DEFAULT_SKEY_LIST);
       
   336 	    	                                                             
       
   337 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground();
       
   338 	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
       
   339 
       
   340 	iFront = ETrue;
       
   341     TInt currentLawmoState(0); 
   336     TInt currentLawmoState(0); 
   342     Dprint( (_L("CSCPQueryDialog::lawmo cenrep") ));
   337     Dprint( (_L("CSCPQueryDialog::lawmo cenrep") ));
   343     CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys );
   338     CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys );
   344     TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); 
   339     TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); 
   345     Dprint( (_L("CSCPQueryDialog::lawmo cenrep done") ));
   340     Dprint( (_L("CSCPQueryDialog::lawmo cenrep done") ));
   851                 case RSCPClient :: SCP_OK_ETEL:
   846                 case RSCPClient :: SCP_OK_ETEL:
   852                     if(iEMCallActivated) {
   847                     if(iEMCallActivated) {
   853                         TryExitL(EAknSoftkeyCancel);
   848                         TryExitL(EAknSoftkeyCancel);
   854                     }
   849                     }
   855                     else {
   850                     else {
       
   851                         AknGlobalPopupPriorityController :: SetPopupPriorityL(*this, 1);
   856                         iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
   852                         iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront + 1);
   857                         iPrioritySet = ETrue;
   853                         iPrioritySet = ETrue;
   858                     }
   854                     }
   859                     break;
   855                     break;
   860                 default:
   856                 default: