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 <featmgr.h> |
37 #include <featmgr.h> |
37 |
38 |
38 /*#ifdef _DEBUG |
39 /*#ifdef _DEBUG |
39 #define __SCP_DEBUG |
40 #define __SCP_DEBUG |
40 #endif // _DEBUG |
41 #endif // _DEBUG |
48 #else |
49 #else |
49 #define Dprint(a) |
50 #define Dprint(a) |
50 #endif // _DEBUG*/ |
51 #endif // _DEBUG*/ |
51 |
52 |
52 const TInt KSCPSpecialDeleteEvent( 63529 ); |
53 const TInt KSCPSpecialDeleteEvent( 63529 ); |
53 |
54 const TInt KLockedbyLawmo (30); |
54 // ================= MEMBER FUNCTIONS ======================= |
55 // ================= MEMBER FUNCTIONS ======================= |
55 // |
56 // |
56 // ---------------------------------------------------------- |
57 // ---------------------------------------------------------- |
57 // CSCPQueryDialog::CSCPQueryDialog() |
58 // CSCPQueryDialog::CSCPQueryDialog() |
58 // C++ constructor |
59 // C++ constructor |
75 iEMCallActivated( EFalse ), |
76 iEMCallActivated( EFalse ), |
76 iShowingEMNumber( EFalse ), |
77 iShowingEMNumber( EFalse ), |
77 iPreviousCharacterWasInvalid( EFalse ), |
78 iPreviousCharacterWasInvalid( EFalse ), |
78 iPrioritySet( EFalse ), |
79 iPrioritySet( EFalse ), |
79 iPriorityDropped( EFalse ), |
80 iPriorityDropped( EFalse ), |
|
81 iLockedByLawMo( EFalse ), |
80 iKeyUsed ( NULL ), |
82 iKeyUsed ( NULL ), |
81 iContextSensitive(aContextSensitive) |
83 iContextSensitive(aContextSensitive) |
82 { |
84 { |
83 def_mode = 0; |
85 def_mode = 0; |
84 iAppKey = 0; |
86 iAppKey = 0; |
334 |
336 |
335 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground(); |
337 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground(); |
336 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext(); |
338 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext(); |
337 |
339 |
338 iFront = ETrue; |
340 iFront = ETrue; |
|
341 TInt currentLawmoState(0); |
|
342 Dprint( (_L("CSCPQueryDialog::lawmo cenrep") )); |
|
343 CRepository* crep = CRepository::NewLC( KCRUidDeviceManagementInternalKeys ); |
|
344 TInt reterr = crep->Get( KLAWMOPhoneLock, currentLawmoState ); |
|
345 Dprint( (_L("CSCPQueryDialog::lawmo cenrep done") )); |
|
346 |
|
347 if(reterr != KErrNone) |
|
348 { |
|
349 Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep lawmo, lErr=%d"), reterr); |
|
350 CleanupStack :: PopAndDestroy(crep); |
|
351 return; |
|
352 } |
|
353 |
|
354 if(currentLawmoState!=KLockedbyLawmo) |
|
355 { |
|
356 // Hide the OK key |
|
357 Dprint( (_L("CSCPQueryDialog::lawmo state !=30, dim key") )); |
|
358 iLockedByLawMo = ETrue; |
|
359 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
360 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
361 } |
|
362 CleanupStack::PopAndDestroy(); |
339 } |
363 } |
340 // |
364 // |
341 // --------------------------------------------------------- |
365 // --------------------------------------------------------- |
342 // CSCPQueryDialog::OfferKeyEventL |
366 // CSCPQueryDialog::OfferKeyEventL |
343 // called by framework when any key is pressed |
367 // called by framework when any key is pressed |
628 else |
652 else |
629 { |
653 { |
630 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
654 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
631 } |
655 } |
632 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) ); |
656 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0,EAknSoftkeyOk,*cbaLabel) ); |
|
657 if(iLockedByLawMo) |
|
658 { |
|
659 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
660 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
661 } |
633 ButtonGroupContainer().DrawDeferred(); |
662 ButtonGroupContainer().DrawDeferred(); |
634 delete cbaLabel; |
663 delete cbaLabel; |
635 } |
664 } |
636 } |
665 } |
637 } |
666 } |
645 return ret; |
674 return ret; |
646 } |
675 } |
647 else |
676 else |
648 { |
677 { |
649 return CAknTextQueryDialog::OfferKeyEventL(aKeyEvent,aType); |
678 return CAknTextQueryDialog::OfferKeyEventL(aKeyEvent,aType); |
|
679 } |
|
680 |
|
681 if(iLockedByLawMo) |
|
682 { |
|
683 Dprint( (_L("dim key hit 2") )); |
|
684 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
685 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
650 } |
686 } |
651 } |
687 } |
652 // |
688 // |
653 // --------------------------------------------------------- |
689 // --------------------------------------------------------- |
654 // CSCPQueryDialog::NeedToDismissQueryL() |
690 // CSCPQueryDialog::NeedToDismissQueryL() |
763 else |
799 else |
764 { |
800 { |
765 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
801 ButtonGroupContainer().RemoveCommandFromStack(0,EAknSoftkeyOk); |
766 } |
802 } |
767 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0, EAknSoftkeyOk, *cbaLabel) ); |
803 TRAP ( err , ButtonGroupContainer().AddCommandToStackL(0, EAknSoftkeyOk, *cbaLabel) ); |
|
804 if(iLockedByLawMo) |
|
805 { |
|
806 ButtonGroupContainer().MakeCommandVisible( EAknSoftkeyOk, ETrue ); |
|
807 ButtonGroupContainer().DimCommand(EAknSoftkeyOk, ETrue); |
|
808 } |
768 ButtonGroupContainer().DrawDeferred(); |
809 ButtonGroupContainer().DrawDeferred(); |
769 delete cbaLabel; |
810 delete cbaLabel; |
770 } |
811 } |
771 } |
812 } |
772 } |
813 } |
797 incallBubble->SetIncallBubbleAllowedInUsualL(aAllowed); |
838 incallBubble->SetIncallBubbleAllowedInUsualL(aAllowed); |
798 CleanupStack :: PopAndDestroy(); |
839 CleanupStack :: PopAndDestroy(); |
799 } |
840 } |
800 |
841 |
801 void CSCPQueryDialog::TryCancelQueryL(TInt aReason) { |
842 void CSCPQueryDialog::TryCancelQueryL(TInt aReason) { |
802 Dprint( (_L("CSCPQueryDialog::TryCancelQueryL()")) ); |
843 Dprint( (_L("CSCPQueryDialog::TryCancelQueryL() >>>")) ); |
803 |
844 |
804 switch(aReason) { |
845 switch(aReason) { |
805 case CSCPLockObserver :: EEnded: |
846 case CSCPLockObserver :: EEnded: |
806 Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): Call ended, raising priority..."))); |
847 Dprint( (_L("CSCPQueryDialog::TryCancelQueryL(): Call ended, raising priority..."))); |
807 |
848 |