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) : base(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 /// This is the value of which source the gesture was started with. (ex : mouse)
113 [EditorBrowsable(EditorBrowsableState.Never)]
114 public enum SourceType
119 [EditorBrowsable(EditorBrowsableState.Never)]
124 [EditorBrowsable(EditorBrowsableState.Never)]
129 [EditorBrowsable(EditorBrowsableState.Never)]
134 /// This is the data of source type
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public enum SourceDataType
142 [EditorBrowsable(EditorBrowsableState.Never)]
145 /// Primary(Left) mouse button.
147 [EditorBrowsable(EditorBrowsableState.Never)]
150 /// Secondary(Right) mouse button.
152 [EditorBrowsable(EditorBrowsableState.Never)]
155 /// Tertiary(Third) mouse button.
157 [EditorBrowsable(EditorBrowsableState.Never)]
162 /// The gesture type.
164 /// <since_tizen> 3 </since_tizen>
165 public Gesture.GestureType Type
174 /// The gesture state.
176 /// <since_tizen> 3 </since_tizen>
177 public Gesture.StateType State
186 /// The time the gesture took place.
188 /// <since_tizen> 3 </since_tizen>
198 /// This is the property of which source type the gesture (read-only).
199 /// If you started the gesture with the mouse, it will tell you what type of mouse it is.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public Gesture.SourceType Source
211 /// This is a property of the source type data (read-only).
212 /// If you started the gesture with the mouse, it will tell you which mouse button you started the gesture with.
214 [EditorBrowsable(EditorBrowsableState.Never)]
215 public Gesture.SourceDataType SourceData
219 return sourceDataType;
223 private Gesture.GestureType type
227 Interop.Gesture.TypeSet(SwigCPtr, (int)value);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.TypeGet(SwigCPtr);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 private Gesture.StateType state
242 Interop.Gesture.StateSet(SwigCPtr, (int)value);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.StateGet(SwigCPtr);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257 Interop.Gesture.TimeSet(SwigCPtr, value);
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 uint ret = Interop.Gesture.TimeGet(SwigCPtr);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 private Gesture.SourceType sourceType
272 Gesture.SourceType ret = (Gesture.SourceType)Interop.Gesture.SourceTypeGet(SwigCPtr);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 private Gesture.SourceDataType sourceDataType
282 Gesture.SourceDataType ret = (Gesture.SourceDataType)Interop.Gesture.SourceDataGet(SwigCPtr);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 internal static Gesture GetGestureFromPtr(global::System.IntPtr cPtr)
290 Gesture ret = new Gesture(cPtr, false);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 /// This will not be public opened.
296 [EditorBrowsable(EditorBrowsableState.Never)]
297 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
299 Interop.Gesture.DeleteGesture(swigCPtr);