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 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 />
26 /// <since_tizen> 3 </since_tizen>
27 public class LongPressGesture : Gesture
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)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40 internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.LongPressGesture.Upcast(cPtr), cMemoryOwn)
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 />
48 /// <since_tizen> 3 </since_tizen>
49 public uint NumberOfTouches
53 return numberOfTouches;
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 />
61 /// <since_tizen> 3 </since_tizen>
62 public Vector2 ScreenPoint
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 />
74 /// <since_tizen> 3 </since_tizen>
75 public Vector2 LocalPoint
84 private uint numberOfTouches
88 Interop.LongPressGesture.NumberOfTouchesSet(swigCPtr, value);
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 uint ret = Interop.LongPressGesture.NumberOfTouchesGet(swigCPtr);
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 private Vector2 screenPoint
103 Interop.LongPressGesture.ScreenPointSet(swigCPtr, Vector2.getCPtr(value));
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
115 private Vector2 localPoint
119 Interop.LongPressGesture.LocalPointSet(swigCPtr, Vector2.getCPtr(value));
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
131 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGesture obj)
133 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
136 internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr)
138 LongPressGesture ret = new LongPressGesture(cPtr, false);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 /// This will not be public opened.
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
147 Interop.LongPressGesture.DeleteLongPressGesture(swigCPtr);