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.
16 /// A pan gesture will end in the following ways:
17 /// - User releases the primary finger (the first touch).
18 /// - User has more fingers on the screen than the maximum specified.
19 /// - User has less fingers on the screen than the minimum specified.
20 /// - Cancelled by the system.
21 /// A pan gesture will continue to be sent to the actor under than initial pan until it ends.
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;
39 DisposeQueue.Instance.Add(this);
42 public override void Dispose()
44 if (!Stage.IsInstalled())
46 DisposeQueue.Instance.Add(this);
52 if (swigCPtr.Handle != global::System.IntPtr.Zero)
57 NDalicPINVOKE.delete_PanGesture(swigCPtr);
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 global::System.GC.SuppressFinalize(this);
67 internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
69 PanGesture ret = new PanGesture(cPtr, false);
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 /// The velocity at which the user is moving their fingers.
76 /// This is represented as a Vector2 and is the pixel movement per millisecond.
77 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.
78 /// A positive y value shows that the user is panning downwards, a negative y values means upwards.
80 public Vector2 Velocity
89 /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
90 /// if the gesture has just started, then the amount panned since the user touched the screen.
91 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.
92 /// A positive y value shows that the user is panning downwards, a negative y value means upwards.
94 public Vector2 Displacement
103 /// This current touch position of the primary touch point in local actor coordinates.
105 public Vector2 Position
114 /// The velocity at which the user is moving their fingers.
115 /// This is represented as a Vector2 and is the pixel movement per millisecond.
116 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.
117 /// A positive y value shows that the user is panning downwards, a negative y values means upwards.
118 /// This value represents the screen coordinates.
120 public Vector2 ScreenVelocity
124 return screenVelocity;
129 /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
130 /// if the gesture has just started, then the amount panned since the user touched the screen.
131 /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.
132 /// A positive y value shows that the user is panning downwards, a negative y value means upwards.
133 /// This value is in screen coordinates.
135 public Vector2 ScreenDisplacement
139 return screenDisplacement;
144 /// This current touch position of the primary touch point in screen coordinates.
146 public Vector2 ScreenPosition
150 return screenPosition;
155 /// The total number of fingers touching the screen in a pan gesture.
157 public uint NumberOfTouches
161 return numberOfTouches;
166 /// Default Constructor.
168 public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true)
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 /// <param name="state">The state of the gesture</param>
177 public PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true)
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 /// Copy constructor.
185 /// <param name="rhs">A reference to the copied handle</param>
186 public PanGesture(PanGesture rhs) : this(NDalicPINVOKE.new_PanGesture__SWIG_2(PanGesture.getCPtr(rhs)), true)
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 /// Assignment operator.
194 /// <param name="rhs">A reference to the copied handle</param>
195 /// <returns>A reference to this</returns>
196 public PanGesture Assign(PanGesture rhs)
198 PanGesture ret = new PanGesture(NDalicPINVOKE.PanGesture_Assign(swigCPtr, PanGesture.getCPtr(rhs)), false);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 private Vector2 velocity
207 NDalicPINVOKE.PanGesture_velocity_set(swigCPtr, Vector2.getCPtr(value));
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_velocity_get(swigCPtr);
213 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 private Vector2 displacement
223 NDalicPINVOKE.PanGesture_displacement_set(swigCPtr, Vector2.getCPtr(value));
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_displacement_get(swigCPtr);
229 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 private Vector2 position
239 NDalicPINVOKE.PanGesture_position_set(swigCPtr, Vector2.getCPtr(value));
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_position_get(swigCPtr);
245 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 private Vector2 screenVelocity
255 NDalicPINVOKE.PanGesture_screenVelocity_set(swigCPtr, Vector2.getCPtr(value));
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenVelocity_get(swigCPtr);
261 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 private Vector2 screenDisplacement
271 NDalicPINVOKE.PanGesture_screenDisplacement_set(swigCPtr, Vector2.getCPtr(value));
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenDisplacement_get(swigCPtr);
277 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 private Vector2 screenPosition
287 NDalicPINVOKE.PanGesture_screenPosition_set(swigCPtr, Vector2.getCPtr(value));
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenPosition_get(swigCPtr);
293 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 private uint numberOfTouches
303 NDalicPINVOKE.PanGesture_numberOfTouches_set(swigCPtr, value);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 uint ret = NDalicPINVOKE.PanGesture_numberOfTouches_get(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 /// Returns the speed at which the user is moving their fingers.
316 /// This is the pixel movement per millisecond.
318 /// <returns>The speed of the pan (in pixels per millisecond)</returns>
319 public float GetSpeed()
321 float ret = NDalicPINVOKE.PanGesture_GetSpeed(swigCPtr);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 /// This returns the distance the user has panned (dragged) since the last pan gesture or,
328 /// if the gesture has just started, then the distance moved since the user touched the screen.
329 /// This is always a positive value.
331 /// <returns>The distance, as a float, a user's finger has panned</returns>
332 public float GetDistance()
334 float ret = NDalicPINVOKE.PanGesture_GetDistance(swigCPtr);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 /// Returns the speed at which the user is moving their fingers relative to screen coordinates.
341 /// This is the pixel movement per millisecond.
343 /// <returns>The speed of the pan (in pixels per millisecond)</returns>
344 public float GetScreenSpeed()
346 float ret = NDalicPINVOKE.PanGesture_GetScreenSpeed(swigCPtr);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 /// This returns the distance the user has panned (dragged) since the last pan gesture in screen
353 /// coordinates or, if the gesture has just started, then the distance in screen coordinates moved
354 /// since the user touched the screen.
355 /// This is always a positive value.
357 /// <returns>The distance, as a float, a user's finger has panned</returns>
358 public float GetScreenDistance()
360 float ret = NDalicPINVOKE.PanGesture_GetScreenDistance(swigCPtr);
361 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();