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