uifw/AknGlobalUI/OldStyleNotif/Src/AknListQueryNotificationDialog.cpp
branchRCL_3
changeset 19 aecbbf00d063
parent 18 fcdfafb36fe7
child 20 d48ab3b357f1
equal deleted inserted replaced
18:fcdfafb36fe7 19:aecbbf00d063
    17 
    17 
    18 #include <uikon.hrh> // EKeyOk
    18 #include <uikon.hrh> // EKeyOk
    19 #include "AknListQueryNotificationDialog.h"
    19 #include "AknListQueryNotificationDialog.h"
    20 #include "AknNotifyPlugin.hrh"
    20 #include "AknNotifyPlugin.hrh"
    21 #include "avkon.hrh"
    21 #include "avkon.hrh"
    22 #include "AknSystemListPopup.h"
       
    23 
    22 
    24 CAknListQueryNotificationDialog::CAknListQueryNotificationDialog( 
    23 CAknListQueryNotificationDialog::CAknListQueryNotificationDialog( 
    25     TInt* aIndex,
    24     TInt* aIndex,
    26     MAknListQueryNotificationCallback* aCallBack,
    25     MAknListQueryNotificationCallback* aCallBack,
    27     CAknListQueryNotificationDialog** aSelfPtr)
    26     CAknListQueryNotificationDialog** aSelfPtr)
    28     : CAknListQueryDialog(aIndex)
    27     : CAknListQueryDialog(aIndex), iCallBack(aCallBack), iSelfPtr(aSelfPtr)
    29     , iCallBack(aCallBack)
       
    30     , iSelfPtr(aSelfPtr)
       
    31     , iPointerUpEaten(EFalse)
       
    32     {
    28     {
    33     }
    29     }
    34 
    30 
    35 CAknListQueryNotificationDialog::~CAknListQueryNotificationDialog()
    31 CAknListQueryNotificationDialog::~CAknListQueryNotificationDialog()
    36     {
    32     {
    56     
    52     
    57     if (aType != EEventKey)
    53     if (aType != EEventKey)
    58         {
    54         {
    59         return EKeyWasNotConsumed;
    55         return EKeyWasNotConsumed;
    60         }
    56         }
    61     
       
    62     iPointerUpEaten = EFalse;
       
    63     
    57     
    64     TInt code = aKeyEvent.iCode;
    58     TInt code = aKeyEvent.iCode;
    65     
    59     
    66     switch (code)
    60     switch (code)
    67         {
    61         {
   115     CAknListQueryDialog::HandleListBoxEventL(aListBox, aEventType);
   109     CAknListQueryDialog::HandleListBoxEventL(aListBox, aEventType);
   116     }
   110     }
   117 
   111 
   118 TBool CAknListQueryNotificationDialog::OkToExitL(TInt aButtonId)
   112 TBool CAknListQueryNotificationDialog::OkToExitL(TInt aButtonId)
   119     {
   113     {
   120     // Fix the problem where the pointer up event is handled to close the power menu key,
       
   121     // when the popup shows on the top of power menu before releasing the tap.
       
   122     if (iPointerUpEaten && AknLayoutUtils::PenEnabled() && aButtonId == EAknSoftkeyOk)
       
   123         {
       
   124         iPointerUpEaten = EFalse;
       
   125         //Fix the problem where the pointer up event is handled to active the power menu item
       
   126         //when lock screen happans before releasing the tap on power menu item
       
   127         if(((CAknGlobalListQuerySubject*)iCallBack)->IsKeyLockEnable())
       
   128             {
       
   129             aButtonId = EAknSoftkeyCancel;
       
   130             }
       
   131         else
       
   132             {
       
   133             return EFalse;
       
   134             }
       
   135         }
       
   136     
       
   137     TInt ret = -1;
   114     TInt ret = -1;
   138     if (aButtonId != EAknSoftkeyCancel)
   115     if (aButtonId != EAknSoftkeyCancel)
   139         {
   116         {
   140         ret = ListBox()->CurrentItemIndex();
   117         ret = ListBox()->CurrentItemIndex();
   141         }
   118         }
   143     if (aButtonId == EAknSoftkeyCancel || aButtonId == EAknSoftkeyOk)
   120     if (aButtonId == EAknSoftkeyCancel || aButtonId == EAknSoftkeyOk)
   144         {
   121         {
   145         return ETrue;
   122         return ETrue;
   146         }
   123         }
   147     return EFalse;
   124     return EFalse;
   148     }
       
   149 
       
   150 void CAknListQueryNotificationDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   151     {
       
   152     iPointerUpEaten = EFalse;
       
   153     
       
   154     if (aPointerEvent.iType == TPointerEvent::EButton1Up && (!IsFocused() || ((CAknGlobalListQuerySubject*)iCallBack)->IsKeyLockEnable()))
       
   155         {
       
   156         iPointerUpEaten = ETrue;
       
   157         }
       
   158     
       
   159     CAknListQueryDialog::HandlePointerEventL(aPointerEvent);
       
   160     }
   125     }
   161 
   126 
   162 void CAknListQueryNotificationDialog::CEikDialog_Reserved_1()
   127 void CAknListQueryNotificationDialog::CEikDialog_Reserved_1()
   163     {
   128     {
   164     }
   129     }