New directory structure for C#
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / PanGestureDetector.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 public class PanGestureDetector : GestureDetector {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
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);
38   }
39
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;
42   }
43
44   ~PanGestureDetector() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Stage.IsInstalled()) {
50       DisposeQueue.Instance.Add(this);
51       return;
52     }
53
54     lock(this) {
55       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56         if (swigCMemOwn) {
57           swigCMemOwn = false;
58           NDalicPINVOKE.delete_PanGestureDetector(swigCPtr);
59         }
60         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61       }
62       global::System.GC.SuppressFinalize(this);
63       base.Dispose();
64     }
65   }
66
67
68
69
70 public class DetectedEventArgs : EventArgs
71 {
72    private Actor _actor;
73    private PanGesture _panGesture;
74
75    public Actor Actor
76    {
77       get
78       {
79          return _actor;
80       }
81       set
82       {
83          _actor = value;
84       }
85    }
86
87    public PanGesture PanGesture
88    {
89       get
90       {
91          return _panGesture;
92       }
93       set
94       {
95          _panGesture = value;
96       }
97    }
98 }
99
100   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
101   private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture);
102   private DaliEventHandler<object,DetectedEventArgs> _panGestureEventHandler;
103   private DetectedCallbackDelegate _panGestureCallbackDelegate;
104
105
106   public event DaliEventHandler<object,DetectedEventArgs> Detected
107   {
108      add
109      {
110         lock(this)
111         {
112            // Restricted to only one listener
113            if (_panGestureEventHandler == null)
114            {
115               _panGestureEventHandler += value;
116
117               _panGestureCallbackDelegate = new DetectedCallbackDelegate(OnPanGestureDetected);
118               this.DetectedSignal().Connect(_panGestureCallbackDelegate);
119            }
120         }
121      }
122
123      remove
124      {
125         lock(this)
126         {
127            if (_panGestureEventHandler != null)
128            {
129               this.DetectedSignal().Disconnect(_panGestureCallbackDelegate);
130            }
131
132            _panGestureEventHandler -= value;
133         }
134      }
135   }
136
137  private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
138   {
139    DetectedEventArgs e = new DetectedEventArgs();
140
141    // Populate all members of "e" (PanGestureEventArgs) with real data
142    e.Actor = Actor.GetActorFromPtr(actor);
143    e.PanGesture = Dali.PanGesture.GetPanGestureFromPtr(panGesture);
144
145    if (_panGestureEventHandler != null)
146    {
147       //here we send all data to user event handlers
148       _panGestureEventHandler(this, e);
149    }
150
151   }
152
153
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();
157     return ret;
158   }
159
160
161   public class Property : global::System.IDisposable {
162     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
163     protected bool swigCMemOwn;
164   
165     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
166       swigCMemOwn = cMemoryOwn;
167       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
168     }
169   
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;
172     }
173   
174     ~Property() {
175       Dispose();
176     }
177   
178     public virtual void Dispose() {
179       lock(this) {
180         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
181           if (swigCMemOwn) {
182             swigCMemOwn = false;
183             NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr);
184           }
185           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
186         }
187         global::System.GC.SuppressFinalize(this);
188       }
189     }
190   
191     public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true) {
192       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193     }
194   
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();
202   
203   }
204
205   public static Radian DIRECTION_LEFT {
206     get {
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();
210       return ret;
211     } 
212   }
213
214   public static Radian DIRECTION_RIGHT {
215     get {
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();
219       return ret;
220     } 
221   }
222
223   public static Radian DIRECTION_UP {
224     get {
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();
228       return ret;
229     } 
230   }
231
232   public static Radian DIRECTION_DOWN {
233     get {
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();
237       return ret;
238     } 
239   }
240
241   public static Radian DIRECTION_HORIZONTAL {
242     get {
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();
246       return ret;
247     } 
248   }
249
250   public static Radian DIRECTION_VERTICAL {
251     get {
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();
255       return ret;
256     } 
257   }
258
259   public static Radian DEFAULT_THRESHOLD {
260     get {
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();
264       return ret;
265     } 
266   }
267
268   public PanGestureDetector () : this (NDalicPINVOKE.PanGestureDetector_New(), true) {
269       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270
271   }
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();
275     return ret;
276   }
277
278   public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true) {
279     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280   }
281
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();
285     return ret;
286   }
287
288   public void SetMinimumTouchesRequired(uint minimum) {
289     NDalicPINVOKE.PanGestureDetector_SetMinimumTouchesRequired(swigCPtr, minimum);
290     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291   }
292
293   public void SetMaximumTouchesRequired(uint maximum) {
294     NDalicPINVOKE.PanGestureDetector_SetMaximumTouchesRequired(swigCPtr, maximum);
295     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296   }
297
298   public uint GetMinimumTouchesRequired() {
299     uint ret = NDalicPINVOKE.PanGestureDetector_GetMinimumTouchesRequired(swigCPtr);
300     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301     return ret;
302   }
303
304   public uint GetMaximumTouchesRequired() {
305     uint ret = NDalicPINVOKE.PanGestureDetector_GetMaximumTouchesRequired(swigCPtr);
306     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307     return ret;
308   }
309
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();
313   }
314
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();
318   }
319
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();
323   }
324
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();
328   }
329
330   public uint GetAngleCount() {
331     uint ret = NDalicPINVOKE.PanGestureDetector_GetAngleCount(swigCPtr);
332     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333     return ret;
334   }
335
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();
339     return ret;
340   }
341
342   public void ClearAngles() {
343     NDalicPINVOKE.PanGestureDetector_ClearAngles(swigCPtr);
344     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345   }
346
347   public void RemoveAngle(Radian angle) {
348     NDalicPINVOKE.PanGestureDetector_RemoveAngle(swigCPtr, Radian.getCPtr(angle));
349     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350   }
351
352   public void RemoveDirection(Radian direction) {
353     NDalicPINVOKE.PanGestureDetector_RemoveDirection(swigCPtr, Radian.getCPtr(direction));
354     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355   }
356
357   public PanGestureDetectedSignal DetectedSignal() {
358     PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false);
359     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360     return ret;
361   }
362
363   public static void SetPanGestureProperties(PanGesture pan) {
364     NDalicPINVOKE.PanGestureDetector_SetPanGestureProperties(PanGesture.getCPtr(pan));
365     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366   }
367
368   public Vector2 ScreenPosition
369   {
370     get
371     {
372       Vector2 temp = new Vector2(0.0f,0.0f);
373       GetProperty( PanGestureDetector.Property.SCREEN_POSITION).Get(  temp );
374       return temp;
375     }
376 }  public Vector2 ScreenDisplacement
377   {
378     get
379     {
380       Vector2 temp = new Vector2(0.0f,0.0f);
381       GetProperty( PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get(  temp );
382       return temp;
383     }
384 }  public Vector2 ScreenVelocity
385   {
386     get
387     {
388       Vector2 temp = new Vector2(0.0f,0.0f);
389       GetProperty( PanGestureDetector.Property.SCREEN_VELOCITY).Get(  temp );
390       return temp;
391     }
392 }  public Vector2 LocalPosition
393   {
394     get
395     {
396       Vector2 temp = new Vector2(0.0f,0.0f);
397       GetProperty( PanGestureDetector.Property.LOCAL_POSITION).Get(  temp );
398       return temp;
399     }
400 }  public Vector2 LocalDisplacement
401   {
402     get
403     {
404       Vector2 temp = new Vector2(0.0f,0.0f);
405       GetProperty( PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get(  temp );
406       return temp;
407     }
408 }  public Vector2 LocalVelocity
409   {
410     get
411     {
412       Vector2 temp = new Vector2(0.0f,0.0f);
413       GetProperty( PanGestureDetector.Property.LOCAL_VELOCITY).Get(  temp );
414       return temp;
415     }
416 }  public bool Panning
417   {
418     get
419     {
420       bool temp = false;
421       GetProperty( PanGestureDetector.Property.PANNING).Get( ref temp );
422       return temp;
423     }
424 }
425 }
426
427 }