sync with devel/master branch
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / TouchPoint.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     using Tizen.NUI.BaseComponents;
15     internal class TouchPoint : global::System.IDisposable
16     {
17         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18         protected bool swigCMemOwn;
19
20         internal TouchPoint(global::System.IntPtr cPtr, bool cMemoryOwn)
21         {
22             swigCMemOwn = cMemoryOwn;
23             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24         }
25
26         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TouchPoint obj)
27         {
28             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29         }
30
31         //A Flag to check who called Dispose(). (By User or DisposeQueue)
32         private bool isDisposeQueued = false;
33         //A Flat to check if it is already disposed.
34         protected bool disposed = false;
35
36
37         ~TouchPoint()
38         {
39             if (!isDisposeQueued)
40             {
41                 isDisposeQueued = true;
42                 DisposeQueue.Instance.Add(this);
43             }
44         }
45
46         public void Dispose()
47         {
48             //Throw excpetion if Dispose() is called in separate thread.
49             if (!Window.IsInstalled())
50             {
51                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
52             }
53
54             if (isDisposeQueued)
55             {
56                 Dispose(DisposeTypes.Implicit);
57             }
58             else
59             {
60                 Dispose(DisposeTypes.Explicit);
61                 System.GC.SuppressFinalize(this);
62             }
63         }
64
65         protected virtual void Dispose(DisposeTypes type)
66         {
67             if (disposed)
68             {
69                 return;
70             }
71
72             if (type == DisposeTypes.Explicit)
73             {
74                 //Called by User
75                 //Release your own managed resources here.
76                 //You should release all of your own disposable objects here.
77
78             }
79
80             //Release your own unmanaged resources here.
81             //You should not access any managed member here except static instance.
82             //because the execution order of Finalizes is non-deterministic.
83
84             if (swigCPtr.Handle != global::System.IntPtr.Zero)
85             {
86                 if (swigCMemOwn)
87                 {
88                     swigCMemOwn = false;
89                     NDalicPINVOKE.delete_TouchPoint(swigCPtr);
90                 }
91                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
92             }
93
94             disposed = true;
95         }
96
97
98         public TouchPoint(int id, TouchPoint.State state, float screenX, float screenY) : this(NDalicPINVOKE.new_TouchPoint__SWIG_0(id, (int)state, screenX, screenY), true)
99         {
100             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101         }
102
103         public TouchPoint(int id, TouchPoint.State state, float screenX, float screenY, float localX, float localY) : this(NDalicPINVOKE.new_TouchPoint__SWIG_1(id, (int)state, screenX, screenY, localX, localY), true)
104         {
105             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106         }
107
108         public int deviceId
109         {
110             set
111             {
112                 NDalicPINVOKE.TouchPoint_deviceId_set(swigCPtr, value);
113                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114             }
115             get
116             {
117                 int ret = NDalicPINVOKE.TouchPoint_deviceId_get(swigCPtr);
118                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119                 return ret;
120             }
121         }
122
123         public TouchPoint.State state
124         {
125             set
126             {
127                 NDalicPINVOKE.TouchPoint_state_set(swigCPtr, (int)value);
128                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129             }
130             get
131             {
132                 TouchPoint.State ret = (TouchPoint.State)NDalicPINVOKE.TouchPoint_state_get(swigCPtr);
133                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134                 return ret;
135             }
136         }
137
138         public View hitView
139         {
140             set
141             {
142                 NDalicPINVOKE.TouchPoint_hitActor_set(swigCPtr, View.getCPtr(value));
143                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144             }
145             get
146             {
147                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_hitActor_get(swigCPtr);
148                 View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false);
149                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150                 return ret;
151             }
152         }
153
154         public Vector2 local
155         {
156             set
157             {
158                 NDalicPINVOKE.TouchPoint_local_set(swigCPtr, Vector2.getCPtr(value));
159                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160             }
161             get
162             {
163                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_local_get(swigCPtr);
164                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
165                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166                 return ret;
167             }
168         }
169
170         public Vector2 screen
171         {
172             set
173             {
174                 NDalicPINVOKE.TouchPoint_screen_set(swigCPtr, Vector2.getCPtr(value));
175                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176             }
177             get
178             {
179                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_screen_get(swigCPtr);
180                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
181                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182                 return ret;
183             }
184         }
185
186         public enum State
187         {
188             Started,
189             Finished,
190             Down = Started,
191             Up = Finished,
192             Motion,
193             Leave,
194             Stationary,
195             Interrupted,
196             Last
197         }
198
199     }
200
201 }