419 // left gesture |
419 // left gesture |
420 mView->handlePreviewPaneGesture(false); |
420 mView->handlePreviewPaneGesture(false); |
421 event->accept(Qt::PanGesture); |
421 event->accept(Qt::PanGesture); |
422 } else { |
422 } else { |
423 event->accept(Qt::PanGesture); |
423 event->accept(Qt::PanGesture); |
|
424 // Since user tried to tap and ended up giving low pan |
|
425 // hence, handle it as tap |
|
426 tapTriggered(); |
424 OstTraceFunctionExit0( DUP1_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
427 OstTraceFunctionExit0( DUP1_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
425 return; |
428 return; |
426 } |
429 } |
427 } else if (abs(verticalDiff) < MAX_PAN_DIRECTION_THRESHOLD) { |
430 } else if (abs(verticalDiff) < MAX_PAN_DIRECTION_THRESHOLD) { |
428 if (horizontalDiff > MIN_PAN_DIRECTION_THRESHOLD) { |
431 if (horizontalDiff > MIN_PAN_DIRECTION_THRESHOLD) { |
435 // left gesture |
438 // left gesture |
436 mView->handlePreviewPaneGesture(false); |
439 mView->handlePreviewPaneGesture(false); |
437 event->accept(Qt::PanGesture); |
440 event->accept(Qt::PanGesture); |
438 }else { |
441 }else { |
439 event->accept(Qt::PanGesture); |
442 event->accept(Qt::PanGesture); |
|
443 // Since user tried to tap and ended up giving low pan |
|
444 // hence, handle it as tap |
|
445 tapTriggered(); |
440 OstTraceFunctionExit0( DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
446 OstTraceFunctionExit0( DUP2_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
441 return; |
447 return; |
442 } |
448 } |
443 } |
449 } |
444 } |
450 } |
445 } else if(QTapGesture *tapGesture = qobject_cast<QTapGesture *>(event->gesture(Qt::TapGesture))) { |
451 } else if(QTapGesture *tapGesture = qobject_cast<QTapGesture *>(event->gesture(Qt::TapGesture))) { |
446 if (tapGesture && tapGesture->state() == Qt::GestureFinished) { |
452 if (tapGesture && tapGesture->state() == Qt::GestureFinished) { |
447 HbInstantFeedback::play(HbFeedback::Basic); |
453 event->accept(Qt::TapGesture); |
448 // Preview pane tapped |
454 // Handle the tap |
449 // Stop the scrolling first |
455 tapTriggered(); |
450 stopScrolling(); |
456 } |
451 // Issue command to launch agenda view |
457 } else if(QTapAndHoldGesture *tapGesture = qobject_cast<QTapAndHoldGesture *>(event->gesture(Qt::TapAndHoldGesture))) { |
452 mServices.IssueCommandL(ECalenAgendaView); |
458 if (tapGesture && tapGesture->state() == Qt::GestureFinished) { |
453 mView->disconnectAboutToQuitEvent(); |
459 event->accept(Qt::TapAndHoldGesture); |
454 event->accept(Qt::TapGesture); |
460 // Handle the tap |
|
461 tapTriggered(); |
455 } |
462 } |
456 } |
463 } |
457 |
464 |
458 OstTraceFunctionExit0( DUP3_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
465 OstTraceFunctionExit0( DUP3_CALENPREVIEWPANE_GESTUREEVENT_EXIT ); |
|
466 } |
|
467 |
|
468 /*! |
|
469 Handles the tap and launches the agendaview |
|
470 */ |
|
471 void CalenPreviewPane::tapTriggered() |
|
472 { |
|
473 OstTraceFunctionEntry0( CALENPREVIEWPANE_TAPTRIGGERED_ENTRY ); |
|
474 |
|
475 HbInstantFeedback::play(HbFeedback::Basic); |
|
476 // Preview pane tapped |
|
477 // Stop the scrolling first |
|
478 stopScrolling(); |
|
479 // Issue command to launch agenda view |
|
480 mServices.IssueCommandL(ECalenAgendaView); |
|
481 mView->disconnectAboutToQuitEvent(); |
|
482 |
|
483 OstTraceFunctionExit0( CALENPREVIEWPANE_TAPTRIGGERED_EXIT ); |
459 } |
484 } |
460 |
485 |
461 /*! |
486 /*! |
462 Set monthview pointer |
487 Set monthview pointer |
463 */ |
488 */ |