1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
15 /// A PanGesture is emitted when the user moves one or more fingers in a particular direction.<br>
16 /// A pan gesture will end in the following ways:<br>
17 /// - User releases the primary finger (the first touch).<br>
18 /// - User has more fingers on the screen than the maximum specified.<br>
19 /// - User has less fingers on the screen than the minimum specified.<br>
20 /// - Cancelled by the system.<br>
21 /// A pan gesture will continue to be sent to the actor under than initial pan until it ends.<br>
23 public class PanGesture : Gesture
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGesture_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 public override void Dispose()
39 if (!Window.IsInstalled())
41 DisposeQueue.Instance.Add(this);
47 if (swigCPtr.Handle != global::System.IntPtr.Zero)
52 NDalicPINVOKE.delete_PanGesture(swigCPtr);
54 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56 global::System.GC.SuppressFinalize(this);
62 internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
64 PanGesture ret = new PanGesture(cPtr, false);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 /// The velocity at which the user is moving their fingers.<br>
71 /// This is represented as a Vector2 and is the pixel movement per millisecond.<br>
72 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
73 /// A positive y value shows that the user is panning downwards, a negative y values means upwards.<br>
75 public Vector2 Velocity
84 /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
85 /// if the gesture has just started, then the amount panned since the user touched the screen.<br>
86 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
87 /// A positive y value shows that the user is panning downwards, a negative y value means upwards.<br>
89 public Vector2 Displacement
98 /// This current touch position of the primary touch point in local actor coordinates.
100 public Vector2 Position
109 /// The velocity at which the user is moving their fingers.<br>
110 /// This is represented as a Vector2 and is the pixel movement per millisecond.<br>
111 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
112 /// A positive y value shows that the user is panning downwards, a negative y values means upwards.<br>
113 /// This value represents the screen coordinates.<br>
115 public Vector2 ScreenVelocity
119 return screenVelocity;
124 /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
125 /// if the gesture has just started, then the amount panned since the user touched the screen.<br>
126 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
127 /// A positive y value shows that the user is panning downwards, a negative y value means upwards.<br>
128 /// This value is in screen coordinates.<br>
130 public Vector2 ScreenDisplacement
134 return screenDisplacement;
139 /// This current touch position of the primary touch point in screen coordinates.
141 public Vector2 ScreenPosition
145 return screenPosition;
150 /// The total number of fingers touching the screen in a pan gesture.
152 public uint NumberOfTouches
156 return numberOfTouches;
161 /// Default Constructor.
163 public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// <param name="state">The state of the gesture</param>
172 public PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 /// Copy constructor.
180 /// <param name="rhs">A reference to the copied handle</param>
181 public PanGesture(PanGesture rhs) : this(NDalicPINVOKE.new_PanGesture__SWIG_2(PanGesture.getCPtr(rhs)), true)
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Assignment operator.
189 /// <param name="rhs">A reference to the copied handle</param>
190 /// <returns>A reference to this</returns>
191 public PanGesture Assign(PanGesture rhs)
193 PanGesture ret = new PanGesture(NDalicPINVOKE.PanGesture_Assign(swigCPtr, PanGesture.getCPtr(rhs)), false);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 private Vector2 velocity
202 NDalicPINVOKE.PanGesture_velocity_set(swigCPtr, Vector2.getCPtr(value));
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_velocity_get(swigCPtr);
208 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 private Vector2 displacement
218 NDalicPINVOKE.PanGesture_displacement_set(swigCPtr, Vector2.getCPtr(value));
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_displacement_get(swigCPtr);
224 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 private Vector2 position
234 NDalicPINVOKE.PanGesture_position_set(swigCPtr, Vector2.getCPtr(value));
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_position_get(swigCPtr);
240 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 private Vector2 screenVelocity
250 NDalicPINVOKE.PanGesture_screenVelocity_set(swigCPtr, Vector2.getCPtr(value));
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenVelocity_get(swigCPtr);
256 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 private Vector2 screenDisplacement
266 NDalicPINVOKE.PanGesture_screenDisplacement_set(swigCPtr, Vector2.getCPtr(value));
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenDisplacement_get(swigCPtr);
272 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 private Vector2 screenPosition
282 NDalicPINVOKE.PanGesture_screenPosition_set(swigCPtr, Vector2.getCPtr(value));
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenPosition_get(swigCPtr);
288 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 private uint numberOfTouches
298 NDalicPINVOKE.PanGesture_numberOfTouches_set(swigCPtr, value);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 uint ret = NDalicPINVOKE.PanGesture_numberOfTouches_get(swigCPtr);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 /// Returns the speed at which the user is moving their fingers.<br>
311 /// This is the pixel movement per millisecond.<br>
313 /// <returns>The speed of the pan (in pixels per millisecond)</returns>
314 public float GetSpeed()
316 float ret = NDalicPINVOKE.PanGesture_GetSpeed(swigCPtr);
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322 /// This returns the distance the user has panned (dragged) since the last pan gesture or,
323 /// if the gesture has just started, then the distance moved since the user touched the screen.<br>
324 /// This is always a positive value.<br>
326 /// <returns>The distance, as a float, a user's finger has panned</returns>
327 public float GetDistance()
329 float ret = NDalicPINVOKE.PanGesture_GetDistance(swigCPtr);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 /// Returns the speed at which the user is moving their fingers relative to screen coordinates.<br>
336 /// This is the pixel movement per millisecond.<br>
338 /// <returns>The speed of the pan (in pixels per millisecond)</returns>
339 public float GetScreenSpeed()
341 float ret = NDalicPINVOKE.PanGesture_GetScreenSpeed(swigCPtr);
342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 /// This returns the distance the user has panned (dragged) since the last pan gesture in screen
348 /// coordinates or, if the gesture has just started, then the distance in screen coordinates moved
349 /// since the user touched the screen.<br>
350 /// This is always a positive value.<br>
352 /// <returns>The distance, as a float, a user's finger has panned</returns>
353 public float GetScreenDistance()
355 float ret = NDalicPINVOKE.PanGesture_GetScreenDistance(swigCPtr);
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();