meetingrequest/mrgui/src/cmrlistpane.cpp
branchRCL_3
changeset 34 cd2816114bd1
parent 33 da5135c61bad
child 24 b5fbb9b25d57
equal deleted inserted replaced
33:da5135c61bad 34:cd2816114bd1
    19 #include "mmrscrollbarobserver.h"
    19 #include "mmrscrollbarobserver.h"
    20 #include "esmrdef.h"
    20 #include "esmrdef.h"
    21 #include "cesmrfield.h"
    21 #include "cesmrfield.h"
    22 #include "cmrfieldcontainer.h"
    22 #include "cmrfieldcontainer.h"
    23 #include "cmrlistpanephysics.h"
    23 #include "cmrlistpanephysics.h"
       
    24 #include "nmrlayoutmanager.h"
    24 
    25 
    25 #include <eikscrlb.h>
    26 #include <eikscrlb.h>
    26 #include <aknutils.h>
    27 #include <aknutils.h>
       
    28 #include <touchfeedback.h>
    27 
    29 
    28 //DEBUG
    30 //DEBUG
    29 #include "emailtrace.h"
    31 #include "emailtrace.h"
    30 
    32 
    31 namespace { // codescanner::namespace
    33 namespace { // codescanner::namespace
    52             }
    54             }
    53         }
    55         }
    54 
    56 
    55     return index;
    57     return index;
    56     }
    58     }
    57 
       
    58 }
    59 }
    59 
    60 
    60 //----- MEMBER FUNCTIONS ----
    61 //----- MEMBER FUNCTIONS ----
    61 
    62 
    62 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
   598         	}
   599         	}
   599         }
   600         }
   600     
   601     
   601     if( !iPhysicsActionOngoing )
   602     if( !iPhysicsActionOngoing )
   602     	{    
   603     	{    
   603 		// Offer pointer event to long tap detector
   604 		// Offer pointer event to long tap detector if event occures within fields
   604 		iLongtapDetector->PointerEventL( aPointerEvent );
   605 		if( iFieldContainer->Rect().Contains( aPointerEvent.iPosition ) )
   605 	
   606 			{
       
   607 			iLongtapDetector->PointerEventL( aPointerEvent );
       
   608 			}
       
   609 
   606 		SetFocusAfterPointerEventL( aPointerEvent );
   610 		SetFocusAfterPointerEventL( aPointerEvent );
   607 		
   611 		
   608         // If longtap event has been handled, then do not handle signal event anymore.
   612         // If longtap event has been handled, then do not handle signal event anymore.
   609         if( !iLongTapEventConsumed )
   613         if( !iLongTapEventConsumed )
   610             {
   614             {
   645     {
   649     {
   646     FUNC_LOG;
   650     FUNC_LOG;
   647     DoUpdateScrollBar();
   651     DoUpdateScrollBar();
   648     iPhysicsActionOngoing = EFalse;
   652     iPhysicsActionOngoing = EFalse;
   649     Parent()->DrawDeferred();
   653     Parent()->DrawDeferred();
       
   654     }
       
   655 
       
   656 // ---------------------------------------------------------------------------
       
   657 // CMRListPane::UpdateScrollBarDuringOngoingPhysics
       
   658 // ---------------------------------------------------------------------------
       
   659 //
       
   660 void CMRListPane::UpdateScrollBarDuringOngoingPhysics()
       
   661     {
       
   662     FUNC_LOG;
       
   663     TInt verticalScrollIndex( iPhysics->VerticalScrollIndex() );
       
   664     iScrollModel.SetFocusPosition( verticalScrollIndex );
       
   665 
       
   666 	iScroll.SetModel( &iScrollModel );
       
   667 
       
   668 	// Update the new thumb position to view's
       
   669 	// iScrollBarThumbPosition member.
       
   670 	iScrollBarObserver.ScrollBarPositionChanged( 
       
   671 			iScroll.ThumbPosition() );
       
   672 	
       
   673 	iScroll.DrawDeferred();
       
   674 	
       
   675 	if( FeedbackScrollMarginExceeded( 
       
   676 			Abs( verticalScrollIndex - iPreviousVerticalScrollIndex ) ) )
       
   677 		{
       
   678 		HandleTactileFeedback( ETouchFeedbackSlider );
       
   679 
       
   680 		iPreviousVerticalScrollIndex = verticalScrollIndex;
       
   681 		}
       
   682     }
       
   683 	
       
   684 // ---------------------------------------------------------------------------
       
   685 // CESMRField::HandleTactileFeedback
       
   686 // ---------------------------------------------------------------------------
       
   687 //
       
   688 void CMRListPane::HandleTactileFeedback( 
       
   689 		const TTouchLogicalFeedback& aType )
       
   690 	{
       
   691 	FUNC_LOG;
       
   692 
       
   693 	if( !iTactileFeedback )
       
   694 		{
       
   695 		// Aquire tactile feedback pointer from TLS
       
   696 		iTactileFeedback = MTouchFeedback::Instance();
       
   697 		}
       
   698 	
       
   699 	if ( iTactileFeedback && iTactileFeedback->FeedbackEnabledForThisApp() )
       
   700 		{
       
   701 		iTactileFeedback->InstantFeedback( aType );
       
   702 		}
   650     }
   703     }
   651 
   704 
   652 // ---------------------------------------------------------------------------
   705 // ---------------------------------------------------------------------------
   653 // CMRListPane::SetFocusAfterPointerEventL
   706 // CMRListPane::SetFocusAfterPointerEventL
   654 // ---------------------------------------------------------------------------
   707 // ---------------------------------------------------------------------------
   740             }
   793             }
   741         }
   794         }
   742     return hiddenFocus;
   795     return hiddenFocus;
   743     }
   796     }
   744 
   797 
       
   798 // ---------------------------------------------------------------------------
       
   799 // CMRListPane::FeedbackScrollMarginExceeded
       
   800 // ---------------------------------------------------------------------------
       
   801 //
       
   802 TBool CMRListPane::FeedbackScrollMarginExceeded( TInt aMargin )
       
   803     {
       
   804 	/*
       
   805 	 * This compares given margin to default one row
       
   806 	 * field height, and returns ETrue if margin is exceeded.
       
   807 	 * Otherwise EFalse.
       
   808 	 */
       
   809 	TBool ret( EFalse );
       
   810 	
       
   811 	if( !iDefaultFieldHeight )
       
   812 		{
       
   813 		TAknLayoutRect fieldLayoutRect( 
       
   814 			NMRLayoutManager::GetFieldLayoutRect( 
       
   815 					iFieldContainer->Rect(), 1 ) );
       
   816 		
       
   817 		iDefaultFieldHeight = fieldLayoutRect.Rect().Height();
       
   818 		}
       
   819 
       
   820 	if( aMargin > iDefaultFieldHeight )
       
   821 		{
       
   822 		ret = ETrue;
       
   823 		}
       
   824 	
       
   825     return ret;
       
   826     }
       
   827 
   745 // End of file
   828 // End of file