259 // EButton1Up |
259 // EButton1Up |
260 |
260 |
261 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
261 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
262 { |
262 { |
263 iTreeListView->SetPressedDownState( EFalse ); |
263 iTreeListView->SetPressedDownState( EFalse ); |
264 if ( iTreeListView->SingleClickEnabled() && !aMarking ) |
264 if ( iTreeListView->SingleClickEnabled() ) |
265 { |
265 { |
266 iHighlightTimer->Cancel(); |
266 iHighlightTimer->Cancel(); |
267 iTreeListView->EnableHighlight( EFalse ); |
267 iTreeListView->EnableHighlight( EFalse ); |
268 iTreeListView->LongTapPointerEventL( aPointerEvent ); |
268 iTreeListView->LongTapPointerEventL( aPointerEvent ); |
269 } |
269 } |
353 { |
353 { |
354 CAknTreeItem* item = (*iItems)[ii].Item(); |
354 CAknTreeItem* item = (*iItems)[ii].Item(); |
355 |
355 |
356 if ( item && (*iItems)[ii].Rect().Contains( adjustedPosition ) ) |
356 if ( item && (*iItems)[ii].Rect().Contains( adjustedPosition ) ) |
357 { |
357 { |
358 if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
358 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
359 { |
359 { |
360 // Marking mode |
360 // Marking mode |
361 if ( aMarking ) |
361 if ( aMarking ) |
362 { |
362 { |
363 TBool drawNow = ( item == iTreeListView->FocusedItem() ); |
363 TBool drawNow = ( item == iTreeListView->FocusedItem() ); |
364 if ( aShiftPressed ) |
364 if ( aShiftPressed ) |
365 { |
365 { |
366 iTreeListView->MarkItems( iTreeListView->FocusedItem(), item, |
366 if ( iTreeListView->HighlightEnabled() ) |
367 !item->IsMarked(), drawNow ); |
367 { |
|
368 iTreeListView->MarkItems( iTreeListView->FocusedItem(), item, |
|
369 !item->IsMarked(), drawNow ); |
|
370 } |
|
371 else |
|
372 { |
|
373 iTreeListView->MarkItem( item, !item->IsMarked(), drawNow ); |
|
374 } |
368 } |
375 } |
369 else if ( aCtrlPressed ) |
376 else if ( aCtrlPressed ) |
370 { |
377 { |
371 iTreeListView->MarkItem( item, !item->IsMarked(), drawNow ); |
378 iTreeListView->MarkItem( item, !item->IsMarked(), drawNow ); |
372 } |
379 } |
373 } |
380 } |
374 else if ( iTreeListView->SingleClickEnabled() |
381 } |
375 && !wasFlicking ) |
382 else if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
383 { |
|
384 if ( iTreeListView->SingleClickEnabled() |
|
385 && !wasFlicking && !aMarking ) |
376 { |
386 { |
377 iItemToBeSelected = item; |
387 iItemToBeSelected = item; |
378 iTreeListView->SetFocusedItem( item, ii, EFalse ); |
388 iTreeListView->SetFocusedItem( item, ii, EFalse ); |
379 // Start long tap detector |
389 // Start long tap detector |
380 iTreeListView->LongTapPointerEventL( aPointerEvent ); |
390 iTreeListView->LongTapPointerEventL( aPointerEvent ); |
428 // next up event cause an action on the screen, |
438 // next up event cause an action on the screen, |
429 // play feedback on up event |
439 // play feedback on up event |
430 iPlayFeedbackOnUp = ETrue; |
440 iPlayFeedbackOnUp = ETrue; |
431 } |
441 } |
432 } |
442 } |
433 if ( !aMarking ) |
443 // timer will be launched everytime, but not |
|
444 // if flicking was ongoing AND it was stopped by tapping |
|
445 // to highlighted item or to folder (=node) |
|
446 if ( !( wasFlicking && iItemToBeSelected != NULL ) ) |
434 { |
447 { |
435 // timer will be launched everytime, but not |
448 LaunchHighlightTimer( wasScrolling ); |
436 // if flicking was ongoing AND it was stopped by tapping |
|
437 // to highlighted item or to folder (=node) |
|
438 if ( !( wasFlicking && iItemToBeSelected != NULL ) ) |
|
439 { |
|
440 LaunchHighlightTimer( wasScrolling ); |
|
441 } |
|
442 } |
|
443 else |
|
444 { |
|
445 // Pressed down highlight or highlight timer |
|
446 // are not used in marking mode. |
|
447 SetHighlight(); |
|
448 } |
449 } |
449 } |
450 } |
450 else if ( aPointerEvent.iType == TPointerEvent::EDrag ) |
451 else if ( aPointerEvent.iType == TPointerEvent::EDrag ) |
451 { |
452 { |
452 if ( iTreeListView->SingleClickEnabled() && !wasFlicking ) |
453 if ( iTreeListView->SingleClickEnabled() && !wasFlicking ) |
822 const TPoint& aNewPosition, |
823 const TPoint& aNewPosition, |
823 TBool aDrawNow, |
824 TBool aDrawNow, |
824 TUint /*aFlags*/ ) |
825 TUint /*aFlags*/ ) |
825 { |
826 { |
826 iScrollIndex = aNewPosition.iY - iViewRect.Height() / 2; |
827 iScrollIndex = aNewPosition.iY - iViewRect.Height() / 2; |
827 TTouchFeedbackType feedbackType = ETouchFeedbackVibra; |
|
828 if ( iPhysics->OngoingPhysicsAction() |
|
829 == CAknPhysics::EAknPhysicsActionDragging ) |
|
830 { |
|
831 feedbackType = static_cast<TTouchFeedbackType>(ETouchFeedbackAudio | ETouchFeedbackVibra); |
|
832 } |
|
833 if ( iPhysics->OngoingPhysicsAction() |
828 if ( iPhysics->OngoingPhysicsAction() |
834 == CAknPhysics::EAknPhysicsActionBouncing ) |
829 == CAknPhysics::EAknPhysicsActionBouncing ) |
835 { |
830 { |
836 iEventsBlocked = ETrue; |
831 iEventsBlocked = ETrue; |
837 iEnableEvents = EFalse; |
832 iEnableEvents = EFalse; |
903 if ( bottomItem != iOldBottomItem ) |
898 if ( bottomItem != iOldBottomItem ) |
904 { |
899 { |
905 if ( bottomItem != iTree->VisibleItemCount() - 1 ) |
900 if ( bottomItem != iTree->VisibleItemCount() - 1 ) |
906 iFeedback->InstantFeedback( iTreeListView, |
901 iFeedback->InstantFeedback( iTreeListView, |
907 ETouchFeedbackSensitiveList, |
902 ETouchFeedbackSensitiveList, |
908 feedbackType, |
903 ETouchFeedbackVibra, |
909 TPointerEvent() ); |
904 TPointerEvent() ); |
910 } |
905 } |
911 } |
906 } |
912 else if ( bottomItem == iTree->VisibleItemCount() ) |
907 else if ( bottomItem == iTree->VisibleItemCount() ) |
913 { |
908 { |
914 if ( upperItem != iOldTopItem && ( upperItem != 0 || iOldTopItem != -1 ) ) |
909 if ( upperItem != iOldTopItem && ( upperItem != 0 || iOldTopItem != -1 ) ) |
915 { |
910 { |
916 iFeedback->InstantFeedback( iTreeListView, |
911 iFeedback->InstantFeedback( iTreeListView, |
917 ETouchFeedbackSensitiveList, |
912 ETouchFeedbackSensitiveList, |
918 feedbackType, |
913 ETouchFeedbackVibra, |
919 TPointerEvent() ); |
914 TPointerEvent() ); |
920 } |
915 } |
921 } |
916 } |
922 else if ( upperItem >= 0 || bottomItem < iTree->VisibleItemCount() ) |
917 else if ( upperItem >= 0 || bottomItem < iTree->VisibleItemCount() ) |
923 { |
918 { |
924 if ( upperItem < iOldTopItem || bottomItem > iOldBottomItem ) |
919 if ( upperItem < iOldTopItem || bottomItem > iOldBottomItem ) |
925 { |
920 { |
926 iFeedback->InstantFeedback( iTreeListView, |
921 iFeedback->InstantFeedback( iTreeListView, |
927 ETouchFeedbackSensitiveList, |
922 ETouchFeedbackSensitiveList, |
928 feedbackType, |
923 ETouchFeedbackVibra, |
929 TPointerEvent() ); |
924 TPointerEvent() ); |
930 } |
925 } |
931 } |
926 } |
932 iOldTopItem = upperItem; |
927 iOldTopItem = upperItem; |
933 iOldBottomItem = bottomItem; |
928 iOldBottomItem = bottomItem; |