[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PanGestureDetector.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen.NUI.BaseComponents;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// This class emits a signals when a pan gesture occurs.<br />
26     /// </summary>
27     /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class PanGestureDetector : GestureDetector
30     {
31         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32
33         private DaliEventHandler<object, DetectedEventArgs> _panGestureEventHandler;
34         private DetectedCallbackDelegate _panGestureCallbackDelegate;
35
36         /// <summary>
37         /// Creates an initialized PanGestureDetector.
38         /// </summary>
39         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
40         [EditorBrowsable(EditorBrowsableState.Never)]
41         public PanGestureDetector() : this(Interop.PanGestureDetector.PanGestureDetector_New(), true)
42         {
43             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44
45         }
46
47         /// <summary>
48         /// The copy constructor.
49         /// </summary>
50         /// <param name="handle">A reference to the copied handle</param>
51         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
52         [EditorBrowsable(EditorBrowsableState.Never)]
53         public PanGestureDetector(PanGestureDetector handle) : this(Interop.PanGestureDetector.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true)
54         {
55             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56         }
57
58         internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.PanGestureDetector.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn)
59         {
60             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
61         }
62
63
64         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
65         private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture);
66
67         /// <summary>
68         /// This signal is emitted when the specified pan is detected on the attached view.
69         /// </summary>
70         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         public event DaliEventHandler<object, DetectedEventArgs> Detected
73         {
74             add
75             {
76                 lock (this)
77                 {
78                     // Restricted to only one listener
79                     if (_panGestureEventHandler == null)
80                     {
81                         _panGestureEventHandler += value;
82
83                         _panGestureCallbackDelegate = new DetectedCallbackDelegate(OnPanGestureDetected);
84                         this.DetectedSignal().Connect(_panGestureCallbackDelegate);
85                     }
86                 }
87             }
88
89             remove
90             {
91                 lock (this)
92                 {
93                     if (_panGestureEventHandler != null)
94                     {
95                         this.DetectedSignal().Disconnect(_panGestureCallbackDelegate);
96                     }
97
98                     _panGestureEventHandler -= value;
99                 }
100             }
101         }
102
103         /// <summary>
104         /// For a left pan (-PI Radians).
105         /// </summary>
106         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
107         [EditorBrowsable(EditorBrowsableState.Never)]
108         public static Radian DirectionLeft
109         {
110             get
111             {
112                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_LEFT_get();
113                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
114                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115                 return ret;
116             }
117         }
118
119         /// <summary>
120         /// For a right pan (0 Radians).
121         /// </summary>
122         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
123         [EditorBrowsable(EditorBrowsableState.Never)]
124         public static Radian DirectionRight
125         {
126             get
127             {
128                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_RIGHT_get();
129                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
130                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131                 return ret;
132             }
133         }
134
135         /// <summary>
136         /// For an up pan (-0.5 * PI Radians).
137         /// </summary>
138         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
139         [EditorBrowsable(EditorBrowsableState.Never)]
140         public static Radian DirectionUp
141         {
142             get
143             {
144                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_UP_get();
145                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
146                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147                 return ret;
148             }
149         }
150
151         /// <summary>
152         /// For a down pan (0.5 * PI Radians).
153         /// </summary>
154         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
155         [EditorBrowsable(EditorBrowsableState.Never)]
156         public static Radian DirectionDown
157         {
158             get
159             {
160                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_DOWN_get();
161                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
162                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163                 return ret;
164             }
165         }
166
167         /// <summary>
168         /// For a left and right pan (PI Radians). Useful for AddDirection().
169         /// </summary>
170         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
171         [EditorBrowsable(EditorBrowsableState.Never)]
172         public static Radian DirectionHorizontal
173         {
174             get
175             {
176                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_HORIZONTAL_get();
177                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
178                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179                 return ret;
180             }
181         }
182
183         /// <summary>
184         /// For an up and down pan (-0.5 * PI Radians). Useful for AddDirection().
185         /// </summary>
186         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
187         [EditorBrowsable(EditorBrowsableState.Never)]
188         public static Radian DirectionVertical
189         {
190             get
191             {
192                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DIRECTION_VERTICAL_get();
193                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
194                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195                 return ret;
196             }
197         }
198
199         /// <summary>
200         /// The default threshold is PI * 0.25 radians (or 45 degrees).
201         /// </summary>
202         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
203         [EditorBrowsable(EditorBrowsableState.Never)]
204         public static Radian DefaultThreshold
205         {
206             get
207             {
208                 global::System.IntPtr cPtr = Interop.PanGestureDetector.PanGestureDetector_DEFAULT_THRESHOLD_get();
209                 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
210                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211                 return ret;
212             }
213         }
214
215         /// <summary>
216         /// Retrieves the screen position.
217         /// </summary>
218         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
219         [EditorBrowsable(EditorBrowsableState.Never)]
220         public Vector2 ScreenPosition
221         {
222             get
223             {
224                 Vector2 temp = new Vector2(0.0f, 0.0f);
225                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_POSITION).Get(temp);
226                 return temp;
227             }
228         }
229
230         /// <summary>
231         /// Retrieves the screen displacement.
232         /// </summary>
233         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
234         [EditorBrowsable(EditorBrowsableState.Never)]
235         public Vector2 ScreenDisplacement
236         {
237             get
238             {
239                 Vector2 temp = new Vector2(0.0f, 0.0f);
240                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get(temp);
241                 return temp;
242             }
243         }
244
245         /// <summary>
246         /// Retrieves the screen velocity.
247         /// </summary>
248         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public Vector2 ScreenVelocity
251         {
252             get
253             {
254                 Vector2 temp = new Vector2(0.0f, 0.0f);
255                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_VELOCITY).Get(temp);
256                 return temp;
257             }
258         }
259
260         /// <summary>
261         /// Retrieves the local position.
262         /// </summary>
263         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
264         [EditorBrowsable(EditorBrowsableState.Never)]
265         public Vector2 LocalPosition
266         {
267             get
268             {
269                 Vector2 temp = new Vector2(0.0f, 0.0f);
270                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_POSITION).Get(temp);
271                 return temp;
272             }
273         }
274
275         /// <summary>
276         /// Retrieves the local displacement
277         /// </summary>
278         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
279         [EditorBrowsable(EditorBrowsableState.Never)]
280         public Vector2 LocalDisplacement
281         {
282             get
283             {
284                 Vector2 temp = new Vector2(0.0f, 0.0f);
285                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get(temp);
286                 return temp;
287             }
288         }
289
290         /// <summary>
291         /// Retrieves the local velocity.
292         /// </summary>
293         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
294         [EditorBrowsable(EditorBrowsableState.Never)]
295         public Vector2 LocalVelocity
296         {
297             get
298             {
299                 Vector2 temp = new Vector2(0.0f, 0.0f);
300                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_VELOCITY).Get(temp);
301                 return temp;
302             }
303         }
304
305         /// <summary>
306         /// Retrieves the panning flag.
307         /// </summary>
308         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public bool Panning
311         {
312             get
313             {
314                 bool temp = false;
315                 Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.PANNING).Get(out temp);
316                 return temp;
317             }
318         }
319
320         /// <summary>
321         /// This is the minimum number of touches required for the pan gesture to be detected.
322         /// </summary>
323         /// <param name="minimum">Minimum touches required</param>
324         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
325         [EditorBrowsable(EditorBrowsableState.Never)]
326         public void SetMinimumTouchesRequired(uint minimum)
327         {
328             Interop.PanGestureDetector.PanGestureDetector_SetMinimumTouchesRequired(swigCPtr, minimum);
329             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330         }
331
332         /// <summary>
333         /// This is the maximum number of touches required for the pan gesture to be detected.
334         /// </summary>
335         /// <param name="maximum">Maximum touches required</param>
336         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
337         [EditorBrowsable(EditorBrowsableState.Never)]
338         public void SetMaximumTouchesRequired(uint maximum)
339         {
340             Interop.PanGestureDetector.PanGestureDetector_SetMaximumTouchesRequired(swigCPtr, maximum);
341             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342         }
343
344         /// <summary>
345         /// Retrieves the minimum number of touches required for the pan gesture to be detected.
346         /// </summary>
347         /// <returns>The minimum touches required</returns>
348         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
349         [EditorBrowsable(EditorBrowsableState.Never)]
350         public uint GetMinimumTouchesRequired()
351         {
352             uint ret = Interop.PanGestureDetector.PanGestureDetector_GetMinimumTouchesRequired(swigCPtr);
353             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354             return ret;
355         }
356
357         /// <summary>
358         /// Retrieves the maximum number of touches required for the pan gesture to be detected.
359         /// </summary>
360         /// <returns>The maximum touches required</returns>
361         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
362         [EditorBrowsable(EditorBrowsableState.Never)]
363         public uint GetMaximumTouchesRequired()
364         {
365             uint ret = Interop.PanGestureDetector.PanGestureDetector_GetMaximumTouchesRequired(swigCPtr);
366             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367             return ret;
368         }
369
370         /// <summary>
371         /// The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance.<br />
372         /// If an angle of 0.0 degrees is specified and the threshold is 45 degrees then the acceptable direction range is from -45 to 45 degrees.<br />
373         /// The angle added using this API is only checked when the gesture first starts, after that, this detector will emit the gesture regardless of what angle the pan is moving.
374         /// The user can add as many angles as they require.
375         /// </summary>
376         /// <param name="angle">The angle that pan should be allowed</param>
377         /// <param name="threshold">The threshold around that angle</param>
378         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
379         [EditorBrowsable(EditorBrowsableState.Never)]
380         public void AddAngle(Radian angle, Radian threshold)
381         {
382             Interop.PanGestureDetector.PanGestureDetector_AddAngle__SWIG_0(swigCPtr, Radian.getCPtr(angle), Radian.getCPtr(threshold));
383             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384         }
385
386         /// <summary>
387         /// The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance. The default threshold (PI * 0.25) is used.<br />
388         /// The angle added using this API is only checked when the gesture first starts, after that, this detector will emit the gesture regardless of what angle the pan is moving.<br />
389         /// The user can add as many angles as they require.<br />
390         /// </summary>
391         /// <param name="angle">The angle that pan should be allowed</param>
392         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public void AddAngle(Radian angle)
395         {
396             Interop.PanGestureDetector.PanGestureDetector_AddAngle__SWIG_1(swigCPtr, Radian.getCPtr(angle));
397             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398         }
399
400         /// <summary>
401         /// A helper method for adding bi-directional angles where the pan should take place.<br />
402         /// In other words, if 0 is requested, then PI will also be added so that we have both left and right scrolling.<br />
403         /// </summary>
404         /// <param name="direction">The direction of panning required</param>
405         /// <param name="threshold">The threshold</param>
406         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
407         [EditorBrowsable(EditorBrowsableState.Never)]
408         public void AddDirection(Radian direction, Radian threshold)
409         {
410             Interop.PanGestureDetector.PanGestureDetector_AddDirection__SWIG_0(swigCPtr, Radian.getCPtr(direction), Radian.getCPtr(threshold));
411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412         }
413
414         /// <summary>
415         /// A helper method for adding bi-directional angles where the pan should take place.
416         /// In other words, if 0 is requested, then PI will also be added so that we have both left and right scrolling.<br />
417         /// The default threshold (PI * 0.25) is used.
418         /// </summary>
419         /// <param name="direction">The direction of panning required</param>
420         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
421         [EditorBrowsable(EditorBrowsableState.Never)]
422         public void AddDirection(Radian direction)
423         {
424             Interop.PanGestureDetector.PanGestureDetector_AddDirection__SWIG_1(swigCPtr, Radian.getCPtr(direction));
425             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426         }
427
428         /// <summary>
429         /// Returns the count of angles that this pan gesture detector emits a signal.
430         /// </summary>
431         /// <returns>The gesture detector has been initialized.</returns>
432         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
433         [EditorBrowsable(EditorBrowsableState.Never)]
434         public uint GetAngleCount()
435         {
436             uint ret = Interop.PanGestureDetector.PanGestureDetector_GetAngleCount(swigCPtr);
437             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438             return ret;
439         }
440
441         /// <summary>
442         /// Clears any directional angles that are used by the gesture detector.
443         /// </summary>
444         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
445         [EditorBrowsable(EditorBrowsableState.Never)]
446         public void ClearAngles()
447         {
448             Interop.PanGestureDetector.PanGestureDetector_ClearAngles(swigCPtr);
449             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450         }
451
452         /// <summary>
453         /// Removes the angle specified from the container. This will only remove the first instance of the angle found from the container.
454         /// </summary>
455         /// <param name="angle">The angle to remove</param>
456         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
457         [EditorBrowsable(EditorBrowsableState.Never)]
458         public void RemoveAngle(Radian angle)
459         {
460             Interop.PanGestureDetector.PanGestureDetector_RemoveAngle(swigCPtr, Radian.getCPtr(angle));
461             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462         }
463
464         /// <summary>
465         /// Removes the two angles that make up the direction from the container.
466         /// </summary>
467         /// <param name="direction">The direction to remove</param>
468         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
469         [EditorBrowsable(EditorBrowsableState.Never)]
470         public void RemoveDirection(Radian direction)
471         {
472             Interop.PanGestureDetector.PanGestureDetector_RemoveDirection(swigCPtr, Radian.getCPtr(direction));
473             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474         }
475
476         /// <summary>
477         /// Allows setting of the pan properties that are returned in constraints.
478         /// </summary>
479         /// <param name="pan">The pan gesture to set</param>
480         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
481         [EditorBrowsable(EditorBrowsableState.Never)]
482         public static void SetPanGestureProperties(PanGesture pan)
483         {
484             Interop.PanGestureDetector.PanGestureDetector_SetPanGestureProperties(PanGesture.getCPtr(pan));
485             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486         }
487
488         internal static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr)
489         {
490             PanGestureDetector ret = new PanGestureDetector(cPtr, false);
491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492             return ret;
493         }
494
495         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj)
496         {
497             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
498         }
499
500         internal new static PanGestureDetector DownCast(BaseHandle handle)
501         {
502             PanGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector;
503             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504             return ret;
505         }
506
507         internal AngleThresholdPair GetAngle(uint index)
508         {
509             AngleThresholdPair ret = new AngleThresholdPair(Interop.PanGestureDetector.PanGestureDetector_GetAngle(swigCPtr, index), true);
510             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511             return ret;
512         }
513
514         internal PanGestureDetector Assign(PanGestureDetector rhs)
515         {
516             PanGestureDetector ret = new PanGestureDetector(Interop.PanGestureDetector.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false);
517             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518             return ret;
519         }
520
521         internal PanGestureDetectedSignal DetectedSignal()
522         {
523             PanGestureDetectedSignal ret = new PanGestureDetectedSignal(Interop.PanGestureDetector.PanGestureDetector_DetectedSignal(swigCPtr), false);
524             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525             return ret;
526         }
527
528         /// <summary>
529         /// Dispose.
530         /// </summary>
531         /// <param name="type">The dispose type</param>
532         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
533         [EditorBrowsable(EditorBrowsableState.Never)]
534         protected override void Dispose(DisposeTypes type)
535         {
536             if (disposed)
537             {
538                 return;
539             }
540
541             //Release your own unmanaged resources here.
542             //You should not access any managed member here except static instance.
543             //because the execution order of Finalizes is non-deterministic.
544
545             if (swigCPtr.Handle != global::System.IntPtr.Zero)
546             {
547                 if (swigCMemOwn)
548                 {
549                     swigCMemOwn = false;
550                     Interop.PanGestureDetector.delete_PanGestureDetector(swigCPtr);
551                 }
552                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
553             }
554
555             base.Dispose(type);
556         }
557
558         private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
559         {
560             DetectedEventArgs e = new DetectedEventArgs();
561
562             // Populate all members of "e" (PanGestureEventArgs) with real data
563             e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
564             e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture);
565
566             if (_panGestureEventHandler != null)
567             {
568                 //here we send all data to user event handlers
569                 _panGestureEventHandler(this, e);
570             }
571
572         }
573
574         /// <summary>
575         /// Event arguments that are passed via the PanGestureEvent signal.
576         /// </summary>
577         /// <since_tizen> 5 </since_tizen>
578         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
579         [EditorBrowsable(EditorBrowsableState.Never)]
580         public class DetectedEventArgs : EventArgs
581         {
582             private View _view;
583             private PanGesture _panGesture;
584
585             /// <summary>
586             /// The attached view.
587             /// </summary>
588             /// <since_tizen> 5 </since_tizen>
589             /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
590             [EditorBrowsable(EditorBrowsableState.Never)]
591             public View View
592             {
593                 get
594                 {
595                     return _view;
596                 }
597                 set
598                 {
599                     _view = value;
600                 }
601             }
602
603             /// <summary>
604             /// The PanGesture.
605             /// </summary>
606             /// <since_tizen> 5 </since_tizen>
607             /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
608             [EditorBrowsable(EditorBrowsableState.Never)]
609             public PanGesture PanGesture
610             {
611                 get
612                 {
613                     return _panGesture;
614                 }
615                 set
616                 {
617                     _panGesture = value;
618                 }
619             }
620         }
621
622         internal class Property
623         {
624             internal static readonly int SCREEN_POSITION = Interop.PanGestureDetector.PanGestureDetector_Property_SCREEN_POSITION_get();
625             internal static readonly int SCREEN_DISPLACEMENT = Interop.PanGestureDetector.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get();
626             internal static readonly int SCREEN_VELOCITY = Interop.PanGestureDetector.PanGestureDetector_Property_SCREEN_VELOCITY_get();
627             internal static readonly int LOCAL_POSITION = Interop.PanGestureDetector.PanGestureDetector_Property_LOCAL_POSITION_get();
628             internal static readonly int LOCAL_DISPLACEMENT = Interop.PanGestureDetector.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get();
629             internal static readonly int LOCAL_VELOCITY = Interop.PanGestureDetector.PanGestureDetector_Property_LOCAL_VELOCITY_get();
630             internal static readonly int PANNING = Interop.PanGestureDetector.PanGestureDetector_Property_PANNING_get();
631         }
632     }
633 }