2 * Copyright(c) 2017 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.
21 /// Base structure for different gestures that an application can receive.<br />
22 /// A Gesture is an event that is produced from a combination of several touch events
23 /// in a particular order or within a certain time frame (for example, pinch).<br />
25 /// <since_tizen> 3 </since_tizen>
26 public class Gesture : Disposable
31 /// <since_tizen> 3 </since_tizen>
32 protected bool swigCMemOwn;
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37 /// The Copy constructor.
39 /// <param name="rhs">A reference to the copied handle</param>
40 /// <since_tizen> 3 </since_tizen>
41 public Gesture(Gesture rhs) : this(Interop.Gesture.new_Gesture(Gesture.getCPtr(rhs)), true)
43 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46 internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn)
48 swigCMemOwn = cMemoryOwn;
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
53 /// Enumeration for type of gesture.
55 /// <since_tizen> 3 </since_tizen>
56 public enum GestureType
59 /// When two touch points move away or towards each other.
61 /// <since_tizen> 3 </since_tizen>
64 /// When the user drags their finger(s) in a particular direction.
66 /// <since_tizen> 3 </since_tizen>
69 /// When the user taps the screen.
71 /// <since_tizen> 3 </since_tizen>
74 /// When the user continues to touch the same area on the screen for the device configured time.
76 /// <since_tizen> 3 </since_tizen>
81 /// Enumeration for state of the gesture.
83 /// <since_tizen> 3 </since_tizen>
87 /// There is no state associated with this gesture.
89 /// <since_tizen> 3 </since_tizen>
92 /// The touched points on the screen have moved enough to be considered a gesture.
94 /// <since_tizen> 3 </since_tizen>
97 /// The gesture is continuing.
99 /// <since_tizen> 3 </since_tizen>
102 /// The user has lifted a finger or touched an additional point on the screen.
104 /// <since_tizen> 3 </since_tizen>
107 /// The gesture has been cancelled.
109 /// <since_tizen> 3 </since_tizen>
112 /// A gesture is possible.
114 /// <since_tizen> 3 </since_tizen>
119 /// The gesture type.
121 /// <since_tizen> 3 </since_tizen>
122 public Gesture.GestureType Type
131 /// The gesture state.
133 /// <since_tizen> 3 </since_tizen>
134 public Gesture.StateType State
143 /// The time the gesture took place.
145 /// <since_tizen> 3 </since_tizen>
154 private Gesture.GestureType type
158 Interop.Gesture.Gesture_type_set(swigCPtr, (int)value);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.Gesture_type_get(swigCPtr);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 private Gesture.StateType state
173 Interop.Gesture.Gesture_state_set(swigCPtr, (int)value);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.Gesture_state_get(swigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 Interop.Gesture.Gesture_time_set(swigCPtr, value);
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 uint ret = Interop.Gesture.Gesture_time_get(swigCPtr);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj)
201 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
207 /// <since_tizen> 3 </since_tizen>
208 protected override void Dispose(DisposeTypes type)
215 //Release your own unmanaged resources here.
216 //You should not access any managed member here except static instance.
217 //because the execution order of Finalizes is non-deterministic.
219 if (swigCPtr.Handle != global::System.IntPtr.Zero)
224 Interop.Gesture.delete_Gesture(swigCPtr);
226 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);