26 #include <AknsDrawUtils.h> |
26 #include <AknsDrawUtils.h> |
27 #include <aknconsts.h> |
27 #include <aknconsts.h> |
28 #include <AknUtils.h> |
28 #include <AknUtils.h> |
29 #include <AknsListBoxBackgroundControlContext.h> |
29 #include <AknsListBoxBackgroundControlContext.h> |
30 #include <gulicon.h> |
30 #include <gulicon.h> |
|
31 #include <aknpointereventsuppressor.h> |
31 #ifdef RD_TACTILE_FEEDBACK |
32 #ifdef RD_TACTILE_FEEDBACK |
32 #include <touchfeedback.h> |
33 #include <touchfeedback.h> |
33 #endif // RD_TACTILE_FEEDBACK |
34 #endif // RD_TACTILE_FEEDBACK |
34 |
35 |
35 // User includes |
36 // User includes |
60 #include "xnscrollablecontroladapter.h" |
61 #include "xnscrollablecontroladapter.h" |
61 #include "xnfocuscontrol.h" |
62 #include "xnfocuscontrol.h" |
62 #include "xneditmode.h" |
63 #include "xneditmode.h" |
63 |
64 |
64 _LIT8(KScrollableBoxNodeName, "scrollablebox"); |
65 _LIT8(KScrollableBoxNodeName, "scrollablebox"); |
|
66 _LIT8( KView, "view" ); |
65 |
67 |
66 // Constants |
68 // Constants |
67 const TInt KSkinGfxInnerRectShrink = 5; |
69 const TInt KSkinGfxInnerRectShrink = 5; |
68 const TInt KFocusGrowValue = 3; |
70 const TInt KFocusGrowValue = 3; |
69 |
71 |
70 const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk |
72 const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk |
71 const TInt KLongTapStartLongDelay( 500000 ); // 0.5s |
73 const TInt KLongTapStartLongDelay( 500000 ); // 0.5s |
72 const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK |
74 const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK |
73 const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s |
75 const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s |
74 |
76 |
75 const TInt KDragThreshold = 20; // pixels |
77 const TInt KDragThreshold = 100; // pixels |
|
78 const TInt KMaxTapMove = 100; //100x100 pixels |
76 |
79 |
77 const TReal KEps( 3e-16 ); // proximite EPS value for double FP numbers |
80 const TReal KEps( 3e-16 ); // proximite EPS value for double FP numbers |
78 |
81 |
79 // LOCAL FUNCTION PROTOTYPES |
82 // LOCAL FUNCTION PROTOTYPES |
80 static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); |
83 static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); |
3881 // Handle pointer events |
3885 // Handle pointer events |
3882 // ----------------------------------------------------------------------------- |
3886 // ----------------------------------------------------------------------------- |
3883 // |
3887 // |
3884 TBool CXnControlAdapterImpl::HandlePointerEventL( |
3888 TBool CXnControlAdapterImpl::HandlePointerEventL( |
3885 const TPointerEvent& aPointerEvent ) |
3889 const TPointerEvent& aPointerEvent ) |
3886 { |
3890 { |
3887 const TPointerEvent& event( aPointerEvent ); |
3891 const TPointerEvent& event( aPointerEvent ); |
3888 |
3892 |
3889 CXnNode* node( &iNode.Node() ); |
3893 CXnNode* node( &iNode.Node() ); |
3890 CXnUiEngine* engine( node->UiEngine() ); |
3894 CXnUiEngine* engine( node->UiEngine() ); |
3891 |
3895 |
3909 if ( !node ) |
3913 if ( !node ) |
3910 { |
3914 { |
3911 // No softkey node found, consume event |
3915 // No softkey node found, consume event |
3912 return ETrue; |
3916 return ETrue; |
3913 } |
3917 } |
|
3918 } |
|
3919 else if ( iSuppressor && |
|
3920 iSuppressor->SuppressPointerEvent( aPointerEvent ) ) |
|
3921 { |
|
3922 // if view does not handle swipe we have to pass event to children |
|
3923 return ( iGestureDestination == node ); |
3914 } |
3924 } |
3915 |
3925 |
3916 CAknLongTapDetector* detector( iAdapter->LongTapDetector() ); |
3926 CAknLongTapDetector* detector( iAdapter->LongTapDetector() ); |
3917 |
3927 |
3918 if ( ( detector && ( !engine->IsPartialInputActive() || |
3928 if ( ( detector && ( !engine->IsPartialInputActive() || |
5302 |
5310 |
5303 if ( CreateGestureHelperL( aNode.Node() ) ) |
5311 if ( CreateGestureHelperL( aNode.Node() ) ) |
5304 { |
5312 { |
5305 iGestureFw = CAknTouchGestureFw::NewL( *this, aAdapter ); |
5313 iGestureFw = CAknTouchGestureFw::NewL( *this, aAdapter ); |
5306 iGestureFw->SetGestureInterestL( EAknTouchGestureFwGroupFlick ); |
5314 iGestureFw->SetGestureInterestL( EAknTouchGestureFwGroupFlick ); |
|
5315 } |
|
5316 |
|
5317 if ( aNode.Type()->Type() == KView ) |
|
5318 { |
|
5319 iSuppressor = CAknPointerEventSuppressor::NewL(); |
|
5320 iSuppressor->SetMaxTapMove( TSize( KMaxTapMove, KMaxTapMove) ); |
|
5321 iSuppressor->SetMaxTapDuration( KLongTapTimeLongDelay ); |
5307 } |
5322 } |
5308 } |
5323 } |
5309 |
5324 |
5310 // ----------------------------------------------------------------------------- |
5325 // ----------------------------------------------------------------------------- |
5311 // CXnControlAdapterImpl::LoadBitmap |
5326 // CXnControlAdapterImpl::LoadBitmap |