/* * Copyright(c) 2019 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. * */ 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 : Disposable { /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// The Copy constructor. /// /// A reference to the copied handle /// 3 public Gesture(Gesture rhs) : this(Interop.Gesture.new_Gesture(Gesture.getCPtr(rhs)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// /// 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.Gesture_type_set(swigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.Gesture_type_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private Gesture.StateType state { set { Interop.Gesture.Gesture_state_set(swigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.Gesture_state_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private uint time { set { Interop.Gesture.Gesture_time_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { uint ret = Interop.Gesture.Gesture_time_get(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; } /// /// Dispose. /// /// 3 protected override void Dispose(DisposeTypes type) { if (disposed) { return; } //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; Interop.Gesture.delete_Gesture(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } base.Dispose(type); } } }