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;
32 public class TapGestureDetector : GestureDetector {
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 internal TapGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) {
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGestureDetector obj) {
40 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
43 ~TapGestureDetector() {
44 DisposeQueue.Instance.Add(this);
47 public override void Dispose() {
48 if (!Stage.IsInstalled()) {
49 DisposeQueue.Instance.Add(this);
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
57 NDalicPINVOKE.delete_TapGestureDetector(swigCPtr);
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 global::System.GC.SuppressFinalize(this);
69 public class DetectedEventArgs : EventArgs
72 private TapGesture _tapGesture;
86 public TapGesture TapGesture
99 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
100 private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr TapGesture);
101 private DaliEventHandler<object,DetectedEventArgs> _tapGestureEventHandler;
102 private DetectedCallbackDelegate _tapGestureCallbackDelegate;
105 public event DaliEventHandler<object,DetectedEventArgs> Detected
111 // Restricted to only one listener
112 if (_tapGestureEventHandler == null)
114 _tapGestureEventHandler += value;
116 _tapGestureCallbackDelegate = new DetectedCallbackDelegate(OnTapGestureDetected);
117 this.DetectedSignal().Connect(_tapGestureCallbackDelegate);
126 if (_tapGestureEventHandler != null)
128 this.DetectedSignal().Disconnect(_tapGestureCallbackDelegate);
131 _tapGestureEventHandler -= value;
136 private void OnTapGestureDetected(IntPtr actor, IntPtr tapGesture)
138 DetectedEventArgs e = new DetectedEventArgs();
140 // Populate all members of "e" (DetectedEventArgs) with real data
141 e.View = View.GetViewFromPtr(actor);
142 e.TapGesture = Dali.TapGesture.GetTapGestureFromPtr(tapGesture);
144 if (_tapGestureEventHandler != null)
146 //here we send all data to user event handlers
147 _tapGestureEventHandler(this, e);
153 public static TapGestureDetector GetTapGestureDetectorFromPtr(global::System.IntPtr cPtr) {
154 TapGestureDetector ret = new TapGestureDetector(cPtr, false);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 public TapGestureDetector () : this (NDalicPINVOKE.TapGestureDetector_New__SWIG_0(), true) {
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public TapGestureDetector (uint tapsRequired) : this (NDalicPINVOKE.TapGestureDetector_New__SWIG_1(tapsRequired), true) {
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public new static TapGestureDetector DownCast(BaseHandle handle) {
169 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public TapGestureDetector(TapGestureDetector handle) : this(NDalicPINVOKE.new_TapGestureDetector__SWIG_1(TapGestureDetector.getCPtr(handle)), true) {
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public TapGestureDetector Assign(TapGestureDetector rhs) {
179 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_Assign(swigCPtr, TapGestureDetector.getCPtr(rhs)), false);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public void SetMinimumTapsRequired(uint minimumTaps) {
185 NDalicPINVOKE.TapGestureDetector_SetMinimumTapsRequired(swigCPtr, minimumTaps);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public void SetMaximumTapsRequired(uint maximumTaps) {
190 NDalicPINVOKE.TapGestureDetector_SetMaximumTapsRequired(swigCPtr, maximumTaps);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public uint GetMinimumTapsRequired() {
195 uint ret = NDalicPINVOKE.TapGestureDetector_GetMinimumTapsRequired(swigCPtr);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public uint GetMaximumTapsRequired() {
201 uint ret = NDalicPINVOKE.TapGestureDetector_GetMaximumTapsRequired(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public TapGestureDetectedSignal DetectedSignal() {
207 TapGestureDetectedSignal ret = new TapGestureDetectedSignal(NDalicPINVOKE.TapGestureDetector_DetectedSignal(swigCPtr), false);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();