[NUI] Fixing the emtpy finalizers(CA1821)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / LongPressGesture.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.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21
22     /// <summary>
23     /// A long press gesture is emitted when the user holds the screen with the stated number of fingers.<br />
24     /// A long press gesture finishes when all touches have been released.<br />
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public class LongPressGesture : Gesture
28     {
29
30         /// <summary>
31         /// The constructor.
32         /// </summary>
33         /// <param name="state">The state of the gesture</param>
34         /// <since_tizen> 3 </since_tizen>
35         public LongPressGesture(Gesture.StateType state) : this(Interop.LongPressGesture.New((int)state), true)
36         {
37             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38         }
39
40         internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.LongPressGesture.Upcast(cPtr), cMemoryOwn)
41         {
42         }
43
44         /// <summary>
45         /// The number of touch points in this long press gesture, i.e., the number of fingers the user had
46         /// on the screen to generate the long press gesture.<br />
47         /// </summary>
48         /// <since_tizen> 3 </since_tizen>
49         public uint NumberOfTouches
50         {
51             get
52             {
53                 return numberOfTouches;
54             }
55         }
56
57         /// <summary>
58         /// This is the point, in screen coordinates, where the long press occurred.<br />
59         /// If a multi-touch long press, then this is the centroid of all the touch points.<br />
60         /// </summary>
61         /// <since_tizen> 3 </since_tizen>
62         public Vector2 ScreenPoint
63         {
64             get
65             {
66                 return screenPoint;
67             }
68         }
69
70         /// <summary>
71         /// This is the point, in local actor coordinates, where the long press occurred.<br />
72         /// If a multi-touch long press, then this is the centroid of all the touch points.<br />
73         /// </summary>
74         /// <since_tizen> 3 </since_tizen>
75         public Vector2 LocalPoint
76         {
77             get
78             {
79                 return localPoint;
80             }
81         }
82
83
84         private uint numberOfTouches
85         {
86             set
87             {
88                 Interop.LongPressGesture.NumberOfTouchesSet(SwigCPtr, value);
89                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90             }
91             get
92             {
93                 uint ret = Interop.LongPressGesture.NumberOfTouchesGet(SwigCPtr);
94                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95                 return ret;
96             }
97         }
98
99         private Vector2 screenPoint
100         {
101             set
102             {
103                 Interop.LongPressGesture.ScreenPointSet(SwigCPtr, Vector2.getCPtr(value));
104                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105             }
106             get
107             {
108                 global::System.IntPtr cPtr = Interop.LongPressGesture.ScreenPointGet(SwigCPtr);
109                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
110                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111                 return ret;
112             }
113         }
114
115         private Vector2 localPoint
116         {
117             set
118             {
119                 Interop.LongPressGesture.LocalPointSet(SwigCPtr, Vector2.getCPtr(value));
120                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121             }
122             get
123             {
124                 global::System.IntPtr cPtr = Interop.LongPressGesture.LocalPointGet(SwigCPtr);
125                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
126                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127                 return ret;
128             }
129         }
130
131         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGesture obj)
132         {
133             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
134         }
135
136         internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr)
137         {
138             LongPressGesture ret = new LongPressGesture(cPtr, false);
139             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140             return ret;
141         }
142
143         /// This will not be public opened.
144         [EditorBrowsable(EditorBrowsableState.Never)]
145         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
146         {
147             Interop.LongPressGesture.DeleteLongPressGesture(swigCPtr);
148         }
149     }
150 }