nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISamples / Tizen.NUI / src / public / Hover.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
14     /// <summary>
15     /// Hover events are a collection of points at a specific moment in time.
16     /// When a multi event occurs, each point represents the points that are currently being
17     /// hovered or the points where a hover has stopped.
18     /// </summary>
19     public class Hover : global::System.IDisposable
20     {
21         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22         protected bool swigCMemOwn;
23
24         internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn)
25         {
26             swigCMemOwn = cMemoryOwn;
27             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28         }
29
30         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Hover obj)
31         {
32             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33         }
34
35         ~Hover()
36         {
37             DisposeQueue.Instance.Add(this);
38         }
39
40         public virtual void Dispose()
41         {
42             if (!Stage.IsInstalled())
43             {
44                 DisposeQueue.Instance.Add(this);
45                 return;
46             }
47
48             lock (this)
49             {
50                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
51                 {
52                     if (swigCMemOwn)
53                     {
54                         swigCMemOwn = false;
55                         NDalicPINVOKE.delete_Hover(swigCPtr);
56                     }
57                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58                 }
59                 global::System.GC.SuppressFinalize(this);
60             }
61         }
62
63
64         internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr)
65         {
66             Hover ret = new Hover(cPtr, false);
67             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
68             return ret;
69         }
70
71         /// <summary>
72         /// The time (in ms) that the hover event occurred.
73         /// </summary>
74         public uint Time
75         {
76             get
77             {
78                 return time;
79             }
80         }
81
82         /// <summary>
83         /// Returns the ID of the device used for the Point specified.
84         /// Each point has a unique device ID which specifies the device used for that
85         /// point. This is returned by this method.
86         /// </summary>
87         /// <param name="point">The point required</param>
88         /// <returns>The Device ID of this poin</returns>
89         public int GetDeviceId(uint point)
90         {
91             if (point < points.Count)
92             {
93                 return points[(int)point].deviceId;
94             }
95             return -1;
96         }
97
98         /// <summary>
99         /// Retrieves the State of the point specified.
100         /// </summary>
101         /// <param name="point">The point required</param>
102         /// <returns>The state of the point specified</returns>
103         public PointStateType GetState(uint point)
104         {
105             if (point < points.Count)
106             {
107                 return (Tizen.NUI.PointStateType)(points[(int)point].state);
108             }
109             return PointStateType.Finished;
110         }
111
112         /// <summary>
113         /// Retrieves the actor that was underneath the point specified.
114         /// </summary>
115         /// <param name="point">The point required</param>
116         /// <returns>The actor that was underneath the point specified</returns>
117         public Actor GetHitActor(uint point)
118         {
119             if (point < points.Count)
120             {
121                 return points[(int)point].hitActor;
122             }
123             else
124             {
125                 // Return a native empty handle
126                 Actor actor = new Actor();
127                 actor.Reset();
128                 return actor;
129             }
130         }
131
132         /// <summary>
133         /// Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.
134         /// </summary>
135         /// <param name="point">The point required</param>
136         /// <returns>The co-ordinates relative to the top-left of the hit-actor of the point specified</returns>
137         public Vector2 GetLocalPosition(uint point)
138         {
139             if (point < points.Count)
140             {
141                 return points[(int)point].local;
142             }
143             return new Vector2(0.0f, 0.0f);
144         }
145
146         /// <summary>
147         /// Retrieves the co-ordinates relative to the top-left of the screen of the point specified.
148         /// </summary>
149         /// <param name="point">The point required</param>
150         /// <returns>The co-ordinates relative to the top-left of the screen of the point specified</returns>
151         public Vector2 GetScreenPosition(uint point)
152         {
153             if (point < points.Count)
154             {
155                 return points[(int)point].screen;
156             }
157             return new Vector2(0.0f, 0.0f);
158         }
159
160         /// <summary>
161         /// Default constructor.
162         /// </summary>
163         public Hover() : this(NDalicPINVOKE.new_Hover__SWIG_0(), true)
164         {
165             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166         }
167
168         /// <summary>
169         /// Constructor.
170         /// </summary>
171         /// <param name="time">The time the event occurred</param>
172         public Hover(uint time) : this(NDalicPINVOKE.new_Hover__SWIG_1(time), true)
173         {
174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175         }
176
177         private TouchPointContainer points
178         {
179             set
180             {
181                 NDalicPINVOKE.Hover_points_set(swigCPtr, TouchPointContainer.getCPtr(value));
182                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183             }
184             get
185             {
186                 global::System.IntPtr cPtr = NDalicPINVOKE.Hover_points_get(swigCPtr);
187                 TouchPointContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new TouchPointContainer(cPtr, false);
188                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189                 return ret;
190             }
191         }
192
193         private uint time
194         {
195             set
196             {
197                 NDalicPINVOKE.Hover_time_set(swigCPtr, value);
198                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199             }
200             get
201             {
202                 uint ret = NDalicPINVOKE.Hover_time_get(swigCPtr);
203                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204                 return ret;
205             }
206         }
207
208         /// <summary>
209         /// Returns the total number of points.
210         /// </summary>
211         /// <returns>Total number of Points</returns>
212         public uint GetPointCount()
213         {
214             uint ret = NDalicPINVOKE.Hover_GetPointCount(swigCPtr);
215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216             return ret;
217         }
218
219         internal TouchPoint GetPoint(uint point)
220         {
221             TouchPoint ret = new TouchPoint(NDalicPINVOKE.Hover_GetPoint(swigCPtr, point), false);
222             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223             return ret;
224         }
225
226     }
227
228 }