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 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() {
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_PinchGestureDetector(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
63 public class DetectedEventArgs : EventArgs
66 private PinchGesture _pinchGesture;
80 public PinchGesture PinchGesture
88 _pinchGesture = value;
93 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
94 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr pinchGesture);
95 private DaliEventHandler<object,DetectedEventArgs> _pinchGestureEventHandler;
96 private DetectedCallbackDelegate _pinchGestureCallbackDelegate;
99 public event DaliEventHandler<object,DetectedEventArgs> Detected
105 // Restricted to only one listener
106 if (_pinchGestureEventHandler == null)
108 _pinchGestureEventHandler += value;
110 _pinchGestureCallbackDelegate = new DetectedCallbackDelegate(OnPinchGestureDetected);
111 this.DetectedSignal().Connect(_pinchGestureCallbackDelegate);
120 if (_pinchGestureEventHandler != null)
122 this.DetectedSignal().Disconnect(_pinchGestureCallbackDelegate);
125 _pinchGestureEventHandler -= value;
130 private void OnPinchGestureDetected(IntPtr actor, IntPtr pinchGesture)
132 DetectedEventArgs e = new DetectedEventArgs();
134 // Populate all members of "e" (DetectedEventArgs) with real data
135 e.Actor = Actor.GetActorFromPtr(actor);
136 e.PinchGesture = Dali.PinchGesture.GetPinchGestureFromPtr(pinchGesture);
138 if (_pinchGestureEventHandler != null)
140 //here we send all data to user event handlers
141 _pinchGestureEventHandler(this, e);
147 public static PinchGestureDetector GetPinchGestureDetectorFromPtr(global::System.IntPtr cPtr) {
148 PinchGestureDetector ret = new PinchGestureDetector(cPtr, false);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 public PinchGestureDetector () : this (NDalicPINVOKE.PinchGestureDetector_New(), true) {
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public new static PinchGestureDetector DownCast(BaseHandle handle) {
159 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public PinchGestureDetector(PinchGestureDetector handle) : this(NDalicPINVOKE.new_PinchGestureDetector__SWIG_1(PinchGestureDetector.getCPtr(handle)), true) {
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public PinchGestureDetector Assign(PinchGestureDetector rhs) {
169 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_Assign(swigCPtr, PinchGestureDetector.getCPtr(rhs)), false);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public PinchGestureDetectedSignal DetectedSignal() {
175 PinchGestureDetectedSignal ret = new PinchGestureDetectedSignal(NDalicPINVOKE.PinchGestureDetector_DetectedSignal(swigCPtr), false);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();