1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
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.
19 public class Hover : global::System.IDisposable
21 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 protected bool swigCMemOwn;
24 internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn)
26 swigCMemOwn = cMemoryOwn;
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Hover obj)
32 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 DisposeQueue.Instance.Add(this);
40 public virtual void Dispose()
42 if (!Stage.IsInstalled())
44 DisposeQueue.Instance.Add(this);
50 if (swigCPtr.Handle != global::System.IntPtr.Zero)
55 NDalicPINVOKE.delete_Hover(swigCPtr);
57 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
59 global::System.GC.SuppressFinalize(this);
64 internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr)
66 Hover ret = new Hover(cPtr, false);
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 /// The time (in ms) that the hover event occurred.
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.
87 /// <param name="point">The point required</param>
88 /// <returns>The Device ID of this poin</returns>
89 public int GetDeviceId(uint point)
91 if (point < points.Count)
93 return points[(int)point].deviceId;
99 /// Retrieves the State of the point specified.
101 /// <param name="point">The point required</param>
102 /// <returns>The state of the point specified</returns>
103 public PointStateType GetState(uint point)
105 if (point < points.Count)
107 return (Tizen.NUI.PointStateType)(points[(int)point].state);
109 return PointStateType.Finished;
113 /// Retrieves the actor that was underneath the point specified.
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)
119 if (point < points.Count)
121 return points[(int)point].hitActor;
125 // Return a native empty handle
126 Actor actor = new Actor();
133 /// Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.
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)
139 if (point < points.Count)
141 return points[(int)point].local;
143 return new Vector2(0.0f, 0.0f);
147 /// Retrieves the co-ordinates relative to the top-left of the screen of the point specified.
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)
153 if (point < points.Count)
155 return points[(int)point].screen;
157 return new Vector2(0.0f, 0.0f);
161 /// Default constructor.
163 public Hover() : this(NDalicPINVOKE.new_Hover__SWIG_0(), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// <param name="time">The time the event occurred</param>
172 public Hover(uint time) : this(NDalicPINVOKE.new_Hover__SWIG_1(time), true)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 private TouchPointContainer points
181 NDalicPINVOKE.Hover_points_set(swigCPtr, TouchPointContainer.getCPtr(value));
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
197 NDalicPINVOKE.Hover_time_set(swigCPtr, value);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 uint ret = NDalicPINVOKE.Hover_time_get(swigCPtr);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 /// Returns the total number of points.
211 /// <returns>Total number of Points</returns>
212 public uint GetPointCount()
214 uint ret = NDalicPINVOKE.Hover_GetPointCount(swigCPtr);
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 internal TouchPoint GetPoint(uint point)
221 TouchPoint ret = new TouchPoint(NDalicPINVOKE.Hover_GetPoint(swigCPtr, point), false);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();