1 /** Copyright (c) 2017 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 PinchGestureDetector : GestureDetector {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal PinchGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PinchGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGestureDetector obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 ~PinchGestureDetector() {
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Window.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_PinchGestureDetector(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
69 public class DetectedEventArgs : EventArgs
72 private PinchGesture _pinchGesture;
86 public PinchGesture PinchGesture
94 _pinchGesture = value;
99 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
100 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr pinchGesture);
101 private DaliEventHandler<object,DetectedEventArgs> _pinchGestureEventHandler;
102 private DetectedCallbackDelegate _pinchGestureCallbackDelegate;
105 public event DaliEventHandler<object,DetectedEventArgs> Detected
111 // Restricted to only one listener
112 if (_pinchGestureEventHandler == null)
114 _pinchGestureEventHandler += value;
116 _pinchGestureCallbackDelegate = new DetectedCallbackDelegate(OnPinchGestureDetected);
117 this.DetectedSignal().Connect(_pinchGestureCallbackDelegate);
126 if (_pinchGestureEventHandler != null)
128 this.DetectedSignal().Disconnect(_pinchGestureCallbackDelegate);
131 _pinchGestureEventHandler -= value;
136 private void OnPinchGestureDetected(IntPtr actor, IntPtr pinchGesture)
138 DetectedEventArgs e = new DetectedEventArgs();
140 // Populate all members of "e" (DetectedEventArgs) with real data
141 e.View = View.GetViewFromPtr(actor);
142 e.PinchGesture = Dali.PinchGesture.GetPinchGestureFromPtr(pinchGesture);
144 if (_pinchGestureEventHandler != null)
146 //here we send all data to user event handlers
147 _pinchGestureEventHandler(this, e);
153 public static PinchGestureDetector GetPinchGestureDetectorFromPtr(global::System.IntPtr cPtr) {
154 PinchGestureDetector ret = new PinchGestureDetector(cPtr, false);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 public PinchGestureDetector () : this (NDalicPINVOKE.PinchGestureDetector_New(), true) {
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public new static PinchGestureDetector DownCast(BaseHandle handle) {
165 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 public PinchGestureDetector(PinchGestureDetector handle) : this(NDalicPINVOKE.new_PinchGestureDetector__SWIG_1(PinchGestureDetector.getCPtr(handle)), true) {
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public PinchGestureDetector Assign(PinchGestureDetector rhs) {
175 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_Assign(swigCPtr, PinchGestureDetector.getCPtr(rhs)), false);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 public PinchGestureDetectedSignal DetectedSignal() {
181 PinchGestureDetectedSignal ret = new PinchGestureDetectedSignal(NDalicPINVOKE.PinchGestureDetector_DetectedSignal(swigCPtr), false);
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();