Follow formatting NUI
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / TouchPoint.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using Tizen.NUI.BaseComponents;
18
19 namespace Tizen.NUI
20 {
21     internal class TouchPoint : Disposable
22     {
23
24         internal TouchPoint(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
25         {
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TouchPoint obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
34         {
35             Interop.TouchPoint.delete_TouchPoint(swigCPtr);
36         }
37
38
39         public TouchPoint(int id, TouchPoint.StateType state, float screenX, float screenY) : this(Interop.TouchPoint.new_TouchPoint__SWIG_0(id, (int)state, screenX, screenY), true)
40         {
41             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
42         }
43
44         public TouchPoint(int id, TouchPoint.StateType state, float screenX, float screenY, float localX, float localY) : this(Interop.TouchPoint.new_TouchPoint__SWIG_1(id, (int)state, screenX, screenY, localX, localY), true)
45         {
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47         }
48
49         public int DeviceId
50         {
51             set
52             {
53                 Interop.TouchPoint.TouchPoint_deviceId_set(swigCPtr, value);
54                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
55             }
56             get
57             {
58                 int ret = Interop.TouchPoint.TouchPoint_deviceId_get(swigCPtr);
59                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60                 return ret;
61             }
62         }
63
64         public TouchPoint.StateType State
65         {
66             set
67             {
68                 Interop.TouchPoint.TouchPoint_state_set(swigCPtr, (int)value);
69                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70             }
71             get
72             {
73                 TouchPoint.StateType ret = (TouchPoint.StateType)Interop.TouchPoint.TouchPoint_state_get(swigCPtr);
74                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75                 return ret;
76             }
77         }
78
79         public View HitView
80         {
81             set
82             {
83                 Interop.TouchPoint.TouchPoint_hitActor_set(swigCPtr, View.getCPtr(value));
84                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             }
86             get
87             {
88                 global::System.IntPtr cPtr = Interop.TouchPoint.TouchPoint_hitActor_get(swigCPtr);
89                 View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
90                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91                 return ret;
92             }
93         }
94
95         public Vector2 Local
96         {
97             set
98             {
99                 Interop.TouchPoint.TouchPoint_local_set(swigCPtr, Vector2.getCPtr(value));
100                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101             }
102             get
103             {
104                 global::System.IntPtr cPtr = Interop.TouchPoint.TouchPoint_local_get(swigCPtr);
105                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
106                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107                 return ret;
108             }
109         }
110
111         public Vector2 Screen
112         {
113             set
114             {
115                 Interop.TouchPoint.TouchPoint_screen_set(swigCPtr, Vector2.getCPtr(value));
116                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117             }
118             get
119             {
120                 global::System.IntPtr cPtr = Interop.TouchPoint.TouchPoint_screen_get(swigCPtr);
121                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
122                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123                 return ret;
124             }
125         }
126
127         /// <since_tizen> 3 </since_tizen>
128         public enum StateType
129         {
130             Started,
131             Finished,
132             Down = Started,
133             Up = Finished,
134             Motion,
135             Leave,
136             Stationary,
137             Interrupted,
138             Last
139         }
140     }
141 }