phoneuis/easydialing/src/easydialinglistbox.cpp
branchRCL_3
changeset 20 3c221667e687
parent 14 b8d67d6176f5
child 23 40a3f856b14d
equal deleted inserted replaced
14:b8d67d6176f5 20:3c221667e687
   489         }
   489         }
   490     }
   490     }
   491 
   491 
   492 
   492 
   493 // -----------------------------------------------------------------------------
   493 // -----------------------------------------------------------------------------
   494 // CurrentContactLinkLC
   494 // CurrentContactLinkL
   495 // 
   495 // 
   496 // -----------------------------------------------------------------------------
   496 // -----------------------------------------------------------------------------
   497 //
   497 //
   498 HBufC8* CEasyDialingListBox::CurrentContactLinkLC()
   498 HBufC8* CEasyDialingListBox::CurrentContactLinkL()
   499     {
   499     {
   500     TInt index = CurrentContactDataIndex();
   500     TInt index = CurrentContactDataIndex();
   501     return iContactDataManager->ContactLinkLC( index );
   501     if ( index >= 0 )
       
   502         {
       
   503         HBufC8* packedContact = iContactDataManager->ContactLinkLC( index );
       
   504         CleanupStack::Pop( packedContact );
       
   505         return packedContact;
       
   506         }
       
   507     else
       
   508         {
       
   509         return NULL;
       
   510         }
   502     }
   511     }
   503 
   512 
   504 
   513 
   505 // -----------------------------------------------------------------------------
   514 // -----------------------------------------------------------------------------
   506 // HandleLongTapEventL
   515 // HandleLongTapEventL
   531     if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
   540     if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
   532         {
   541         {
   533         iPointerLongPressHandled = EFalse;
   542         iPointerLongPressHandled = EFalse;
   534         }
   543         }
   535     
   544     
   536     iLongTapDetector->PointerEventL(aPointerEvent);
   545     // check if pointer event is over item
       
   546     TInt itemIndex( KErrNotFound );
       
   547     TPoint pointerPos( aPointerEvent.iPosition );
       
   548     TBool pointerIsOverAnItem = iView->XYPosToItemIndex( pointerPos, itemIndex );
       
   549     
       
   550     // long tap is started only if pointer is over an actual item
       
   551     // (not over margin or other empty listbox area)
       
   552     if ( pointerIsOverAnItem || aPointerEvent.iType != TPointerEvent::EButton1Down )
       
   553         {
       
   554         iLongTapDetector->PointerEventL(aPointerEvent);
       
   555         }
       
   556     
   537     if ( iPointerLongPressHandled )
   557     if ( iPointerLongPressHandled )
   538         {
   558         {
   539         // No further handling is made after long tap on list item
   559         // No further handling is made after long tap on list item
   540         // has been detected.
   560         // has been detected.
   541         return;
   561         return;