[NUI] Fix build warning[CA1064]
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / PinchGesture.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 PinchGesture is emitted when the user moves two fingers towards or away from each other.<br />
24     /// A pinch gesture will continue to be sent to the actor under the center point of the pinch until the pinch ends.<br />
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public class PinchGesture : Gesture
28     {
29
30         internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.PinchGesture.Upcast(cPtr), cMemoryOwn)
31         {
32         }
33
34         /// <summary>
35         /// The scale factor from the start of the pinch gesture till the latest pinch gesture.<br />
36         /// If the user is moving their fingers away from each other, then
37         /// this value increases. Conversely, if the user is moving their
38         /// fingers towards each other, this value will decrease.<br />
39         /// </summary>
40         /// <since_tizen> 3 </since_tizen>
41         public float Scale
42         {
43             get
44             {
45                 return scale;
46             }
47         }
48
49         /// <summary>
50         /// The speed at which the user is moving their fingers.<br />
51         /// This is the pixel movement per second.<br />
52         /// </summary>
53         /// <since_tizen> 3 </since_tizen>
54         public float Speed
55         {
56             get
57             {
58                 return speed;
59             }
60         }
61
62         /// <summary>
63         /// The center point of the two points that caused the pinch gesture in screen coordinates.
64         /// </summary>
65         /// <since_tizen> 3 </since_tizen>
66         public Vector2 ScreenCenterPoint
67         {
68             get
69             {
70                 return screenCenterPoint;
71             }
72         }
73
74         /// <summary>
75         /// The center point of the two points that caused the pinch gesture in local actor coordinates.
76         /// </summary>
77         /// <since_tizen> 3 </since_tizen>
78         public Vector2 LocalCenterPoint
79         {
80             get
81             {
82                 return localCenterPoint;
83             }
84         }
85
86         /// <summary>
87         /// The default constructor.
88         /// </summary>
89         /// <param name="state">The state of the gesture.</param>
90         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
91         [EditorBrowsable(EditorBrowsableState.Never)]
92         public PinchGesture(Gesture.StateType state) : this(Interop.PinchGesture.New((int)state), true)
93         {
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95         }
96
97         private float scale
98         {
99             set
100             {
101                 Interop.PinchGesture.ScaleSet(swigCPtr, value);
102                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103             }
104             get
105             {
106                 float ret = Interop.PinchGesture.ScaleGet(swigCPtr);
107                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108                 return ret;
109             }
110         }
111
112         private float speed
113         {
114             set
115             {
116                 Interop.PinchGesture.SpeedSet(swigCPtr, value);
117                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118             }
119             get
120             {
121                 float ret = Interop.PinchGesture.SpeedGet(swigCPtr);
122                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123                 return ret;
124             }
125         }
126
127         private Vector2 screenCenterPoint
128         {
129             set
130             {
131                 Interop.PinchGesture.ScreenCenterPointSet(swigCPtr, Vector2.getCPtr(value));
132                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133             }
134             get
135             {
136                 global::System.IntPtr cPtr = Interop.PinchGesture.ScreenCenterPointGet(swigCPtr);
137                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
138                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139                 return ret;
140             }
141         }
142
143         private Vector2 localCenterPoint
144         {
145             set
146             {
147                 Interop.PinchGesture.LocalCenterPointSet(swigCPtr, Vector2.getCPtr(value));
148                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149             }
150             get
151             {
152                 global::System.IntPtr cPtr = Interop.PinchGesture.LocalCenterPointGet(swigCPtr);
153                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
154                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155                 return ret;
156             }
157         }
158
159         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj)
160         {
161             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
162         }
163
164         internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
165         {
166             PinchGesture ret = new PinchGesture(cPtr, false);
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168             return ret;
169         }
170
171         /// This will not be public opened.
172         [EditorBrowsable(EditorBrowsableState.Never)]
173         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
174         {
175             Interop.PinchGesture.DeletePinchGesture(swigCPtr);
176         }
177     }
178 }