2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
22 /// A PinchGesture is emitted when the user moves two fingers towards or away from each other.<br />
23 /// A pinch gesture will continue to be sent to the actor under the center point of the pinch until the pinch ends.<br />
25 /// <since_tizen> 3 </since_tizen>
26 public class PinchGesture : Gesture
28 internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
33 /// The scale factor from the start of the pinch gesture till the latest pinch gesture.<br />
34 /// If the user is moving their fingers away from each other, then
35 /// this value increases. Conversely, if the user is moving their
36 /// fingers towards each other, this value will decrease.<br />
38 /// <since_tizen> 3 </since_tizen>
48 /// The speed at which the user is moving their fingers.<br />
49 /// This is the pixel movement per second.<br />
51 /// <since_tizen> 3 </since_tizen>
61 /// The center point of the two points that caused the pinch gesture in screen coordinates.
63 /// <since_tizen> 3 </since_tizen>
64 public Vector2 ScreenCenterPoint
68 return screenCenterPoint;
73 /// The center point of the two points that caused the pinch gesture in local actor coordinates.
75 /// <since_tizen> 3 </since_tizen>
76 public Vector2 LocalCenterPoint
80 return localCenterPoint;
85 /// The default constructor.
87 /// <param name="state">The state of the gesture.</param>
88 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
89 [EditorBrowsable(EditorBrowsableState.Never)]
90 public PinchGesture(Gesture.StateType state) : this(Interop.PinchGesture.New((int)state), true)
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 Interop.PinchGesture.ScaleSet(SwigCPtr, value);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 float ret = Interop.PinchGesture.ScaleGet(SwigCPtr);
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 Interop.PinchGesture.SpeedSet(SwigCPtr, value);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 float ret = Interop.PinchGesture.SpeedGet(SwigCPtr);
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 private Vector2 screenCenterPoint
129 Interop.PinchGesture.ScreenCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 global::System.IntPtr cPtr = Interop.PinchGesture.ScreenCenterPointGet(SwigCPtr);
135 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 private Vector2 localCenterPoint
145 Interop.PinchGesture.LocalCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 global::System.IntPtr cPtr = Interop.PinchGesture.LocalCenterPointGet(SwigCPtr);
151 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
159 PinchGesture ret = new PinchGesture(cPtr, false);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 /// This will not be public opened.
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
168 Interop.PinchGesture.DeletePinchGesture(swigCPtr);