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