2 * Copyright(c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.ComponentModel;
22 /// Base structure for different gestures that an application can receive.<br />
23 /// A Gesture is an event that is produced from a combination of several touch events
24 /// in a particular order or within a certain time frame (for example, pinch).<br />
26 /// <since_tizen> 3 </since_tizen>
27 public class Gesture : BaseHandle
31 /// The Copy constructor.
33 /// <param name="rhs">A reference to the copied handle</param>
34 /// <since_tizen> 3 </since_tizen>
35 public Gesture(Gesture rhs) : this(Interop.Gesture.new_Gesture(Gesture.getCPtr(rhs)), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40 internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Gesture.Gesture_SWIGUpcast(cPtr), cMemoryOwn)
45 /// Enumeration for type of gesture.
47 /// <since_tizen> 3 </since_tizen>
48 public enum GestureType
51 /// When two touch points move away or towards each other.
53 /// <since_tizen> 3 </since_tizen>
56 /// When the user drags their finger(s) in a particular direction.
58 /// <since_tizen> 3 </since_tizen>
61 /// When the user taps the screen.
63 /// <since_tizen> 3 </since_tizen>
66 /// When the user continues to touch the same area on the screen for the device configured time.
68 /// <since_tizen> 3 </since_tizen>
73 /// Enumeration for state of the gesture.
75 /// <since_tizen> 3 </since_tizen>
79 /// There is no state associated with this gesture.
81 /// <since_tizen> 3 </since_tizen>
84 /// The touched points on the screen have moved enough to be considered a gesture.
86 /// <since_tizen> 3 </since_tizen>
89 /// The gesture is continuing.
91 /// <since_tizen> 3 </since_tizen>
94 /// The user has lifted a finger or touched an additional point on the screen.
96 /// <since_tizen> 3 </since_tizen>
99 /// The gesture has been cancelled.
101 /// <since_tizen> 3 </since_tizen>
104 /// A gesture is possible.
106 /// <since_tizen> 3 </since_tizen>
111 /// The gesture type.
113 /// <since_tizen> 3 </since_tizen>
114 public Gesture.GestureType Type
123 /// The gesture state.
125 /// <since_tizen> 3 </since_tizen>
126 public Gesture.StateType State
135 /// The time the gesture took place.
137 /// <since_tizen> 3 </since_tizen>
146 private Gesture.GestureType type
150 Interop.Gesture.Gesture_type_set(swigCPtr, (int)value);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.Gesture_type_get(swigCPtr);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 private Gesture.StateType state
165 Interop.Gesture.Gesture_state_set(swigCPtr, (int)value);
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.Gesture_state_get(swigCPtr);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 Interop.Gesture.Gesture_time_set(swigCPtr, value);
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 uint ret = Interop.Gesture.Gesture_time_get(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj)
193 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
196 internal static Gesture GetGestureFromPtr(global::System.IntPtr cPtr)
198 Gesture ret = new Gesture(cPtr, false);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 /// This will not be public opened.
204 [EditorBrowsable(EditorBrowsableState.Never)]
205 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
207 Interop.Gesture.delete_Gesture(swigCPtr);