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