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