fbd61241047681ca843944db05748553873c1f46
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / TapGesture.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Tizen.NUI
18 {
19
20     /// <summary>
21     /// A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
22     /// </summary>
23     public class TapGesture : Gesture
24     {
25         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26
27         internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGesture_SWIGUpcast(cPtr), cMemoryOwn)
28         {
29             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30         }
31
32         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGesture obj)
33         {
34             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35         }
36
37         /// <summary>
38         /// Dispose.
39         /// </summary>
40         protected override void Dispose(DisposeTypes type)
41         {
42             if(disposed)
43             {
44                 return;
45             }
46
47             if(type == DisposeTypes.Explicit)
48             {
49                 //Called by User
50                 //Release your own managed resources here.
51                 //You should release all of your own disposable objects here.
52             }
53
54             //Release your own unmanaged resources here.
55             //You should not access any managed member here except static instance.
56             //because the execution order of Finalizes is non-deterministic.
57
58             if (swigCPtr.Handle != global::System.IntPtr.Zero)
59             {
60                 if (swigCMemOwn)
61                 {
62                     swigCMemOwn = false;
63                     NDalicPINVOKE.delete_TapGesture(swigCPtr);
64                 }
65                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
66             }
67
68             base.Dispose(type);
69         }
70
71
72         /// <summary>
73         /// Gets the TapGesture from the pointer.
74         /// </summary>
75         /// <param name="cPtr">The pointer to cast.</param>
76         /// <returns>The TapGesture object.</returns>
77         internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr)
78         {
79             TapGesture ret = new TapGesture(cPtr, false);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81             return ret;
82         }
83
84         /// <summary>
85         /// The number of taps property (read-only).
86         /// </summary>
87         /// <since_tizen> 3 </since_tizen>
88         public uint NumberOfTaps
89         {
90             get
91             {
92                 return numberOfTaps;
93             }
94         }
95
96         /// <summary>
97         /// The number of touches property (read-only).
98         /// </summary>
99         /// <since_tizen> 3 </since_tizen>
100         public uint NumberOfTouches
101         {
102             get
103             {
104                 return numberOfTouches;
105             }
106         }
107
108         /// <summary>
109         /// The screen point property (read-only).
110         /// </summary>
111         /// <since_tizen> 3 </since_tizen>
112         public Vector2 ScreenPoint
113         {
114             get
115             {
116                 return screenPoint;
117             }
118         }
119
120         /// <summary>
121         /// The local point property (read-only).
122         /// </summary>
123         /// <since_tizen> 3 </since_tizen>
124         public Vector2 LocalPoint
125         {
126             get
127             {
128                 return localPoint;
129             }
130         }
131
132         /// <summary>
133         /// Creates a TapGesture.
134         /// </summary>
135         /// <since_tizen> 3 </since_tizen>
136         public TapGesture() : this(NDalicPINVOKE.new_TapGesture__SWIG_0(), true)
137         {
138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139         }
140
141
142         private uint numberOfTaps
143         {
144             set
145             {
146                 NDalicPINVOKE.TapGesture_numberOfTaps_set(swigCPtr, value);
147                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148             }
149             get
150             {
151                 uint ret = NDalicPINVOKE.TapGesture_numberOfTaps_get(swigCPtr);
152                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153                 return ret;
154             }
155         }
156
157         private uint numberOfTouches
158         {
159             set
160             {
161                 NDalicPINVOKE.TapGesture_numberOfTouches_set(swigCPtr, value);
162                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163             }
164             get
165             {
166                 uint ret = NDalicPINVOKE.TapGesture_numberOfTouches_get(swigCPtr);
167                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168                 return ret;
169             }
170         }
171
172         private Vector2 screenPoint
173         {
174             set
175             {
176                 NDalicPINVOKE.TapGesture_screenPoint_set(swigCPtr, Vector2.getCPtr(value));
177                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178             }
179             get
180             {
181                 global::System.IntPtr cPtr = NDalicPINVOKE.TapGesture_screenPoint_get(swigCPtr);
182                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
183                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184                 return ret;
185             }
186         }
187
188         private Vector2 localPoint
189         {
190             set
191             {
192                 NDalicPINVOKE.TapGesture_localPoint_set(swigCPtr, Vector2.getCPtr(value));
193                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194             }
195             get
196             {
197                 global::System.IntPtr cPtr = NDalicPINVOKE.TapGesture_localPoint_get(swigCPtr);
198                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
199                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200                 return ret;
201             }
202         }
203
204     }
205
206 }