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> |
|
37 #include <featmgr.h> |
36 #include <featmgr.h> |
38 #include <aknglobalpopupprioritycontroller.h> |
37 #include <aknglobalpopupprioritycontroller.h> |
39 |
38 |
40 /*#ifdef _DEBUG |
39 /*#ifdef _DEBUG |
41 #define __SCP_DEBUG |
40 #define __SCP_DEBUG |
77 iEMCallActivated( EFalse ), |
76 iEMCallActivated( EFalse ), |
78 iShowingEMNumber( EFalse ), |
77 iShowingEMNumber( EFalse ), |
79 iPreviousCharacterWasInvalid( EFalse ), |
78 iPreviousCharacterWasInvalid( EFalse ), |
80 iPrioritySet( EFalse ), |
79 iPrioritySet( EFalse ), |
81 iPriorityDropped( EFalse ), |
80 iPriorityDropped( EFalse ), |
82 iLockedByLawMo( EFalse ), |
81 iContextSensitive(aContextSensitive), |
83 iKeyUsed ( NULL ), |
82 iKeyUsed ( NULL ) |
84 iContextSensitive(aContextSensitive) |
|
85 { |
83 { |
86 def_mode = 0; |
84 def_mode = 0; |
87 iAppKey = 0; |
85 iAppKey = 0; |
88 iMode = KSCPModeNormal; |
86 iMode = KSCPModeNormal; |
89 } |
87 } |
311 } |
309 } |
312 } |
310 } |
313 } |
311 } |
314 |
312 |
315 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") )); |
313 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Changing Window Priority") )); |
316 DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); |
314 DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal); |
317 ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); |
|
318 } |
315 } |
319 else { |
316 else { |
320 AknGlobalPopupPriorityController :: SetPopupPriorityL(*this, 0); |
317 AknGlobalPopupPriorityController :: SetPopupPriorityL(*this, 0); |
321 DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal); |
318 DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal); |
322 ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityNormal); |
|
323 } |
319 } |
324 |
320 |
325 // this must be done always to keep the reference count in synch |
321 // this must be done always to keep the reference count in synch |
326 // this does not have any effect if autoforwarding has not been set true (normal application.) |
322 // this does not have any effect if autoforwarding has not been set true (normal application.) |
327 iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1); |
323 iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront+1); |
328 |
324 |
329 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") )); |
325 Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") )); |
330 // Key sounds |
326 // Key sounds |
331 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PushContextL(R_AVKON_DEFAULT_SKEY_LIST); |
327 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PushContextL(R_AVKON_DEFAULT_SKEY_LIST); |
332 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground(); |
328 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground(); |
333 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext(); |
329 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext(); |
334 iFront = ETrue; |
330 iFront = ETrue; |
335 |
|
336 TInt currentLawmoState(0); |
|
337 Dprint( (_L("CSCPQueryDialog::lawmo cenrep") )); |
|
338 CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
|
339 TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); |
|
340 Dprint( (_L("CSCPQueryDialog::lawmo cenrep done") )); |
|
341 |
|
342 if(reterr != KErrNone) |
|
343 { |
|
344 Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep lawmo, lErr=%d"), reterr); |
|
345 CleanupStack :: PopAndDestroy(crep); |
|
346 return; |
|
347 } |
|
348 |
|
349 if(currentLawmoState!=KLockedbyLawmo) |
|
350 { |
|
351 // Hide the OK key |
|
352 Dprint( (_L("CSCPQueryDialog::lawmo state !=30, dim key") )); |
|
353 iLockedByLawMo = ETrue; |
|
354 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
355 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
356 } |
|
357 CleanupStack::PopAndDestroy(); |
|
358 } |
331 } |
359 // |
332 // |
360 // --------------------------------------------------------- |
333 // --------------------------------------------------------- |
361 // CSCPQueryDialog::OfferKeyEventL |
334 // CSCPQueryDialog::OfferKeyEventL |
362 // called by framework when any key is pressed |
335 // called by framework when any key is pressed |
647 else |
620 else |
648 { |
621 { |
649 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
622 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
650 } |
623 } |
651 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) ); |
624 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) ); |
652 if(iLockedByLawMo) |
|
653 { |
|
654 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
655 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
656 } |
|
657 ButtonGroupContainer().DrawDeferred(); |
625 ButtonGroupContainer().DrawDeferred(); |
658 delete cbaLabel; |
626 delete cbaLabel; |
659 } |
627 } |
660 } |
628 } |
661 } |
629 } |
794 else |
755 else |
795 { |
756 { |
796 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
757 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
797 } |
758 } |
798 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0, EAknSoftkeyOk, *cbaLabel) ); |
759 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0, EAknSoftkeyOk, *cbaLabel) ); |
799 if(iLockedByLawMo) |
|
800 { |
|
801 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
802 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
803 } |
|
804 ButtonGroupContainer().DrawDeferred(); |
760 ButtonGroupContainer().DrawDeferred(); |
805 delete cbaLabel; |
761 delete cbaLabel; |
806 } |
762 } |
807 } |
763 } |
808 } |
764 } |