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 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
34 public class TapGestureDetector : GestureDetector
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 internal TapGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGestureDetector_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGestureDetector obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 protected override void Dispose(DisposeTypes type)
55 if (type == DisposeTypes.Explicit)
58 //Release your own managed resources here.
59 //You should release all of your own disposable objects here.
63 //Release your own unmanaged resources here.
64 //You should not access any managed member here except static instance.
65 //because the execution order of Finalizes is non-deterministic.
67 if (swigCPtr.Handle != global::System.IntPtr.Zero)
72 NDalicPINVOKE.delete_TapGestureDetector(swigCPtr);
74 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
81 public class DetectedEventArgs : EventArgs
84 private TapGesture _tapGesture;
98 public TapGesture TapGesture
111 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
112 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr TapGesture);
113 private DaliEventHandler<object, DetectedEventArgs> _tapGestureEventHandler;
114 private DetectedCallbackDelegate _tapGestureCallbackDelegate;
117 public event DaliEventHandler<object, DetectedEventArgs> Detected
123 // Restricted to only one listener
124 if (_tapGestureEventHandler == null)
126 _tapGestureEventHandler += value;
128 _tapGestureCallbackDelegate = new DetectedCallbackDelegate(OnTapGestureDetected);
129 this.DetectedSignal().Connect(_tapGestureCallbackDelegate);
138 if (_tapGestureEventHandler != null)
140 this.DetectedSignal().Disconnect(_tapGestureCallbackDelegate);
143 _tapGestureEventHandler -= value;
148 private void OnTapGestureDetected(IntPtr actor, IntPtr tapGesture)
150 DetectedEventArgs e = new DetectedEventArgs();
152 // Populate all members of "e" (DetectedEventArgs) with real data
153 e.View = View.GetViewFromPtr(actor);
154 e.TapGesture = Tizen.NUI.TapGesture.GetTapGestureFromPtr(tapGesture);
156 if (_tapGestureEventHandler != null)
158 //here we send all data to user event handlers
159 _tapGestureEventHandler(this, e);
165 public static TapGestureDetector GetTapGestureDetectorFromPtr(global::System.IntPtr cPtr)
167 TapGestureDetector ret = new TapGestureDetector(cPtr, false);
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public TapGestureDetector() : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_0(), true)
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public TapGestureDetector(uint tapsRequired) : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_1(tapsRequired), true)
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public new static TapGestureDetector DownCast(BaseHandle handle)
185 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public TapGestureDetector(TapGestureDetector handle) : this(NDalicPINVOKE.new_TapGestureDetector__SWIG_1(TapGestureDetector.getCPtr(handle)), true)
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public TapGestureDetector Assign(TapGestureDetector rhs)
197 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_Assign(swigCPtr, TapGestureDetector.getCPtr(rhs)), false);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public void SetMinimumTapsRequired(uint minimumTaps)
204 NDalicPINVOKE.TapGestureDetector_SetMinimumTapsRequired(swigCPtr, minimumTaps);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public void SetMaximumTapsRequired(uint maximumTaps)
210 NDalicPINVOKE.TapGestureDetector_SetMaximumTapsRequired(swigCPtr, maximumTaps);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public uint GetMinimumTapsRequired()
216 uint ret = NDalicPINVOKE.TapGestureDetector_GetMinimumTapsRequired(swigCPtr);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 public uint GetMaximumTapsRequired()
223 uint ret = NDalicPINVOKE.TapGestureDetector_GetMaximumTapsRequired(swigCPtr);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 internal TapGestureDetectedSignal DetectedSignal()
230 TapGestureDetectedSignal ret = new TapGestureDetectedSignal(NDalicPINVOKE.TapGestureDetector_DetectedSignal(swigCPtr), false);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();