/// The GestureLayer is used to detect gestures.
/// Inherits Widget
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public class GestureLayer : Widget
{
private readonly Interop.Elementary.GestureEventCallback _gestureCallback;
/// Creates and initializes a new instance of GestureLayer class.
/// </summary>
/// <param name="parent">The parent is a given container which will be attached by GestureLayer as a child. It's <see cref="EvasObject"/> type.</param>
+ /// <since_tizen> preview </since_tizen>
public GestureLayer(EvasObject parent) : base(parent)
{
_gestureCallback = new Interop.Elementary.GestureEventCallback(GestureCallbackHandler);
/// <summary>
/// Enumeration for supported gesture types.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public enum GestureType
{
/// <summary>
/// <summary>
/// Enumeration for gesture states.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public enum GestureState
{
/// <summary>
/// <summary>
/// Sets or gets the repeat-events setting.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public bool HoldEvents
{
get
/// <summary>
/// Sets or gets the gesture layer continues enable of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public bool Continues
{
get
/// <summary>
/// Sets or gets the gesture layer finger-size for taps.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public int TapFingerSize
{
get
/// <summary>
/// Sets or gets the gesture layer long tap start timeout of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double LongTapTimeout
{
get
/// <summary>
/// Sets or gets the gesture layer double tap timeout of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double DoubleTapTimeout
{
get
/// <summary>
/// Sets or gets the gesture layer flick time limit (in ms) of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public int FlickTimeLimit
{
get
/// <summary>
/// Sets or gets the gesture layer line min length of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public int MinimumLineLength
{
get
/// <summary>
/// Sets or gets the gesture layer line angular tolerance of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double LineAngularTolerance
{
get
/// <summary>
/// Sets or gets the gesture layer line distance tolerance of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public int LineDistanceTolerance
{
get
/// <summary>
/// Sets or gets step-value for rotate action.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double RotateStep
{
get
/// <summary>
/// Sets or gets the gesture layer rotate angular tolerance of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double RotateAngularTolerance
{
get
/// <summary>
/// Sets or gets control step value for zoom action.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double ZoomStep
{
get
/// <summary>
/// Sets or gets the gesture layer zoom distance tolerance of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public int ZoomDistanceTolerance
{
get
/// <summary>
/// Sets or gets the gesture layer zoom finger factor of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double ZoomFingerFactor
{
get
/// <summary>
/// Sets or gets the gesture layer zoom wheel factor of an object
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double ZoomWheelFactor
{
get
/// A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events.
/// </summary>
/// <param name="target">The object to attach.</param>
+ /// <since_tizen> preview </since_tizen>
public void Attach(EvasObject target)
{
Interop.Elementary.elm_gesture_layer_attach(Handle, target.Handle);
/// <param name="type">The gesture you want to track state of.</param>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetGestureCallback(GestureType type, GestureState state, Action<object> action)
{
lock (_handlers)
/// <summary>
/// clear the gesture state change callback.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public void ClearCallbacks()
{
lock (_handlers)
/// <param name="type">The gesture you want to track state of.</param>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetTapCallback(GestureType type, GestureState state, Action<TapData> action)
{
SetCallback(type, state, action);
/// </summary>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetMomentumCallback(GestureState state, Action<MomentumData> action)
{
SetCallback(GestureType.Momentum, state, action);
/// </summary>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetLineCallback(GestureState state, Action<LineData> action)
{
SetCallback(GestureType.Line, state, action);
/// </summary>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetFlickCallback(GestureState state, Action<LineData> action)
{
SetCallback(GestureType.Flick, state, action);
/// </summary>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetZoomCallback(GestureState state, Action<ZoomData> action)
{
SetCallback(GestureType.Zoom, state, action);
/// </summary>
/// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param>
/// <param name="action">The callback itself.</param>
+ /// <since_tizen> preview </since_tizen>
public void SetRotateCallback(GestureState state, Action<RotateData> action)
{
SetCallback(GestureType.Rotate, state, action);
/// </summary>
/// <param name="parent">The gesture layer's parent widget.</param>
/// <returns></returns>
+ /// <since_tizen> preview </since_tizen>
protected override IntPtr CreateHandle(EvasObject parent)
{
return Interop.Elementary.elm_gesture_layer_add(parent);
/// <summary>
/// clear the gesture state change callback.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
protected override void OnUnrealize()
{
ClearCallbacks();
/// <summary>
/// The struct of TapData
/// </summary>
+ /// <since_tizen> preview </since_tizen>
[StructLayout(LayoutKind.Sequential)]
public struct TapData
{
/// <summary>
/// The x coordinate of the center point.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X;
/// <summary>
/// The y coordinate of the center point.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y;
#pragma warning disable 3003
/// <summary>
/// The number of fingers tapped.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 FingersCount;
/// <summary>
/// The timestamp.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 Timestamp;
#pragma warning restore 3003
/// <summary>
/// The struct of MomentumData
/// </summary>
+ /// <since_tizen> preview </since_tizen>
[StructLayout(LayoutKind.Sequential)]
public struct MomentumData
{
/// <summary>
/// Final-swipe direction starting point on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X1;
/// <summary>
/// Final-swipe direction starting point on Y.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y1;
/// <summary>
/// Final-swipe direction ending point on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X2;
/// <summary>
/// Final-swipe direction ending point on Y
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y2;
#pragma warning disable 3003
/// <summary>
/// Timestamp of start of final x-swipe.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 HorizontalSwipeTimestamp;
/// <summary>
/// Timestamp of start of final y-swipe.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 VerticalSwipeTimestamp;
/// <summary>
/// Momentum on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 HorizontalMomentum;
/// <summary>
/// Momentum on Y.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 VerticalMomentum;
/// <summary>
/// Number of fingers.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 FingersCount;
#pragma warning restore 3003
/// <summary>
/// The struct of LineData
/// </summary>
+ /// <since_tizen> preview </since_tizen>
[StructLayout(LayoutKind.Sequential)]
public struct LineData
{
/// <summary>
/// Final-swipe direction starting point on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X1;
/// <summary>
/// Final-swipe direction starting point on Y.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y1;
/// <summary>
/// Final-swipe direction ending point on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X2;
/// <summary>
/// Final-swipe direction ending point on Y
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y2;
#pragma warning disable 3003
/// <summary>
/// Timestamp of start of final x-swipe.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 HorizontalSwipeTimestamp;
/// <summary>
/// Timestamp of start of final y-swipe.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 VerticalSwipeTimestamp;
/// <summary>
/// Momentum on X.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 HorizontalMomentum;
/// <summary>
/// Momentum on Y.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 VerticalMomentum;
/// <summary>
/// Number of fingers.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public UInt32 FingersCount;
#pragma warning restore 3003
/// <summary>
/// Angle (direction) of lines.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double Angle;
}
/// <summary>
/// The struct of ZoomData
/// </summary>
+ /// <since_tizen> preview </since_tizen>
[StructLayout(LayoutKind.Sequential)]
public struct ZoomData
{
/// <summary>
/// The x coordinate of zoom center point reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X;
/// <summary>
/// The y coordinate of zoom center point reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y;
/// <summary>
/// The radius (distance) between fingers reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Radius;
/// <summary>
/// The zoom value. 1.0 means no zoom.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double Zoom;
/// <summary>
/// <summary>
/// The struct of RotateData
/// </summary>
+ /// <since_tizen> preview </since_tizen>
[StructLayout(LayoutKind.Sequential)]
public struct RotateData
{
/// <summary>
/// The x coordinate of rotation center point reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 X;
/// <summary>
/// The y coordinate of rotation center point reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Y;
/// <summary>
/// The radius (distance) between fingers reported to user.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public Int32 Radius;
/// <summary>
/// The start-angle.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double BaseAngle;
/// <summary>
/// The rotation value. 0.0 means no rotation.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public double Angle;
/// <summary>
/// <summary>
/// Config is a static class, it provides gestureLayer's timeout information.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public static class Config
{
/// <summary>
/// Sets or gets the duration for occurring long tap event of gesture layer.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public static double DefaultLongTapTimeout
{
get
/// <summary>
/// Sets or gets the duration for occurring double tap event of gesture layer.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
public static double DefaultDoubleTapTimeout
{
get