update devel/master branch to 0.2.32
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / devel-src / Touch.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Tizen.NUI
12 {
13     /// <summary>
14     /// Touch events are a collection of points at a specific moment in time.
15     /// When a multi-touch event occurs, each point represents the points that are currently being
16     /// touched or the points where a touch has stopped.
17     /// </summary>
18     public class Touch : BaseHandle
19     {
20         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21
22         internal Touch(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Touch_SWIGUpcast(cPtr), cMemoryOwn)
23         {
24             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25         }
26
27         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Touch obj)
28         {
29             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30         }
31
32         ~Touch()
33         {
34             DisposeQueue.Instance.Add(this);
35         }
36
37         public override void Dispose()
38         {
39             if (!Stage.IsInstalled())
40             {
41                 DisposeQueue.Instance.Add(this);
42                 return;
43             }
44
45             lock (this)
46             {
47                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
48                 {
49                     if (swigCMemOwn)
50                     {
51                         swigCMemOwn = false;
52                         NDalicPINVOKE.delete_Touch(swigCPtr);
53                     }
54                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
55                 }
56                 global::System.GC.SuppressFinalize(this);
57                 base.Dispose();
58             }
59         }
60
61
62         internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr)
63         {
64             Touch ret = new Touch(cPtr, false);
65             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66             return ret;
67         }
68
69         /// <summary>
70         /// An uninitialized Touch instance.
71         /// Calling member functions with an uninitialized Touch handle is not allowed.
72         /// </summary>
73         public Touch() : this(NDalicPINVOKE.new_Touch__SWIG_0(), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76         }
77
78         internal Touch(Touch other) : this(NDalicPINVOKE.new_Touch__SWIG_1(Touch.getCPtr(other)), true)
79         {
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         internal Touch Assign(Touch other)
84         {
85             Touch ret = new Touch(NDalicPINVOKE.Touch_Assign(swigCPtr, Touch.getCPtr(other)), false);
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87             return ret;
88         }
89
90         /// <summary>
91         /// Returns the time (in ms) that the touch event occurred.
92         /// </summary>
93         /// <returns>The time (in ms) that the touch event occurred</returns>
94         public uint GetTime()
95         {
96             uint ret = NDalicPINVOKE.Touch_GetTime(swigCPtr);
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             return ret;
99         }
100
101         /// <summary>
102         /// Returns the total number of points in this TouchData.
103         /// </summary>
104         /// <returns>Total number of Points</returns>
105         public uint GetPointCount()
106         {
107             uint ret = NDalicPINVOKE.Touch_GetPointCount(swigCPtr);
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109             return ret;
110         }
111
112         /// <summary>
113         /// Returns the ID of the device used for the Point specified.
114         /// Each point has a unique device ID which specifies the device used for that
115         /// point. This is returned by this method.
116         /// If point is greater than GetPointCount() then this method will return -1.
117         /// </summary>
118         /// <param name="point">The point required</param>
119         /// <returns>The Device ID of this point</returns>
120         public int GetDeviceId(uint point)
121         {
122             int ret = NDalicPINVOKE.Touch_GetDeviceId(swigCPtr, point);
123             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124             return ret;
125         }
126
127         /// <summary>
128         /// Retrieves the State of the point specified.
129         /// If point is greater than GetPointCount() then this method will return PointState.Finished.
130         /// </summary>
131         /// <param name="point">The point required</param>
132         /// <returns>The state of the point specified</returns>
133         public PointStateType GetState(uint point)
134         {
135             PointStateType ret = (PointStateType)NDalicPINVOKE.Touch_GetState(swigCPtr, point);
136             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137             return ret;
138         }
139
140         /// <summary>
141         /// Retrieves the actor that was underneath the point specified.
142         /// If point is greater than GetPointCount() then this method will return an empty handle.
143         /// </summary>
144         /// <param name="point">The point required</param>
145         /// <returns>The actor that was underneath the point specified</returns>
146         public Actor GetHitActor(uint point)
147         {
148             Actor ret = new Actor(NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point), true);
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150             return ret;
151         }
152
153         /// <summary>
154         /// Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.
155         /// The top-left of an actor is (0.0, 0.0, 0.5).
156         /// If you require the local coordinates of another actor (e.g the parent of the hit actor),
157         /// then you should use Actor::ScreenToLocal().
158         /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
159         /// </summary>
160         /// <param name="point">The point required</param>
161         /// <returns>The co-ordinates relative to the top-left of the hit-actor of the point specified</returns>
162         public Vector2 GetLocalPosition(uint point)
163         {
164             Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetLocalPosition(swigCPtr, point), false);
165             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166             return ret;
167         }
168
169         /// <summary>
170         /// Retrieves the co-ordinates relative to the top-left of the screen of the point specified.
171         /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
172         /// </summary>
173         /// <param name="point">The point required</param>
174         /// <returns>The co-ordinates relative to the top-left of the screen of the point specified</returns>
175         public Vector2 GetScreenPosition(uint point)
176         {
177             Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetScreenPosition(swigCPtr, point), false);
178             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179             return ret;
180         }
181
182         /// <summary>
183         /// Retrieves the radius of the press point.
184         /// This is the average of both the horizontal and vertical radii of the press point.
185         /// If point is greater than GetPointCount() then this method will return 0.0f.
186         /// </summary>
187         /// <param name="point">The point required</param>
188         /// <returns>The radius of the press point</returns>
189         public float GetRadius(uint point)
190         {
191             float ret = NDalicPINVOKE.Touch_GetRadius(swigCPtr, point);
192             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193             return ret;
194         }
195
196         /// <summary>
197         /// Retrieves BOTH the horizontal and the vertical radii of the press point.
198         /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
199         /// </summary>
200         /// <param name="point">The point required</param>
201         /// <returns>The horizontal and vertical radii of the press point</returns>
202         public Vector2 GetEllipseRadius(uint point)
203         {
204             Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetEllipseRadius(swigCPtr, point), false);
205             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206             return ret;
207         }
208
209         /// <summary>
210         /// Retrieves the touch pressure.
211         /// The pressure range starts at 0.0f.
212         /// Normal pressure is defined as 1.0f.
213         /// A value between 0.0f and 1.0f means light pressure has been applied.
214         /// A value greater than 1.0f means more pressure than normal has been applied.
215         /// If point is greater than GetPointCount() then this method will return 1.0f.
216         /// </summary>
217         /// <param name="point">point The point required</param>
218         /// <returns>The touch pressure</returns>
219         public float GetPressure(uint point)
220         {
221             float ret = NDalicPINVOKE.Touch_GetPressure(swigCPtr, point);
222             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223             return ret;
224         }
225
226         internal Degree GetAngle(uint point)
227         {
228             Degree ret = new Degree(NDalicPINVOKE.Touch_GetAngle(swigCPtr, point), true);
229             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230             return ret;
231         }
232
233     }
234
235     /// <summary>
236     /// Enumeration for point state type.
237     /// </summary>
238     public enum PointStateType
239     {
240         Started,
241         Finished,
242         Down = Started,
243         Up = Finished,
244         Motion,
245         Leave,
246         Stationary,
247         Interrupted
248     }
249
250 }