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;
\r
31 using Tizen.NUI.BaseComponents;
33 public class TapGestureDetector : GestureDetector {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal TapGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGestureDetector obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 public override void Dispose() {
45 if (!Window.IsInstalled()) {
46 DisposeQueue.Instance.Add(this);
51 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
54 NDalicPINVOKE.delete_TapGestureDetector(swigCPtr);
56 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 global::System.GC.SuppressFinalize(this);
66 public class DetectedEventArgs : EventArgs
69 private TapGesture _tapGesture;
83 public TapGesture TapGesture
96 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
97 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr TapGesture);
98 private DaliEventHandler<object,DetectedEventArgs> _tapGestureEventHandler;
99 private DetectedCallbackDelegate _tapGestureCallbackDelegate;
102 public event DaliEventHandler<object,DetectedEventArgs> Detected
108 // Restricted to only one listener
109 if (_tapGestureEventHandler == null)
111 _tapGestureEventHandler += value;
113 _tapGestureCallbackDelegate = new DetectedCallbackDelegate(OnTapGestureDetected);
114 this.DetectedSignal().Connect(_tapGestureCallbackDelegate);
123 if (_tapGestureEventHandler != null)
125 this.DetectedSignal().Disconnect(_tapGestureCallbackDelegate);
128 _tapGestureEventHandler -= value;
133 private void OnTapGestureDetected(IntPtr actor, IntPtr tapGesture)
135 DetectedEventArgs e = new DetectedEventArgs();
137 // Populate all members of "e" (DetectedEventArgs) with real data
138 e.View = View.GetViewFromPtr(actor);
139 e.TapGesture = Tizen.NUI.TapGesture.GetTapGestureFromPtr(tapGesture);
141 if (_tapGestureEventHandler != null)
143 //here we send all data to user event handlers
144 _tapGestureEventHandler(this, e);
150 public static TapGestureDetector GetTapGestureDetectorFromPtr(global::System.IntPtr cPtr) {
151 TapGestureDetector ret = new TapGestureDetector(cPtr, false);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public TapGestureDetector () : this (NDalicPINVOKE.TapGestureDetector_New__SWIG_0(), true) {
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 public TapGestureDetector (uint tapsRequired) : this (NDalicPINVOKE.TapGestureDetector_New__SWIG_1(tapsRequired), true) {
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public new static TapGestureDetector DownCast(BaseHandle handle) {
166 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public TapGestureDetector(TapGestureDetector handle) : this(NDalicPINVOKE.new_TapGestureDetector__SWIG_1(TapGestureDetector.getCPtr(handle)), true) {
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public TapGestureDetector Assign(TapGestureDetector rhs) {
176 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_Assign(swigCPtr, TapGestureDetector.getCPtr(rhs)), false);
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 public void SetMinimumTapsRequired(uint minimumTaps) {
182 NDalicPINVOKE.TapGestureDetector_SetMinimumTapsRequired(swigCPtr, minimumTaps);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 public void SetMaximumTapsRequired(uint maximumTaps) {
187 NDalicPINVOKE.TapGestureDetector_SetMaximumTapsRequired(swigCPtr, maximumTaps);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public uint GetMinimumTapsRequired() {
192 uint ret = NDalicPINVOKE.TapGestureDetector_GetMinimumTapsRequired(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public uint GetMaximumTapsRequired() {
198 uint ret = NDalicPINVOKE.TapGestureDetector_GetMaximumTapsRequired(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 internal TapGestureDetectedSignal DetectedSignal() {
204 TapGestureDetectedSignal ret = new TapGestureDetectedSignal(NDalicPINVOKE.TapGestureDetector_DetectedSignal(swigCPtr), false);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();