uifw/AvKon/animdllsrc/AknAnimKeySound.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
    30 #include "avkoninternalpskeys.h"    // KAknIdleAppWindowGroupId
    30 #include "avkoninternalpskeys.h"    // KAknIdleAppWindowGroupId
    31 #include <avkondomainpskeys.h>      // KAknPowerMenuStatus & KAknEndKeyEvent
    31 #include <avkondomainpskeys.h>      // KAknPowerMenuStatus & KAknEndKeyEvent
    32 
    32 
    33 // This is currently nasty set dependencies, API should be moved to middleware layer asap 
    33 // This is currently nasty set dependencies, API should be moved to middleware layer asap 
    34 #include <ctsydomainpskeys.h> 
    34 #include <ctsydomainpskeys.h> 
    35 
    35 #include <activeidle2domainpskeys.h>
    36 #include <networkhandlingdomainpskeys.h>
    36 #include <NetworkHandlingDomainPSKeys.h>
    37 #include <PSVariables.h>
    37 #include <PSVariables.h>
    38 
    38 
    39 #include <hwrmlight.h> 
    39 #include <hwrmlight.h> 
    40 #include <tactilefeedbackserver.h>
    40 #include <tactilefeedbackserver.h>
    41 
    41 
   256     if (iFeatureNoPowerKey)
   256     if (iFeatureNoPowerKey)
   257         {
   257         {
   258         iPendingEvent = CAknPendingKeyEvent::NewL(iFunctions, iNoPowerKeyScanCode);
   258         iPendingEvent = CAknPendingKeyEvent::NewL(iFunctions, iNoPowerKeyScanCode);
   259         }
   259         }
   260 
   260 
       
   261     
       
   262     iSupportQuertyKey = 
       
   263                FeatureManager::FeatureSupported( KFeatureIdQwertyInput );
       
   264     
   261     FeatureManager::UnInitializeLib();
   265     FeatureManager::UnInitializeLib();
   262     
   266     
   263     // Get extension for querying and manipulating the window and screen attributes.
   267     // Get extension for querying and manipulating the window and screen attributes.
   264     iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(
   268     iExt = reinterpret_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(
   265         MAnimGeneralFunctions::EWindowExtensionInterface)); 
   269         MAnimGeneralFunctions::EWindowExtensionInterface)); 
   285 
   289 
   286 // -----------------------------------------------------------------------------
   290 // -----------------------------------------------------------------------------
   287 // CAknAnimKeySound::IsBlockedKeyCode
   291 // CAknAnimKeySound::IsBlockedKeyCode
   288 // -----------------------------------------------------------------------------
   292 // -----------------------------------------------------------------------------
   289 //
   293 //
   290 TBool CAknAnimKeySound::IsBlockedKeyCode( TInt aScanCode )
   294 TBool CAknAnimKeySound::IsBlockedKeyCode( TBool aSupportQuerty , TInt aScanCode )  
   291     {
   295     {
       
   296     if( aSupportQuerty )
       
   297         {
       
   298         return EFalse;
       
   299         }
   292     for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ )
   300     for ( TInt ii=0; ii < KBlockedKeyCodeTableSize; ii++ )
   293         {
   301         {
   294         if ( aScanCode == KBlockedKeyCodes[ii] )
   302         if ( aScanCode == KBlockedKeyCodes[ii] )
   295             {
   303             {
   296             return ETrue;
   304             return ETrue;
   523         {
   531         {
   524         TInt ps(0), startupOk(0), idle(0);
   532         TInt ps(0), startupOk(0), idle(0);
   525 
   533 
   526         // If system is not in idle or there are calls ongoing, then end key ought to be generated.
   534         // If system is not in idle or there are calls ongoing, then end key ought to be generated.
   527         User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, ps ) );
   535         User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, ps ) );
       
   536         User::LeaveIfError( RProperty::Get( KPSUidAiInformation, KActiveIdleState, idle ) );
   528         User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, startupOk ) );
   537         User::LeaveIfError( RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, startupOk ) );
   529 
   538 
   530         RDebug::Print(_L("call: %d, idle %d, notes %d"), ps, idle, startupOk);
   539         RDebug::Print(_L("call: %d, idle %d, notes %d"), ps, idle, startupOk);
   531 
   540 
   532         // Call state not yet initialized or startup not yet complete but no emergency call ongoing.
   541         // Call state not yet initialized or startup not yet complete but no emergency call ongoing.
   533         if (ps == EPSCTsyCallStateUninitialized || 
   542         if (ps == EPSCTsyCallStateUninitialized || 
   534            (ps == EPSCTsyCallStateNone && !startupOk) )
   543            (ps == EPSCTsyCallStateNone && !startupOk) )
   535             {
   544             {
   536             return;
   545             return;
   537             }
   546             }
       
   547         
       
   548         if ( idle == EPSAiForeground )
       
   549             { 
       
   550             // Notify active idle plugins that combined end key / power key has been pressed.
       
   551             RProperty::Set(KPSUidAvkonDomain, KAknEndKeyEvent, 1); 
       
   552             }
       
   553         
   538         if ( ps != EPSCTsyCallStateNone )
   554         if ( ps != EPSCTsyCallStateNone )
   539             {
   555             {
   540             // A phone call is active.
   556             // A phone call is active.
   541             aResult = EEmulateNowPhoneCallActive;
   557             aResult = EEmulateNowPhoneCallActive;
       
   558             }
       
   559         else if ( idle != EPSAiForeground )
       
   560             {
       
   561             // We are not in idle view. No active phone calls.
       
   562             aResult = EEmulateNow;
   542             }
   563             }
   543         else
   564         else
   544             {
   565             {
   545             // We are in idle view with no active phone calls. 
   566             // We are in idle view with no active phone calls. 
   546             TInt powerMenuActive(0);
   567             TInt powerMenuActive(0);
   723         {
   744         {
   724         case TRawEvent::EKeyDown:
   745         case TRawEvent::EKeyDown:
   725             {
   746             {
   726             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   747             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   727             if ( !NonBlockedKeyCode( scan ) 
   748             if ( !NonBlockedKeyCode( scan ) 
   728                 && iKeyPressed && iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   749                 && iKeyPressed && iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   729                 {
   750                 {
   730                 blockEvent = ETrue;
   751                 blockEvent = ETrue;
   731                 }
   752                 }
   732             else
   753             else
   733                 {
   754                 {
   749 
   770 
   750         case TRawEvent::EKeyRepeat:
   771         case TRawEvent::EKeyRepeat:
   751             {
   772             {
   752             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   773             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   753             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   774             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   754                  iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   775                  iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   755                 {
   776                 {
   756                 // If down event is not passed forward, then 
   777                 // If down event is not passed forward, then 
   757                 // repeat events are not passed either.
   778                 // repeat events are not passed either.
   758                 blockEvent = ETrue;
   779                 blockEvent = ETrue;
   759                 }
   780                 }
   762             
   783             
   763         case TRawEvent::EKeyUp:
   784         case TRawEvent::EKeyUp:
   764             {
   785             {
   765             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   786             TInt scan = aRawEvent.ScanCode() & 0xFFFF;
   766             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   787             if ( !NonBlockedKeyCode( scan ) && iKeyPressed != scan && 
   767                  iEnableKeyBlock && IsBlockedKeyCode( scan ) )
   788                  iEnableKeyBlock && IsBlockedKeyCode(iSupportQuertyKey, scan ) )
   768                 {
   789                 {
   769                 // Do not need to block key-up events - there's not a problem 
   790                 // Do not need to block key-up events - there's not a problem 
   770                 // if there's an unexpected key-up events delivery to an app
   791                 // if there's an unexpected key-up events delivery to an app
   771                 }
   792                 }
   772             else
   793             else