1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
35 internal class PanGestureDetector : GestureDetector
37 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
39 internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49 protected override void Dispose(DisposeTypes type)
56 if (type == DisposeTypes.Explicit)
59 //Release your own managed resources here.
60 //You should release all of your own disposable objects here.
64 //Release your own unmanaged resources here.
65 //You should not access any managed member here except static instance.
66 //because the execution order of Finalizes is non-deterministic.
68 if (swigCPtr.Handle != global::System.IntPtr.Zero)
73 NDalicPINVOKE.delete_PanGestureDetector(swigCPtr);
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
83 public class DetectedEventArgs : EventArgs
86 private PanGesture _panGesture;
100 public PanGesture PanGesture
113 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
114 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture);
115 private DaliEventHandler<object, DetectedEventArgs> _panGestureEventHandler;
116 private DetectedCallbackDelegate _panGestureCallbackDelegate;
119 public event DaliEventHandler<object, DetectedEventArgs> Detected
125 // Restricted to only one listener
126 if (_panGestureEventHandler == null)
128 _panGestureEventHandler += value;
130 _panGestureCallbackDelegate = new DetectedCallbackDelegate(OnPanGestureDetected);
131 this.DetectedSignal().Connect(_panGestureCallbackDelegate);
140 if (_panGestureEventHandler != null)
142 this.DetectedSignal().Disconnect(_panGestureCallbackDelegate);
145 _panGestureEventHandler -= value;
150 private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
152 DetectedEventArgs e = new DetectedEventArgs();
154 // Populate all members of "e" (PanGestureEventArgs) with real data
155 e.View = View.GetViewFromPtr(actor);
156 e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture);
158 if (_panGestureEventHandler != null)
160 //here we send all data to user event handlers
161 _panGestureEventHandler(this, e);
167 public static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr)
169 PanGestureDetector ret = new PanGestureDetector(cPtr, false);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public class Property : global::System.IDisposable
177 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
178 protected bool swigCMemOwn;
180 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
182 swigCMemOwn = cMemoryOwn;
183 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
186 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
188 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
191 //A Flag to check who called Dispose(). (By User or DisposeQueue)
192 private bool isDisposeQueued = false;
193 //A Flat to check if it is already disposed.
194 protected bool disposed = false;
199 if (!isDisposeQueued)
201 isDisposeQueued = true;
202 DisposeQueue.Instance.Add(this);
206 public void Dispose()
208 //Throw excpetion if Dispose() is called in separate thread.
209 if (!Window.IsInstalled())
211 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
216 Dispose(DisposeTypes.Implicit);
220 Dispose(DisposeTypes.Explicit);
221 System.GC.SuppressFinalize(this);
225 protected virtual void Dispose(DisposeTypes type)
232 if (type == DisposeTypes.Explicit)
235 //Release your own managed resources here.
236 //You should release all of your own disposable objects here.
240 //Release your own unmanaged resources here.
241 //You should not access any managed member here except static instance.
242 //because the execution order of Finalizes is non-deterministic.
244 if (swigCPtr.Handle != global::System.IntPtr.Zero)
249 NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr);
251 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
257 public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true)
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 public static readonly int SCREEN_POSITION = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_POSITION_get();
263 public static readonly int SCREEN_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get();
264 public static readonly int SCREEN_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_VELOCITY_get();
265 public static readonly int LOCAL_POSITION = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_POSITION_get();
266 public static readonly int LOCAL_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get();
267 public static readonly int LOCAL_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_VELOCITY_get();
268 public static readonly int PANNING = NDalicPINVOKE.PanGestureDetector_Property_PANNING_get();
272 public static Radian DIRECTION_LEFT
276 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_LEFT_get();
277 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 public static Radian DIRECTION_RIGHT
287 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_RIGHT_get();
288 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 public static Radian DIRECTION_UP
298 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_UP_get();
299 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 public static Radian DIRECTION_DOWN
309 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_DOWN_get();
310 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 public static Radian DIRECTION_HORIZONTAL
320 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_HORIZONTAL_get();
321 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 public static Radian DIRECTION_VERTICAL
331 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_VERTICAL_get();
332 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 public static Radian DEFAULT_THRESHOLD
342 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DEFAULT_THRESHOLD_get();
343 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 public PanGestureDetector() : this(NDalicPINVOKE.PanGestureDetector_New(), true)
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 public new static PanGestureDetector DownCast(BaseHandle handle)
356 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361 public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true)
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 public PanGestureDetector Assign(PanGestureDetector rhs)
368 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 public void SetMinimumTouchesRequired(uint minimum)
375 NDalicPINVOKE.PanGestureDetector_SetMinimumTouchesRequired(swigCPtr, minimum);
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 public void SetMaximumTouchesRequired(uint maximum)
381 NDalicPINVOKE.PanGestureDetector_SetMaximumTouchesRequired(swigCPtr, maximum);
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 public uint GetMinimumTouchesRequired()
387 uint ret = NDalicPINVOKE.PanGestureDetector_GetMinimumTouchesRequired(swigCPtr);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 public uint GetMaximumTouchesRequired()
394 uint ret = NDalicPINVOKE.PanGestureDetector_GetMaximumTouchesRequired(swigCPtr);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 public void AddAngle(Radian angle, Radian threshold)
401 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_0(swigCPtr, Radian.getCPtr(angle), Radian.getCPtr(threshold));
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 public void AddAngle(Radian angle)
407 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_1(swigCPtr, Radian.getCPtr(angle));
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 public void AddDirection(Radian direction, Radian threshold)
413 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_0(swigCPtr, Radian.getCPtr(direction), Radian.getCPtr(threshold));
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417 public void AddDirection(Radian direction)
419 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_1(swigCPtr, Radian.getCPtr(direction));
420 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
423 public uint GetAngleCount()
425 uint ret = NDalicPINVOKE.PanGestureDetector_GetAngleCount(swigCPtr);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430 internal AngleThresholdPair GetAngle(uint index)
432 AngleThresholdPair ret = new AngleThresholdPair(NDalicPINVOKE.PanGestureDetector_GetAngle(swigCPtr, index), true);
433 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437 public void ClearAngles()
439 NDalicPINVOKE.PanGestureDetector_ClearAngles(swigCPtr);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 public void RemoveAngle(Radian angle)
445 NDalicPINVOKE.PanGestureDetector_RemoveAngle(swigCPtr, Radian.getCPtr(angle));
446 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449 public void RemoveDirection(Radian direction)
451 NDalicPINVOKE.PanGestureDetector_RemoveDirection(swigCPtr, Radian.getCPtr(direction));
452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455 internal PanGestureDetectedSignal DetectedSignal()
457 PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false);
458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462 public static void SetPanGestureProperties(PanGesture pan)
464 NDalicPINVOKE.PanGestureDetector_SetPanGestureProperties(PanGesture.getCPtr(pan));
465 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468 public Vector2 ScreenPosition
472 Vector2 temp = new Vector2(0.0f, 0.0f);
473 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_POSITION).Get(temp);
477 public Vector2 ScreenDisplacement
481 Vector2 temp = new Vector2(0.0f, 0.0f);
482 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get(temp);
486 public Vector2 ScreenVelocity
490 Vector2 temp = new Vector2(0.0f, 0.0f);
491 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_VELOCITY).Get(temp);
495 public Vector2 LocalPosition
499 Vector2 temp = new Vector2(0.0f, 0.0f);
500 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_POSITION).Get(temp);
504 public Vector2 LocalDisplacement
508 Vector2 temp = new Vector2(0.0f, 0.0f);
509 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get(temp);
513 public Vector2 LocalVelocity
517 Vector2 temp = new Vector2(0.0f, 0.0f);
518 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_VELOCITY).Get(temp);
527 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.PANNING).Get(ref temp);