[NUI] Fix Registry exception for custom view wrapper
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Events / TapGesture.cs
1 /*
2  * Copyright(c) 2020 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 System;
18 using System.ComponentModel;
19
20 namespace Tizen.NUI
21 {
22
23     /// <summary>
24     /// A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public class TapGesture : Gesture
28     {
29
30         /// <summary>
31         /// Creates a TapGesture.
32         /// </summary>
33         /// <since_tizen> 3 </since_tizen>
34         public TapGesture() : this(Interop.TapGesture.New(0), true)
35         {
36             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37         }
38
39         internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
40         {
41         }
42
43         internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
44         {
45         }
46
47         /// <summary>
48         /// The number of taps property (read-only).
49         /// </summary>
50         /// <since_tizen> 3 </since_tizen>
51         public uint NumberOfTaps
52         {
53             get
54             {
55                 return numberOfTaps;
56             }
57         }
58
59         /// <summary>
60         /// The number of touches property (read-only).
61         /// </summary>
62         /// <since_tizen> 3 </since_tizen>
63         public uint NumberOfTouches
64         {
65             get
66             {
67                 return numberOfTouches;
68             }
69         }
70
71         /// <summary>
72         /// The screen point property (read-only).
73         /// </summary>
74         /// <since_tizen> 3 </since_tizen>
75         public Vector2 ScreenPoint
76         {
77             get
78             {
79                 return screenPoint;
80             }
81         }
82
83         /// <summary>
84         /// The local point property (read-only).
85         /// </summary>
86         /// <since_tizen> 3 </since_tizen>
87         public Vector2 LocalPoint
88         {
89             get
90             {
91                 return localPoint;
92             }
93         }
94
95         /// <summary>
96         /// The gesture source type of touches property (read-only).
97         /// If you touch with a mouse button, this will tell you which mouse input you touched.
98         /// Primary(Left), Secondary(Right). Tertiary(Wheel).
99         /// Deprecated. This api will be deleted without notice. Please do not use it.
100         /// </summary>
101         [Obsolete("This property will be deleted without notice. Please do not use it. Use Gesture.SourceData instead.")]
102         [EditorBrowsable(EditorBrowsableState.Never)]
103         public new GestureSourceType SourceType
104         {
105             get
106             {
107                 return (GestureSourceType)SourceData;
108             }
109         }
110
111         private uint numberOfTaps
112         {
113             set
114             {
115                 Interop.TapGesture.NumberOfTapsSet(SwigCPtr, value);
116                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117             }
118             get
119             {
120                 uint ret = Interop.TapGesture.NumberOfTapsGet(SwigCPtr);
121                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122                 return ret;
123             }
124         }
125
126         private uint numberOfTouches
127         {
128             set
129             {
130                 Interop.TapGesture.NumberOfTouchesSet(SwigCPtr, value);
131                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132             }
133             get
134             {
135                 uint ret = Interop.TapGesture.NumberOfTouchesGet(SwigCPtr);
136                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137                 return ret;
138             }
139         }
140
141         private Vector2 screenPoint
142         {
143             set
144             {
145                 Interop.TapGesture.ScreenPointSet(SwigCPtr, Vector2.getCPtr(value));
146                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147             }
148             get
149             {
150                 global::System.IntPtr cPtr = Interop.TapGesture.ScreenPointGet(SwigCPtr);
151                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
152                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153                 return ret;
154             }
155         }
156
157         private Vector2 localPoint
158         {
159             set
160             {
161                 Interop.TapGesture.LocalPointSet(SwigCPtr, Vector2.getCPtr(value));
162                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163             }
164             get
165             {
166                 global::System.IntPtr cPtr = Interop.TapGesture.LocalPointGet(SwigCPtr);
167                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
168                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169                 return ret;
170             }
171         }
172
173         /// <summary>
174         /// Gets the TapGesture from the pointer.
175         /// </summary>
176         /// <param name="cPtr">The pointer to cast.</param>
177         /// <returns>The TapGesture object.</returns>
178         internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr)
179         {
180             TapGesture ret = new TapGesture(cPtr, false);
181             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182             return ret;
183         }
184
185         /// This will not be public opened.
186         [EditorBrowsable(EditorBrowsableState.Never)]
187         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
188         {
189             Interop.TapGesture.DeleteTapGesture(swigCPtr);
190         }
191     }
192
193     /// <summary>
194     /// Gesture source type.
195     /// Deprecated. This value will be deleted without notice. Please do not use it.
196     /// </summary>
197     [Obsolete("This enum will be deleted without notice. Please do not use it.")]
198     [EditorBrowsable(EditorBrowsableState.Never)]
199     public enum GestureSourceType
200     {
201         /// <summary>
202         /// invalid data.
203         /// </summary>
204         [EditorBrowsable(EditorBrowsableState.Never)]
205         Invalid = -1,
206         /// <summary>
207         /// Primary.
208         /// </summary>
209         [EditorBrowsable(EditorBrowsableState.Never)]
210         Primary = 1,
211         /// <summary>
212         /// Secondary.
213         /// </summary>
214         [EditorBrowsable(EditorBrowsableState.Never)]
215         Secondary = 3,
216         /// <summary>
217         /// Third (tertiary)
218         /// </summary>
219         [EditorBrowsable(EditorBrowsableState.Never)]
220         Tertiary = 2,
221     }
222
223 }