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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class PanGestureDetector : GestureDetector {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 ~PanGestureDetector() {
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Stage.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_PanGestureDetector(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
70 public class DetectedEventArgs : EventArgs
73 private PanGesture _panGesture;
87 public PanGesture PanGesture
100 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
101 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture);
102 private DaliEventHandler<object,DetectedEventArgs> _panGestureEventHandler;
103 private DetectedCallbackDelegate _panGestureCallbackDelegate;
106 public event DaliEventHandler<object,DetectedEventArgs> Detected
112 // Restricted to only one listener
113 if (_panGestureEventHandler == null)
115 _panGestureEventHandler += value;
117 _panGestureCallbackDelegate = new DetectedCallbackDelegate(OnPanGestureDetected);
118 this.DetectedSignal().Connect(_panGestureCallbackDelegate);
127 if (_panGestureEventHandler != null)
129 this.DetectedSignal().Disconnect(_panGestureCallbackDelegate);
132 _panGestureEventHandler -= value;
137 private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
139 DetectedEventArgs e = new DetectedEventArgs();
141 // Populate all members of "e" (PanGestureEventArgs) with real data
142 e.Actor = Actor.GetActorFromPtr(actor);
143 e.PanGesture = Dali.PanGesture.GetPanGestureFromPtr(panGesture);
145 if (_panGestureEventHandler != null)
147 //here we send all data to user event handlers
148 _panGestureEventHandler(this, e);
154 public static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr) {
155 PanGestureDetector ret = new PanGestureDetector(cPtr, false);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 public class Property : global::System.IDisposable {
162 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
163 protected bool swigCMemOwn;
165 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
166 swigCMemOwn = cMemoryOwn;
167 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
170 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
171 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
178 public virtual void Dispose() {
180 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
183 NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr);
185 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
187 global::System.GC.SuppressFinalize(this);
191 public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true) {
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public static readonly int SCREEN_POSITION = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_POSITION_get();
196 public static readonly int SCREEN_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get();
197 public static readonly int SCREEN_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_VELOCITY_get();
198 public static readonly int LOCAL_POSITION = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_POSITION_get();
199 public static readonly int LOCAL_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get();
200 public static readonly int LOCAL_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_VELOCITY_get();
201 public static readonly int PANNING = NDalicPINVOKE.PanGestureDetector_Property_PANNING_get();
205 public static Radian DIRECTION_LEFT {
207 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_LEFT_get();
208 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public static Radian DIRECTION_RIGHT {
216 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_RIGHT_get();
217 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public static Radian DIRECTION_UP {
225 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_UP_get();
226 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 public static Radian DIRECTION_DOWN {
234 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_DOWN_get();
235 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public static Radian DIRECTION_HORIZONTAL {
243 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_HORIZONTAL_get();
244 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 public static Radian DIRECTION_VERTICAL {
252 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_VERTICAL_get();
253 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 public static Radian DEFAULT_THRESHOLD {
261 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DEFAULT_THRESHOLD_get();
262 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 public PanGestureDetector () : this (NDalicPINVOKE.PanGestureDetector_New(), true) {
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public new static PanGestureDetector DownCast(BaseHandle handle) {
273 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true) {
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public PanGestureDetector Assign(PanGestureDetector rhs) {
283 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 public void SetMinimumTouchesRequired(uint minimum) {
289 NDalicPINVOKE.PanGestureDetector_SetMinimumTouchesRequired(swigCPtr, minimum);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public void SetMaximumTouchesRequired(uint maximum) {
294 NDalicPINVOKE.PanGestureDetector_SetMaximumTouchesRequired(swigCPtr, maximum);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 public uint GetMinimumTouchesRequired() {
299 uint ret = NDalicPINVOKE.PanGestureDetector_GetMinimumTouchesRequired(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public uint GetMaximumTouchesRequired() {
305 uint ret = NDalicPINVOKE.PanGestureDetector_GetMaximumTouchesRequired(swigCPtr);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 public void AddAngle(Radian angle, Radian threshold) {
311 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_0(swigCPtr, Radian.getCPtr(angle), Radian.getCPtr(threshold));
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 public void AddAngle(Radian angle) {
316 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_1(swigCPtr, Radian.getCPtr(angle));
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 public void AddDirection(Radian direction, Radian threshold) {
321 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_0(swigCPtr, Radian.getCPtr(direction), Radian.getCPtr(threshold));
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 public void AddDirection(Radian direction) {
326 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_1(swigCPtr, Radian.getCPtr(direction));
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 public uint GetAngleCount() {
331 uint ret = NDalicPINVOKE.PanGestureDetector_GetAngleCount(swigCPtr);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 public AngleThresholdPair GetAngle(uint index) {
337 AngleThresholdPair ret = new AngleThresholdPair(NDalicPINVOKE.PanGestureDetector_GetAngle(swigCPtr, index), true);
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342 public void ClearAngles() {
343 NDalicPINVOKE.PanGestureDetector_ClearAngles(swigCPtr);
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 public void RemoveAngle(Radian angle) {
348 NDalicPINVOKE.PanGestureDetector_RemoveAngle(swigCPtr, Radian.getCPtr(angle));
349 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 public void RemoveDirection(Radian direction) {
353 NDalicPINVOKE.PanGestureDetector_RemoveDirection(swigCPtr, Radian.getCPtr(direction));
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 public PanGestureDetectedSignal DetectedSignal() {
358 PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 public static void SetPanGestureProperties(PanGesture pan) {
364 NDalicPINVOKE.PanGestureDetector_SetPanGestureProperties(PanGesture.getCPtr(pan));
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 public Vector2 ScreenPosition
372 Vector2 temp = new Vector2(0.0f,0.0f);
373 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.SCREEN_POSITION).Get( temp );
376 } public Vector2 ScreenDisplacement
380 Vector2 temp = new Vector2(0.0f,0.0f);
381 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get( temp );
384 } public Vector2 ScreenVelocity
388 Vector2 temp = new Vector2(0.0f,0.0f);
389 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.SCREEN_VELOCITY).Get( temp );
392 } public Vector2 LocalPosition
396 Vector2 temp = new Vector2(0.0f,0.0f);
397 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.LOCAL_POSITION).Get( temp );
400 } public Vector2 LocalDisplacement
404 Vector2 temp = new Vector2(0.0f,0.0f);
405 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get( temp );
408 } public Vector2 LocalVelocity
412 Vector2 temp = new Vector2(0.0f,0.0f);
413 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.LOCAL_VELOCITY).Get( temp );
416 } public bool Panning
421 Dali.Object.GetProperty( swigCPtr, PanGestureDetector.Property.PANNING).Get( ref temp );