Merge "[Tizen.Pims.Contacts]Fix XML Doc warnings"
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PanGesture.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Tizen.NUI
18 {
19
20     /// <summary>
21     /// A PanGesture is emitted when the user moves one or more fingers in a particular direction.<br>
22     /// A pan gesture will end in the following ways:<br>
23     /// - User releases the primary finger (the first touch).<br>
24     /// - User has more fingers on the screen than the maximum specified.<br>
25     /// - User has less fingers on the screen than the minimum specified.<br>
26     /// - Cancelled by the system.<br>
27     /// A pan gesture will continue to be sent to the actor under than initial pan until it ends.<br>
28     /// </summary>
29     public class PanGesture : Gesture
30     {
31         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32
33         internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGesture_SWIGUpcast(cPtr), cMemoryOwn)
34         {
35             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
36         }
37
38         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj)
39         {
40             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41         }
42
43         protected override void Dispose(DisposeTypes type)
44         {
45             if(disposed)
46             {
47                 return;
48             }
49
50             if(type == DisposeTypes.Explicit)
51             {
52                 //Called by User
53                 //Release your own managed resources here.
54                 //You should release all of your own disposable objects here.
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61             if (swigCPtr.Handle != global::System.IntPtr.Zero)
62             {
63                 if (swigCMemOwn)
64                 {
65                     swigCMemOwn = false;
66                     NDalicPINVOKE.delete_PanGesture(swigCPtr);
67                 }
68                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69             }
70
71             base.Dispose(type);
72         }
73
74
75         internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
76         {
77             PanGesture ret = new PanGesture(cPtr, false);
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79             return ret;
80         }
81
82         /// <summary>
83         /// The velocity at which the user is moving their fingers.<br>
84         /// This is represented as a Vector2 and is the pixel movement per millisecond.<br>
85         /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
86         /// A positive y value shows that the user is panning downwards, a negative y values means upwards.<br>
87         /// </summary>
88         /// <since_tizen> 3 </since_tizen>
89         public Vector2 Velocity
90         {
91             get
92             {
93                 return velocity;
94             }
95         }
96
97         /// <summary>
98         /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
99         /// if the gesture has just started, then the amount panned since the user touched the screen.<br>
100         /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
101         /// A positive y value shows that the user is panning downwards, a negative y value means upwards.<br>
102         /// </summary>
103         /// <since_tizen> 3 </since_tizen>
104         public Vector2 Displacement
105         {
106             get
107             {
108                 return displacement;
109             }
110         }
111
112         /// <summary>
113         /// The current touch position of the primary touch point in local actor coordinates.
114         /// </summary>
115         /// <since_tizen> 3 </since_tizen>
116         public Vector2 Position
117         {
118             get
119             {
120                 return position;
121             }
122         }
123
124         /// <summary>
125         /// The velocity at which the user is moving their fingers.<br>
126         /// This is represented as a Vector2 and is the pixel movement per millisecond.<br>
127         /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
128         /// A positive y value shows that the user is panning downwards, a negative y values means upwards.<br>
129         /// This value represents the screen coordinates.<br>
130         /// </summary>
131         /// <since_tizen> 3 </since_tizen>
132         public Vector2 ScreenVelocity
133         {
134             get
135             {
136                 return screenVelocity;
137             }
138         }
139
140         /// <summary>
141         /// This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
142         /// if the gesture has just started, then the amount panned since the user touched the screen.<br>
143         /// A positive x value shows that the user is panning to the right, a negative x value means the opposite.<br>
144         /// A positive y value shows that the user is panning downwards, a negative y value means upwards.<br>
145         /// This value is in screen coordinates.<br>
146         /// </summary>
147         /// <since_tizen> 3 </since_tizen>
148         public Vector2 ScreenDisplacement
149         {
150             get
151             {
152                 return screenDisplacement;
153             }
154         }
155
156         /// <summary>
157         /// The current touch position of the primary touch point in screen coordinates.
158         /// </summary>
159         /// <since_tizen> 3 </since_tizen>
160         public Vector2 ScreenPosition
161         {
162             get
163             {
164                 return screenPosition;
165             }
166         }
167
168         /// <summary>
169         /// The total number of fingers touching the screen in a pan gesture.
170         /// </summary>
171         /// <since_tizen> 3 </since_tizen>
172         public uint NumberOfTouches
173         {
174             get
175             {
176                 return numberOfTouches;
177             }
178         }
179
180         /// <summary>
181         /// The default constructor.
182         /// </summary>
183         /// <since_tizen> 3 </since_tizen>
184         public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true)
185         {
186             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187         }
188
189         /// <summary>
190         /// The constructor.
191         /// </summary>
192         /// <param name="state">The state of the gesture</param>
193         internal PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true)
194         {
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198
199         private Vector2 velocity
200         {
201             set
202             {
203                 NDalicPINVOKE.PanGesture_velocity_set(swigCPtr, Vector2.getCPtr(value));
204                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205             }
206             get
207             {
208                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_velocity_get(swigCPtr);
209                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
210                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211                 return ret;
212             }
213         }
214
215         private Vector2 displacement
216         {
217             set
218             {
219                 NDalicPINVOKE.PanGesture_displacement_set(swigCPtr, Vector2.getCPtr(value));
220                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221             }
222             get
223             {
224                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_displacement_get(swigCPtr);
225                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
226                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227                 return ret;
228             }
229         }
230
231         private Vector2 position
232         {
233             set
234             {
235                 NDalicPINVOKE.PanGesture_position_set(swigCPtr, Vector2.getCPtr(value));
236                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237             }
238             get
239             {
240                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_position_get(swigCPtr);
241                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
242                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243                 return ret;
244             }
245         }
246
247         private Vector2 screenVelocity
248         {
249             set
250             {
251                 NDalicPINVOKE.PanGesture_screenVelocity_set(swigCPtr, Vector2.getCPtr(value));
252                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253             }
254             get
255             {
256                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenVelocity_get(swigCPtr);
257                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
258                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259                 return ret;
260             }
261         }
262
263         private Vector2 screenDisplacement
264         {
265             set
266             {
267                 NDalicPINVOKE.PanGesture_screenDisplacement_set(swigCPtr, Vector2.getCPtr(value));
268                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269             }
270             get
271             {
272                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenDisplacement_get(swigCPtr);
273                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
274                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275                 return ret;
276             }
277         }
278
279         private Vector2 screenPosition
280         {
281             set
282             {
283                 NDalicPINVOKE.PanGesture_screenPosition_set(swigCPtr, Vector2.getCPtr(value));
284                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285             }
286             get
287             {
288                 global::System.IntPtr cPtr = NDalicPINVOKE.PanGesture_screenPosition_get(swigCPtr);
289                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
290                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291                 return ret;
292             }
293         }
294
295         private uint numberOfTouches
296         {
297             set
298             {
299                 NDalicPINVOKE.PanGesture_numberOfTouches_set(swigCPtr, value);
300                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             }
302             get
303             {
304                 uint ret = NDalicPINVOKE.PanGesture_numberOfTouches_get(swigCPtr);
305                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306                 return ret;
307             }
308         }
309
310         /// <summary>
311         /// Returns the speed at which the user is moving their fingers.<br>
312         /// This is the pixel movement per millisecond.<br>
313         /// </summary>
314         /// <returns>The speed of the pan (in pixels per millisecond).</returns>
315         /// <since_tizen> 3 </since_tizen>
316         public float GetSpeed()
317         {
318             float ret = NDalicPINVOKE.PanGesture_GetSpeed(swigCPtr);
319             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320             return ret;
321         }
322
323         /// <summary>
324         /// Returns the distance the user has panned (dragged) since the last pan gesture or,
325         /// if the gesture has just started, then the distance moved since the user touched the screen.<br>
326         /// This is always a positive value.<br>
327         /// </summary>
328         /// <returns>The distance, as a float, a user's finger has panned.</returns>
329         /// <since_tizen> 3 </since_tizen>
330         public float GetDistance()
331         {
332             float ret = NDalicPINVOKE.PanGesture_GetDistance(swigCPtr);
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334             return ret;
335         }
336
337         /// <summary>
338         /// Returns the speed at which the user is moving their fingers relative to screen coordinates.<br>
339         /// This is the pixel movement per millisecond.<br>
340         /// </summary>
341         /// <returns>The speed of the pan (in pixels per millisecond).</returns>
342         /// <since_tizen> 3 </since_tizen>
343         public float GetScreenSpeed()
344         {
345             float ret = NDalicPINVOKE.PanGesture_GetScreenSpeed(swigCPtr);
346             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347             return ret;
348         }
349
350         /// <summary>
351         /// Returns the distance the user has panned (dragged) since the last pan gesture in screen
352         /// coordinates or, if the gesture has just started, then the distance in screen coordinates moved
353         /// since the user touched the screen.<br>
354         /// This is always a positive value.<br>
355         /// </summary>
356         /// <returns>The distance, as a float, a user's finger has panned.</returns>
357         /// <since_tizen> 3 </since_tizen>
358         public float GetScreenDistance()
359         {
360             float ret = NDalicPINVOKE.PanGesture_GetScreenDistance(swigCPtr);
361             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362             return ret;
363         }
364
365     }
366
367 }