/*
* Copyright(c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.ComponentModel;
namespace Tizen.NUI
{
///
/// A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
///
/// 3
public class TapGesture : Gesture
{
///
/// Creates a TapGesture.
///
/// 3
public TapGesture() : this(Interop.TapGesture.New(0), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
///
/// The number of taps property (read-only).
///
/// 3
public uint NumberOfTaps
{
get
{
return numberOfTaps;
}
}
///
/// The number of touches property (read-only).
///
/// 3
public uint NumberOfTouches
{
get
{
return numberOfTouches;
}
}
///
/// The screen point property (read-only).
///
/// 3
public Vector2 ScreenPoint
{
get
{
return screenPoint;
}
}
///
/// The local point property (read-only).
///
/// 3
public Vector2 LocalPoint
{
get
{
return localPoint;
}
}
///
/// The gesture source type of touches property (read-only).
/// If you tap with a mouse button, this will tell you which mouse input you tapped.
/// Primary(Left), Secondary(Right). Tertiary(Wheel).
///
[EditorBrowsable(EditorBrowsableState.Never)]
public GestureSourceType SourceType
{
get
{
return sourceType;
}
}
private uint numberOfTaps
{
set
{
Interop.TapGesture.NumberOfTapsSet(SwigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
uint ret = Interop.TapGesture.NumberOfTapsGet(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private uint numberOfTouches
{
set
{
Interop.TapGesture.NumberOfTouchesSet(SwigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
uint ret = Interop.TapGesture.NumberOfTouchesGet(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private Vector2 screenPoint
{
set
{
Interop.TapGesture.ScreenPointSet(SwigCPtr, Vector2.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
global::System.IntPtr cPtr = Interop.TapGesture.ScreenPointGet(SwigCPtr);
Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private Vector2 localPoint
{
set
{
Interop.TapGesture.LocalPointSet(SwigCPtr, Vector2.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
global::System.IntPtr cPtr = Interop.TapGesture.LocalPointGet(SwigCPtr);
Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private GestureSourceType sourceType
{
get
{
GestureSourceType ret = (GestureSourceType)Interop.TapGesture.SourceTypeGet(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
///
/// Gets the TapGesture from the pointer.
///
/// The pointer to cast.
/// The TapGesture object.
internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr)
{
TapGesture ret = new TapGesture(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
Interop.TapGesture.DeleteTapGesture(swigCPtr);
}
}
///
/// Gesture source type.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public enum GestureSourceType
{
///
/// invalid data.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Invalid = -1,
///
/// Primary.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Primary = 1,
///
/// Secondary.
///
[EditorBrowsable(EditorBrowsableState.Never)]
Secondary = 3,
///
/// Third (tertiary)
///
[EditorBrowsable(EditorBrowsableState.Never)]
Tertiary = 2,
}
}