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.NewGesture(Gesture.getCPtr(rhs)), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40 internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
44 internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
49 /// Enumeration for type of gesture.
51 /// <since_tizen> 3 </since_tizen>
52 public enum GestureType
55 /// When two touch points move away or towards each other.
57 /// <since_tizen> 3 </since_tizen>
60 /// When the user drags their finger(s) in a particular direction.
62 /// <since_tizen> 3 </since_tizen>
65 /// When the user taps the screen.
67 /// <since_tizen> 3 </since_tizen>
70 /// When the user continues to touch the same area on the screen for the device configured time.
72 /// <since_tizen> 3 </since_tizen>
77 /// Enumeration for state of the gesture.
79 /// <since_tizen> 3 </since_tizen>
83 /// There is no state associated with this gesture.
85 /// <since_tizen> 3 </since_tizen>
88 /// The touched points on the screen have moved enough to be considered a gesture.
90 /// <since_tizen> 3 </since_tizen>
93 /// The gesture is continuing.
95 /// <since_tizen> 3 </since_tizen>
98 /// The user has lifted a finger or touched an additional point on the screen.
100 /// <since_tizen> 3 </since_tizen>
103 /// The gesture has been cancelled.
105 /// <since_tizen> 3 </since_tizen>
108 /// A gesture is possible.
110 /// <since_tizen> 3 </since_tizen>
115 /// This is the value of which source the gesture was started with. (ex : mouse)
117 [EditorBrowsable(EditorBrowsableState.Never)]
118 public enum SourceType
123 [EditorBrowsable(EditorBrowsableState.Never)]
128 [EditorBrowsable(EditorBrowsableState.Never)]
133 [EditorBrowsable(EditorBrowsableState.Never)]
138 /// This is the data of source type
140 [EditorBrowsable(EditorBrowsableState.Never)]
141 public enum SourceDataType
146 [EditorBrowsable(EditorBrowsableState.Never)]
149 /// Primary(Left) mouse button.
151 [EditorBrowsable(EditorBrowsableState.Never)]
154 /// Secondary(Right) mouse button.
156 [EditorBrowsable(EditorBrowsableState.Never)]
159 /// Tertiary(Third) mouse button.
161 [EditorBrowsable(EditorBrowsableState.Never)]
166 /// The gesture type.
168 /// <since_tizen> 3 </since_tizen>
169 public Gesture.GestureType Type
178 /// The gesture state.
180 /// <since_tizen> 3 </since_tizen>
181 public Gesture.StateType State
190 /// The time the gesture took place.
192 /// <since_tizen> 3 </since_tizen>
202 /// This is the property of which source type the gesture (read-only).
203 /// If you started the gesture with the mouse, it will tell you what type of mouse it is.
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public Gesture.SourceType Source
215 /// This is a property of the source type data (read-only).
216 /// If you started the gesture with the mouse, it will tell you which mouse button you started the gesture with.
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public Gesture.SourceDataType SourceData
223 return sourceDataType;
227 private Gesture.GestureType type
231 Interop.Gesture.TypeSet(SwigCPtr, (int)value);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.TypeGet(SwigCPtr);
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 private Gesture.StateType state
246 Interop.Gesture.StateSet(SwigCPtr, (int)value);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.StateGet(SwigCPtr);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 Interop.Gesture.TimeSet(SwigCPtr, value);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 uint ret = Interop.Gesture.TimeGet(SwigCPtr);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 private Gesture.SourceType sourceType
276 Gesture.SourceType ret = (Gesture.SourceType)Interop.Gesture.SourceTypeGet(SwigCPtr);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 private Gesture.SourceDataType sourceDataType
286 Gesture.SourceDataType ret = (Gesture.SourceDataType)Interop.Gesture.SourceDataGet(SwigCPtr);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 internal static Gesture GetGestureFromPtr(global::System.IntPtr cPtr)
294 Gesture ret = new Gesture(cPtr, false);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 /// This will not be public opened.
300 [EditorBrowsable(EditorBrowsableState.Never)]
301 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
303 Interop.Gesture.DeleteGesture(swigCPtr);