class AknTouchGestureFw::CAknTouchGestureFw : public CBase |
Touch gesture framework provides functionality to convert a stream of pointer events into a logical gesture.
Pointer to a control (CCoeControl deriving object) is provided for the framework and gestures are recognized in the area of the control. Recognized gestures are reported to the gesture observer. The gesture observer should always set the gesture interest in order to receive gesture events.
Each gesture has its own gesture group (type TAknTouchGestureFwGroup). The events that are sent to gesture observer vary according to the gesture group.
CAknTouchGestureFw* gestureFw = CAknTouchGestureFw::NewL( this, gestureControl ); // Set gesture interest (drag and flick gestures) gestureFw->SetGestureInterestL( EAknTouchGestureFwGroupDrag | EAknTouchGestureFwGroupFlick );
gestureFw->SetGestureInterestL( EAknTouchGestureFwNoGroup );
Public Member Functions | |
---|---|
~CAknTouchGestureFw() | |
TInt | Extension_(TUint, TAny *&, TAny *) |
IMPORT_C CAknTouchGestureFw * | NewL(MAknTouchGestureFwObserver &, CCoeControl &) |
IMPORT_C void | SetFeedbackForGroupsL(TUint) |
IMPORT_C void | SetFeedbackForTypesL(TAknTouchGestureFwGroup, TUint, TUint) |
IMPORT_C void | SetGestureInterestL(TUint, TUint) |
Private Member Functions | |
---|---|
CAknTouchGestureFw() | |
void | ConstructL(MAknTouchGestureFwObserver &, CCoeControl &) |
Private Attributes | |
---|---|
CAknTouchGestureFwImpl * | iImpl |
void | ConstructL | ( | MAknTouchGestureFwObserver & | aObserver, |
CCoeControl & | aControl | |||
) | [private] |
Symbian second-phase constructor.
MAknTouchGestureFwObserver & aObserver | Observer of the Gesture framework. |
CCoeControl & aControl | Subscriber control for pointer events. |
TInt | Extension_ | ( | TUint | aExtensionId, |
TAny *& | a0, | |||
TAny * | a1 | |||
) | [virtual] |
Extension function.
IMPORT_C CAknTouchGestureFw * | NewL | ( | MAknTouchGestureFwObserver & | aObserver, |
CCoeControl & | aControl | |||
) | [static] |
Two-phased constructor.
The gesture observer and gesture receiving control need to be provided to CAknTouchGestureFw upon construction. Observer is notified about recognized gestures. Reference to the subscriber control is needed so that gesture framework can monitor the pointer events of the gesture receiving control.
Note that the subscriber control must have a window (either be a window-owning control itself or have a window-owning control as an ancestor). Also the window hiearchy must not be changed for the subscriber control after constructing the gesture framework (e.g. changing the parent of the subscriber control).
If the observer is interested in gestures that need advanced pointer events when recognizing the gestures, advanced pointer events are enabled for the control window. This means that if the device is able to handle more than one pointer at the same time, then events are delivered to control window from all detected pointers.
If the observer is interested in gestures that need pointer drag events when recognizing the gestures, drag events are enabled for the control window.
For those control windows that have advanced pointer or drag events enabled are also enabled pointer grab. This ensures that gestures are recognized also outside the control area (when gesture recognition has begun inside control area).
MAknTouchGestureFwObserver & aObserver | Observer of the Gesture framework. |
CCoeControl & aControl | Subscriber control for pointer events. |
IMPORT_C void | SetFeedbackForGroupsL | ( | TUint | aGestureGroups | ) |
Defines gesture groups, which trigger tactile feedback automatically.
Tactile feedback is triggered according to default behaviour of each group, that means that both vibra and audio feedback are on for each gesture type in defined gesture groups.
Use SetFeedbackForTypesL function for more fine-grained control over the generated feedback.
Notice that any group must have been set as interested gesture group with SetGestureInterestL function before it can trigger tactile feedback at all.
Tactile feedback is off for all gesture groups as default (if this function or SetFeedbackForGroupsL is not called).
TUint aGestureGroups | - Those gesture groups, which trigger tactile feedback automatically as touch gestures are recognized or being in the process of recognizing. |
IMPORT_C void | SetFeedbackForTypesL | ( | TAknTouchGestureFwGroup | aGestureGroup, |
TUint | aGestureTypesForTactile, | |||
TUint | aGestureTypesForAudio | |||
) |
Defines gesture types, which trigger tactile feedback automatically.
This function defines, which gesture types in given gesture group trigger feedback automatically according to default behaviour.
It is possible to define tactile (haptic) and audio feedback behaviour separately, although it is recommended that same bitmasks are used for both of these.
Notice that given gesture group must have been set as interested gesture group with SetGestureInterestL function before it can trigger tactile feedback at all.
SetFeedbackForTypesL( EAknTouchGestureFwGroupTap, EAknTouchGestureFwDoubleTap | EAknTouchGestureFwLongTap, 0 )
TAknTouchGestureFwGroup aGestureGroup | - Gesture group, which tactile- and audio feedback is affected by this function call. |
TUint aGestureTypesForTactile | - Bitmask of gesture types, which trigger tactile feedback automatically. |
TUint aGestureTypesForAudio | - Bitmask of gesture types, which trigger audio feedback automatically. |
IMPORT_C void | SetGestureInterestL | ( | TUint | aGestureGroups, |
TUint | aFlags = 0 | |||
) |
Sets gesture interest. Use binary OR to choose several gesture groups. Default value for the interest is EGestureNoGroup.
This method may modify window attributes and so it should be called before activating the window.
TAknTouchGestureFwGroup
CAknTouchGestureFwImpl * | iImpl | [private] |
Interface implementation. Own.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.