25 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR |
25 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR |
26 #include <eikmenub.h> // for CEikMenuBar |
26 #include <eikmenub.h> // for CEikMenuBar |
27 #include <StringLoader.h> |
27 #include <StringLoader.h> |
28 #include <akntoolbar.h> |
28 #include <akntoolbar.h> |
29 #include <glxcommandhandleraddtocontainer.h> // For CGlxCommandHandlerAddToContainer |
29 #include <glxcommandhandleraddtocontainer.h> // For CGlxCommandHandlerAddToContainer |
|
30 #include <aknphysics.h> // For Kinetic Scrolling |
30 |
31 |
31 //User includes |
32 //User includes |
32 #include <glxmetadatadialog.rsg> |
33 #include <glxmetadatadialog.rsg> |
33 #include <glxresourceutilities.h> |
34 #include <glxresourceutilities.h> |
34 #include <glxlog.h> |
35 #include <glxlog.h> |
115 CAknDialog::ConstructL( R_METADATA_MENUBAR ); |
116 CAknDialog::ConstructL( R_METADATA_MENUBAR ); |
116 |
117 |
117 // Instantiate the command handler |
118 // Instantiate the command handler |
118 iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this); |
119 iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this); |
119 |
120 |
|
121 //steps to find kinetic scroll threshold value |
|
122 CAknPhysics* physics = CAknPhysics::NewL(*this, NULL); |
|
123 CleanupStack::PushL(physics); |
|
124 iKineticDragThreshold = physics->DragThreshold(); |
|
125 CleanupStack::PopAndDestroy(physics); |
|
126 physics = NULL; |
120 } |
127 } |
121 |
128 |
122 // ----------------------------------------------------------------------------- |
129 // ----------------------------------------------------------------------------- |
123 // ~CGlxMetadataDialog |
130 // ~CGlxMetadataDialog |
124 // ----------------------------------------------------------------------------- |
131 // ----------------------------------------------------------------------------- |
467 //----------------------------------------------------------------------------- |
474 //----------------------------------------------------------------------------- |
468 // |
475 // |
469 void CGlxMetadataDialog::HandlePointerEventL( |
476 void CGlxMetadataDialog::HandlePointerEventL( |
470 const TPointerEvent& aPointerEvent) |
477 const TPointerEvent& aPointerEvent) |
471 { |
478 { |
472 TRACER("CGlxMetadataDialog::HandlePointerEventL"); |
479 |
473 CCoeControl::HandlePointerEventL( aPointerEvent ); |
480 TRACER("CGlxMetadataDialog::HandlePointerEventL"); |
|
481 |
|
482 //This has to be called first, as base class implementation sets the flag |
|
483 // of settings dialog with EDisableMarquee |
|
484 CCoeControl::HandlePointerEventL( aPointerEvent ); |
|
485 |
|
486 //After the above call we can call our implementation to reset the marque |
|
487 // flag and start marqueeing if needed |
|
488 if(aPointerEvent.iType == TPointerEvent::EButton1Down |
|
489 || aPointerEvent.iType == TPointerEvent::EButton2Down |
|
490 || aPointerEvent.iType == TPointerEvent::EButton3Down |
|
491 || aPointerEvent.iType == TPointerEvent::EDrag) |
|
492 { |
|
493 if(aPointerEvent.iType != TPointerEvent::EDrag) |
|
494 { |
|
495 iViewDragged = EFalse; |
|
496 } |
|
497 |
|
498 if(aPointerEvent.iType == TPointerEvent::EDrag) |
|
499 { |
|
500 TInt delta = iPrev.iY - aPointerEvent.iPosition.iY; |
|
501 //Check for physics threshold, if not more than threshold, we can |
|
502 //still continue marqueeing |
|
503 TInt deltaAbs = delta < 0 ? -delta : delta; |
|
504 if(!iViewDragged && deltaAbs >= iKineticDragThreshold) |
|
505 iViewDragged = ETrue; |
|
506 } |
|
507 |
|
508 //This has to done at every above mentioned event, since the |
|
509 //disable marquee flag is set by base implementation, forcing |
|
510 //us the need to reset it everytime. |
|
511 if(!iViewDragged) |
|
512 { |
|
513 iContainer->EnableMarqueingL(); |
|
514 } |
|
515 } |
|
516 |
|
517 //record positions unless it is drag event |
|
518 if(aPointerEvent.iType != TPointerEvent::EDrag) |
|
519 { |
|
520 iPrev = aPointerEvent.iPosition; |
|
521 } |
474 } |
522 } |
475 |
523 |
476 // --------------------------------------------------------------------------- |
524 // --------------------------------------------------------------------------- |
477 // CGlxMetadataDialog::OnLocationEditL |
525 // CGlxMetadataDialog::OnLocationEditL |
478 // --------------------------------------------------------------------------- |
526 // --------------------------------------------------------------------------- |
578 toolbar->HideItemsAndDrawOnlyBackground(!aVisible); |
626 toolbar->HideItemsAndDrawOnlyBackground(!aVisible); |
579 toolbar->SetToolbarVisibility(aVisible); |
627 toolbar->SetToolbarVisibility(aVisible); |
580 toolbar->MakeVisible( aVisible ); |
628 toolbar->MakeVisible( aVisible ); |
581 } |
629 } |
582 } |
630 } |
|
631 |
|
632 void CGlxMetadataDialog::ViewPositionChanged( const TPoint& /*aNewPosition*/, TBool /*aDrawNow*/, TUint /*aFlags*/ ) |
|
633 { |
|
634 //Dummy implementation |
|
635 } |
|
636 |
|
637 void CGlxMetadataDialog::PhysicEmulationEnded() |
|
638 { |
|
639 //Dummy implementation |
|
640 } |
|
641 |
|
642 TPoint CGlxMetadataDialog::ViewPosition() const |
|
643 { |
|
644 //Dummy implementation |
|
645 return TPoint(0,0); |
|
646 } |
583 // End of File |
647 // End of File |