2 * Copyright(c) 2020 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;
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 />
26 /// <since_tizen> 3 </since_tizen>
27 public class PinchGesture : Gesture
30 internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.PinchGesture.Upcast(cPtr), cMemoryOwn)
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 />
40 /// <since_tizen> 3 </since_tizen>
50 /// The speed at which the user is moving their fingers.<br />
51 /// This is the pixel movement per second.<br />
53 /// <since_tizen> 3 </since_tizen>
63 /// The center point of the two points that caused the pinch gesture in screen coordinates.
65 /// <since_tizen> 3 </since_tizen>
66 public Vector2 ScreenCenterPoint
70 return screenCenterPoint;
75 /// The center point of the two points that caused the pinch gesture in local actor coordinates.
77 /// <since_tizen> 3 </since_tizen>
78 public Vector2 LocalCenterPoint
82 return localCenterPoint;
87 /// The default constructor.
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)
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101 Interop.PinchGesture.ScaleSet(SwigCPtr, value);
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 float ret = Interop.PinchGesture.ScaleGet(SwigCPtr);
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 Interop.PinchGesture.SpeedSet(SwigCPtr, value);
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 float ret = Interop.PinchGesture.SpeedGet(SwigCPtr);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 private Vector2 screenCenterPoint
131 Interop.PinchGesture.ScreenCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
143 private Vector2 localCenterPoint
147 Interop.PinchGesture.LocalCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
159 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj)
161 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
164 internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
166 PinchGesture ret = new PinchGesture(cPtr, false);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// This will not be public opened.
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
175 Interop.PinchGesture.DeletePinchGesture(swigCPtr);