uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp
changeset 26 62ef28f7b435
parent 0 2f259fa3e83a
child 53 3c67ea82fafc
equal deleted inserted replaced
22:75713bee6484 26:62ef28f7b435
    30 #ifdef RD_INTELLIGENT_TEXT_INPUT
    30 #ifdef RD_INTELLIGENT_TEXT_INPUT
    31 #include <AknFepInternalPSKeys.h>    // KAknFepFnKeyState
    31 #include <AknFepInternalPSKeys.h>    // KAknFepFnKeyState
    32 #endif
    32 #endif
    33 #include "avkoninternalpskeys.h"     // KAknIdleAppWindowGroupId
    33 #include "avkoninternalpskeys.h"     // KAknIdleAppWindowGroupId
    34 #include <AknCapServerDefs.h>
    34 #include <AknCapServerDefs.h>
    35 #include <activeidle2domainpskeys.h>
       
    36 #include <eikpriv.rsg>
    35 #include <eikpriv.rsg>
    37 #include <coedef.h>
    36 #include <coedef.h>
    38 #include <eiksvdef.h>
    37 #include <eiksvdef.h>
    39 #include <aknconsts.h>
    38 #include <aknconsts.h>
    40 #include <AknsConstants.h>
    39 #include <AknsConstants.h>
    82 #include <AvkonInternalCRKeys.h>
    81 #include <AvkonInternalCRKeys.h>
    83 
    82 
    84 #include "akncapserverdiscreetpopuphandler.h"
    83 #include "akncapserverdiscreetpopuphandler.h"
    85 
    84 
    86 const TUid KPtiEnginePSUid = {0x101F8610}; // Same as PtiEngine dll
    85 const TUid KPtiEnginePSUid = {0x101F8610}; // Same as PtiEngine dll
    87 
    86 const TUid KPhoneUid = { 0x100058B3 };
    88 enum TPtiEnginePSKeys
    87 enum TPtiEnginePSKeys
    89     {
    88     {
    90     EKeyMapPropertyCount,
    89     EKeyMapPropertyCount,
    91     EKeyMapPropertyData,
    90     EKeyMapPropertyData,
    92     EKeyMapPropertyCount2,
    91     EKeyMapPropertyCount2,
   151     }
   150     }
   152     
   151     
   153 CAknCapAppServerAppUi::~CAknCapAppServerAppUi()
   152 CAknCapAppServerAppUi::~CAknCapAppServerAppUi()
   154     {
   153     {
   155     delete iAlternateFS;
   154     delete iAlternateFS;
   156     delete iTelephonyIdleUidSubscriber;
       
   157     delete iGlobalNotesAllowedSubscriber;
   155     delete iGlobalNotesAllowedSubscriber;
   158     
   156     
   159     if (iKeyCaptureControl)
   157     if (iKeyCaptureControl)
   160         {
   158         {
   161         RemoveFromStack(iKeyCaptureControl);   // ownership in stack 
   159         RemoveFromStack(iKeyCaptureControl);   // ownership in stack 
   440         TCallBack(GlobalNotesAllowedCallBack, this), 
   438         TCallBack(GlobalNotesAllowedCallBack, this), 
   441         iGlobalNotesAllowedProperty);
   439         iGlobalNotesAllowedProperty);
   442 
   440 
   443     iGlobalNotesAllowedSubscriber->Subscribe();
   441     iGlobalNotesAllowedSubscriber->Subscribe();
   444     
   442     
   445     // Start listening "telephony idle uid" property.
       
   446     User::LeaveIfError(iTelephonyIdleUidProperty.Attach(
       
   447         KPSUidAiInformation, 
       
   448         KActiveIdleUid));
       
   449 
       
   450     iTelephonyIdleUidSubscriber = new (ELeave) CPropertySubscriber(
       
   451         TCallBack(TelephonyIdleUidCallBack, this), 
       
   452         iTelephonyIdleUidProperty);
       
   453 
       
   454     iTelephonyIdleUidSubscriber->Subscribe();    
       
   455 #ifdef RD_INTELLIGENT_TEXT_INPUT
   443 #ifdef RD_INTELLIGENT_TEXT_INPUT
   456          
   444          
   457     TInt err1 = 0;         
   445     TInt err1 = 0;         
   458                                          
   446                                          
   459     err1 = RProperty::Define(KPtiEnginePSUid, EKeyMapPropertyCount, RProperty::EInt,
   447     err1 = RProperty::Define(KPtiEnginePSUid, EKeyMapPropertyCount, RProperty::EInt,
  1357         self->HandlePropertyChange(KUikGlobalNotesAllowed);
  1345         self->HandlePropertyChange(KUikGlobalNotesAllowed);
  1358         }
  1346         }
  1359     return KErrNone;
  1347     return KErrNone;
  1360     }
  1348     }
  1361 
  1349 
  1362 TInt CAknCapAppServerAppUi::TelephonyIdleUidCallBack(TAny* aPtr)
       
  1363     {
       
  1364     CAknCapAppServerAppUi* self = static_cast<CAknCapAppServerAppUi*>(aPtr);
       
  1365     if (self)
       
  1366         {
       
  1367         self->HandlePropertyChange(KActiveIdleUid);
       
  1368         }
       
  1369     return KErrNone;
       
  1370     }
       
  1371     
  1350     
  1372 void CAknCapAppServerAppUi::HandlePropertyChange(const TInt aProperty)
  1351 void CAknCapAppServerAppUi::HandlePropertyChange(const TInt aProperty)
  1373     {
  1352     {
  1374     switch(aProperty)
  1353     switch(aProperty)
  1375         {
  1354         {
  1376         case KUikGlobalNotesAllowed:
  1355         case KUikGlobalNotesAllowed:
  1377             {
  1356             {
  1378             TInt globalNotesAllowed = 0;
  1357             TUid uid = KPhoneUid;
  1379             TInt err = iTelephonyIdleUidProperty.Get(globalNotesAllowed);
  1358             TApaTaskList taskList ( CEikonEnv::Static ()->WsSession () );
  1380             if(!err && globalNotesAllowed)
  1359             TApaTask task = taskList.FindApp ( uid );
       
  1360             if ( task.Exists() )
  1381                 {
  1361                 {
  1382                 // Global notes allowed, so the boot is finished. Now the idle app uid and its
  1362                 TInt wgId = task.WgId ();
  1383                 // window group id can be fetched.
       
  1384                 HandlePropertyChange(KActiveIdleUid);
       
  1385                 }
       
  1386             }
       
  1387             break;
       
  1388         case KActiveIdleUid:
       
  1389             {
       
  1390             TInt idleAppUid = 0;
       
  1391             TInt err = iTelephonyIdleUidProperty.Get(idleAppUid);
       
  1392             if(!err)
       
  1393                 {
       
  1394                 // Fetch the Idle application window group id.
       
  1395                 TApaTaskList taskList(CEikonEnv::Static()->WsSession());
       
  1396                 TApaTask task = taskList.FindApp(TUid::Uid(idleAppUid));
       
  1397                 TInt wgId = task.WgId();
       
  1398                 
       
  1399                 // Save the window group id to PubSub. 
  1363                 // Save the window group id to PubSub. 
  1400                 RProperty::Set(KPSUidAvkonInternal, KAknIdleAppWindowGroupId, wgId);     
  1364                 RProperty::Set ( KPSUidAvkonInternal, KAknIdleAppWindowGroupId,
       
  1365                         wgId );
  1401                 }
  1366                 }
  1402             }
  1367             }
  1403             break;
  1368             break;
  1404         default:
  1369         default:
  1405             break;
  1370             break;