Release 4.0.0-preview1-00051
[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         /// Get TapGesture from the pointer.
74         /// </summary>
75         /// <param name="cPtr">The pointer to cast</param>
76         /// <returns>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         /// Number of taps property (read-only).
86         /// </summary>
87         public uint NumberOfTaps
88         {
89             get
90             {
91                 return numberOfTaps;
92             }
93         }
94
95         /// <summary>
96         /// Number of touches property (read-only).
97         /// </summary>
98         public uint NumberOfTouches
99         {
100             get
101             {
102                 return numberOfTouches;
103             }
104         }
105
106         /// <summary>
107         /// Screen point property (read-only).
108         /// </summary>
109         public Vector2 ScreenPoint
110         {
111             get
112             {
113                 return screenPoint;
114             }
115         }
116
117         /// <summary>
118         /// Local point property (read-only).
119         /// </summary>
120         public Vector2 LocalPoint
121         {
122             get
123             {
124                 return localPoint;
125             }
126         }
127
128         /// <summary>
129         /// Creates a TapGesture.
130         /// </summary>
131         public TapGesture() : this(NDalicPINVOKE.new_TapGesture__SWIG_0(), true)
132         {
133             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134         }
135
136
137         private uint numberOfTaps
138         {
139             set
140             {
141                 NDalicPINVOKE.TapGesture_numberOfTaps_set(swigCPtr, value);
142                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143             }
144             get
145             {
146                 uint ret = NDalicPINVOKE.TapGesture_numberOfTaps_get(swigCPtr);
147                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148                 return ret;
149             }
150         }
151
152         private uint numberOfTouches
153         {
154             set
155             {
156                 NDalicPINVOKE.TapGesture_numberOfTouches_set(swigCPtr, value);
157                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158             }
159             get
160             {
161                 uint ret = NDalicPINVOKE.TapGesture_numberOfTouches_get(swigCPtr);
162                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163                 return ret;
164             }
165         }
166
167         private Vector2 screenPoint
168         {
169             set
170             {
171                 NDalicPINVOKE.TapGesture_screenPoint_set(swigCPtr, Vector2.getCPtr(value));
172                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173             }
174             get
175             {
176                 global::System.IntPtr cPtr = NDalicPINVOKE.TapGesture_screenPoint_get(swigCPtr);
177                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
178                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179                 return ret;
180             }
181         }
182
183         private Vector2 localPoint
184         {
185             set
186             {
187                 NDalicPINVOKE.TapGesture_localPoint_set(swigCPtr, Vector2.getCPtr(value));
188                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189             }
190             get
191             {
192                 global::System.IntPtr cPtr = NDalicPINVOKE.TapGesture_localPoint_get(swigCPtr);
193                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
194                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195                 return ret;
196             }
197         }
198
199     }
200
201 }