/* * Copyright(c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System.ComponentModel; namespace Tizen.NUI { /// /// Base structure for different gestures that an application can receive.
/// A Gesture is an event that is produced from a combination of several touch events /// in a particular order or within a certain time frame (for example, pinch).
///
/// 3 public class Gesture : BaseHandle { /// /// The Copy constructor. /// /// A reference to the copied handle /// 3 public Gesture(Gesture rhs) : this(Interop.Gesture.NewGesture(Gesture.getCPtr(rhs)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Gesture.Upcast(cPtr), cMemoryOwn) { } /// /// Enumeration for type of gesture. /// /// 3 public enum GestureType { /// /// When two touch points move away or towards each other. /// /// 3 Pinch = 1 << 0, /// /// When the user drags their finger(s) in a particular direction. /// /// 3 Pan = 1 << 1, /// /// When the user taps the screen. /// /// 3 Tap = 1 << 2, /// /// When the user continues to touch the same area on the screen for the device configured time. /// /// 3 LongPress = 1 << 3 } /// /// Enumeration for state of the gesture. /// /// 3 public enum StateType { /// /// There is no state associated with this gesture. /// /// 3 Clear, /// /// The touched points on the screen have moved enough to be considered a gesture. /// /// 3 Started, /// /// The gesture is continuing. /// /// 3 Continuing, /// /// The user has lifted a finger or touched an additional point on the screen. /// /// 3 Finished, /// /// The gesture has been cancelled. /// /// 3 Cancelled, /// /// A gesture is possible. /// /// 3 Possible } /// /// The gesture type. /// /// 3 public Gesture.GestureType Type { get { return type; } } /// /// The gesture state. /// /// 3 public Gesture.StateType State { get { return state; } } /// /// The time the gesture took place. /// /// 3 public uint Time { get { return time; } } private Gesture.GestureType type { set { Interop.Gesture.TypeSet(SwigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.TypeGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private Gesture.StateType state { set { Interop.Gesture.StateSet(SwigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.StateGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private uint time { set { Interop.Gesture.TimeSet(SwigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { uint ret = Interop.Gesture.TimeGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; } internal static Gesture GetGestureFromPtr(global::System.IntPtr cPtr) { Gesture ret = new Gesture(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Gesture.DeleteGesture(swigCPtr); } } }