CAknPointerEventSuppressor Class Reference

Link against: avkon.lib


#include <
aknpointereventsuppressor.h>

Detailed Description

Utility class for removing unwanted pointer events, for instance when distinguishing tap events from intended drags.

Usage pattern, where iSuppressor is a CAknPointerEventSuppressor*:

void CMyControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) { if (iSuppressor->SuppressPointerEvent(aPointerEvent)) return;

switch (aPointerEvent.iType) { case TPointerEvent::EButton1Down: iTap = ETrue; break; case TPointerEvent::EButton1Up: if (iTap) HandleTapL(aPointerEvent); break; case TPointerEvent::EDrag: iTap = EFalse; HandleDragL(aPointerEvent); break; default: break; } }

Since:
S60 5.0

Public Member Functions

IMPORT_C ~CAknPointerEventSuppressor ()
 Destructor.
IMPORT_C TBool SuppressPointerEvent (const TPointerEvent &aPointerEvent)
 Tests whether a pointer event should be suppressed.
IMPORT_C void SetMaxTapDuration (TTimeIntervalMicroSeconds aDuration)
 Set the maximum time period that drag events should be ignored during a pointer interaction.
IMPORT_C void SetMaxTapMove (TSize aMoveLimits)
 Set the maximum pointer movement for which drag events should be ignored during a pointer interaction.
IMPORT_C void SetMinInterDragInterval (TTimeIntervalMicroSeconds aInterval)
 Set the minimum time between drag events.

Static Public Member Functions

static IMPORT_C CAknPointerEventSuppressorNewL ()
 Factory function.

Constructor & Destructor Documentation

IMPORT_C CAknPointerEventSuppressor::~CAknPointerEventSuppressor  ) 
 

Destructor.


Member Function Documentation

static IMPORT_C CAknPointerEventSuppressor* CAknPointerEventSuppressor::NewL  )  [static]
 

Factory function.

This creates a pointer event suppressor that will suppress drag events while the pointer interaction may be a tap.

IMPORT_C void CAknPointerEventSuppressor::SetMaxTapDuration TTimeIntervalMicroSeconds  aDuration  ) 
 

Set the maximum time period that drag events should be ignored during a pointer interaction.

Parameters:
aDuration the maximum duration of a tap action.
IMPORT_C void CAknPointerEventSuppressor::SetMaxTapMove TSize  aMoveLimits  ) 
 

Set the maximum pointer movement for which drag events should be ignored during a pointer interaction.

Parameters:
aMoveLimits the pixel movement limits within which a touch action is considered a tap
IMPORT_C void CAknPointerEventSuppressor::SetMinInterDragInterval TTimeIntervalMicroSeconds  aInterval  ) 
 

Set the minimum time between drag events.

This can be used to reduce the frequency of drag event reception when events are not desired at maximum speed.

Parameters:
aInterval the minimum interval between which drag events are wanted
IMPORT_C TBool CAknPointerEventSuppressor::SuppressPointerEvent const TPointerEvent &  aPointerEvent  ) 
 

Tests whether a pointer event should be suppressed.

A control that wants pointer event suppression should feed all pointer events to this function. It will return ETrue if the pointer event should be ignored by the control. Only controls that have unrelated behaviour on tap and drag actions need to use pointer event suppression.

If this class is used to suppress drag events during a possible tap, and this function does not suppress a drag event, the client can be sure that a drag action is happening.

Parameters:
aPointerEvent the pointer event which may need to be suppressed.
Returns:
ETrue if the pointer event should be suppressed, or EFalse if it should be handled.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top