1 /** Copyright (c) 2016 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class PanGestureDetector : GestureDetector {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 ~PanGestureDetector() {
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_PanGestureDetector(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
64 public class DetectedEventArgs : EventArgs
67 private PanGesture _panGesture;
81 public PanGesture PanGesture
94 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
95 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture);
96 private DaliEventHandler<object,DetectedEventArgs> _panGestureEventHandler;
97 private DetectedCallbackDelegate _panGestureCallbackDelegate;
100 public event DaliEventHandler<object,DetectedEventArgs> Detected
106 // Restricted to only one listener
107 if (_panGestureEventHandler == null)
109 _panGestureEventHandler += value;
111 _panGestureCallbackDelegate = new DetectedCallbackDelegate(OnPanGestureDetected);
112 this.DetectedSignal().Connect(_panGestureCallbackDelegate);
121 if (_panGestureEventHandler != null)
123 this.DetectedSignal().Disconnect(_panGestureCallbackDelegate);
126 _panGestureEventHandler -= value;
131 private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
133 DetectedEventArgs e = new DetectedEventArgs();
135 // Populate all members of "e" (PanGestureEventArgs) with real data
136 e.Actor = Actor.GetActorFromPtr(actor);
137 e.PanGesture = Dali.PanGesture.GetPanGestureFromPtr(panGesture);
139 if (_panGestureEventHandler != null)
141 //here we send all data to user event handlers
142 _panGestureEventHandler(this, e);
148 public static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr) {
149 PanGestureDetector ret = new PanGestureDetector(cPtr, false);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public class Property : global::System.IDisposable {
156 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
157 protected bool swigCMemOwn;
159 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
160 swigCMemOwn = cMemoryOwn;
161 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
164 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
165 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
172 public virtual void Dispose() {
174 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
177 NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr);
179 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
181 global::System.GC.SuppressFinalize(this);
185 public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true) {
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public static readonly int SCREEN_POSITION = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_POSITION_get();
190 public static readonly int SCREEN_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get();
191 public static readonly int SCREEN_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_VELOCITY_get();
192 public static readonly int LOCAL_POSITION = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_POSITION_get();
193 public static readonly int LOCAL_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get();
194 public static readonly int LOCAL_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_VELOCITY_get();
195 public static readonly int PANNING = NDalicPINVOKE.PanGestureDetector_Property_PANNING_get();
199 public static Radian DIRECTION_LEFT {
201 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_LEFT_get();
202 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public static Radian DIRECTION_RIGHT {
210 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_RIGHT_get();
211 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 public static Radian DIRECTION_UP {
219 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_UP_get();
220 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public static Radian DIRECTION_DOWN {
228 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_DOWN_get();
229 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 public static Radian DIRECTION_HORIZONTAL {
237 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_HORIZONTAL_get();
238 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 public static Radian DIRECTION_VERTICAL {
246 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DIRECTION_VERTICAL_get();
247 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 public static Radian DEFAULT_THRESHOLD {
255 global::System.IntPtr cPtr = NDalicPINVOKE.PanGestureDetector_DEFAULT_THRESHOLD_get();
256 Radian ret = (cPtr == global::System.IntPtr.Zero) ? null : new Radian(cPtr, false);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 public PanGestureDetector () : this (NDalicPINVOKE.PanGestureDetector_New(), true) {
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 public new static PanGestureDetector DownCast(BaseHandle handle) {
267 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true) {
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 public PanGestureDetector Assign(PanGestureDetector rhs) {
277 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public void SetMinimumTouchesRequired(uint minimum) {
283 NDalicPINVOKE.PanGestureDetector_SetMinimumTouchesRequired(swigCPtr, minimum);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void SetMaximumTouchesRequired(uint maximum) {
288 NDalicPINVOKE.PanGestureDetector_SetMaximumTouchesRequired(swigCPtr, maximum);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 public uint GetMinimumTouchesRequired() {
293 uint ret = NDalicPINVOKE.PanGestureDetector_GetMinimumTouchesRequired(swigCPtr);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 public uint GetMaximumTouchesRequired() {
299 uint ret = NDalicPINVOKE.PanGestureDetector_GetMaximumTouchesRequired(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public void AddAngle(Radian angle, Radian threshold) {
305 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_0(swigCPtr, Radian.getCPtr(angle), Radian.getCPtr(threshold));
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public void AddAngle(Radian angle) {
310 NDalicPINVOKE.PanGestureDetector_AddAngle__SWIG_1(swigCPtr, Radian.getCPtr(angle));
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 public void AddDirection(Radian direction, Radian threshold) {
315 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_0(swigCPtr, Radian.getCPtr(direction), Radian.getCPtr(threshold));
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 public void AddDirection(Radian direction) {
320 NDalicPINVOKE.PanGestureDetector_AddDirection__SWIG_1(swigCPtr, Radian.getCPtr(direction));
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 public uint GetAngleCount() {
325 uint ret = NDalicPINVOKE.PanGestureDetector_GetAngleCount(swigCPtr);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 public AngleThresholdPair GetAngle(uint index) {
331 AngleThresholdPair ret = new AngleThresholdPair(NDalicPINVOKE.PanGestureDetector_GetAngle(swigCPtr, index), true);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 public void ClearAngles() {
337 NDalicPINVOKE.PanGestureDetector_ClearAngles(swigCPtr);
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 public void RemoveAngle(Radian angle) {
342 NDalicPINVOKE.PanGestureDetector_RemoveAngle(swigCPtr, Radian.getCPtr(angle));
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 public void RemoveDirection(Radian direction) {
347 NDalicPINVOKE.PanGestureDetector_RemoveDirection(swigCPtr, Radian.getCPtr(direction));
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 public PanGestureDetectedSignal DetectedSignal() {
352 PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 public static void SetPanGestureProperties(PanGesture pan) {
358 NDalicPINVOKE.PanGestureDetector_SetPanGestureProperties(PanGesture.getCPtr(pan));
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 public Vector2 ScreenPosition
366 Vector2 temp = new Vector2(0.0f,0.0f);
367 GetProperty( PanGestureDetector.Property.SCREEN_POSITION).Get( temp );
370 } public Vector2 ScreenDisplacement
374 Vector2 temp = new Vector2(0.0f,0.0f);
375 GetProperty( PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get( temp );
378 } public Vector2 ScreenVelocity
382 Vector2 temp = new Vector2(0.0f,0.0f);
383 GetProperty( PanGestureDetector.Property.SCREEN_VELOCITY).Get( temp );
386 } public Vector2 LocalPosition
390 Vector2 temp = new Vector2(0.0f,0.0f);
391 GetProperty( PanGestureDetector.Property.LOCAL_POSITION).Get( temp );
394 } public Vector2 LocalDisplacement
398 Vector2 temp = new Vector2(0.0f,0.0f);
399 GetProperty( PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get( temp );
402 } public Vector2 LocalVelocity
406 Vector2 temp = new Vector2(0.0f,0.0f);
407 GetProperty( PanGestureDetector.Property.LOCAL_VELOCITY).Get( temp );
410 } public bool Panning
415 GetProperty( PanGestureDetector.Property.PANNING).Get( ref temp );