/*
* 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 RotationGesture is emitted when the user moves two fingers in a circular motion.
/// A rotation gesture will continue to be sent to the actor under the center point of the rotation until the rotation ends.
///
/// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public class RotationGesture : Gesture
{
internal RotationGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.RotationGesture.Upcast(cPtr), cMemoryOwn)
{
}
///
/// The overall rotation (in radians) from the start of the rotation gesture till the latest rotation gesture.
///
/// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public float Rotation
{
get
{
return rotation;
}
}
///
/// The center point of the two points that caused the rotation gesture in screen coordinates.
///
/// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector2 ScreenCenterPoint
{
get
{
return screenCenterPoint;
}
}
///
/// The center point of the two points that caused the rotation gesture in local view coordinates.
///
/// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector2 LocalCenterPoint
{
get
{
return localCenterPoint;
}
}
///
/// The default constructor.
///
/// The state of the gesture.
/// This will be made public in the next tizen release after an ACR is done. Till then, it needs to be hidden as an inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public RotationGesture(Gesture.StateType state) : this(Interop.RotationGesture.New((int)state), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
private float rotation
{
set
{
Interop.RotationGesture.RotationSet(SwigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
float ret = Interop.RotationGesture.RotationGet(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private Vector2 screenCenterPoint
{
set
{
Interop.RotationGesture.ScreenCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
global::System.IntPtr cPtr = Interop.RotationGesture.ScreenCenterPointGet(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 localCenterPoint
{
set
{
Interop.RotationGesture.LocalCenterPointSet(SwigCPtr, Vector2.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
global::System.IntPtr cPtr = Interop.RotationGesture.LocalCenterPointGet(SwigCPtr);
Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RotationGesture obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
}
internal static RotationGesture GetRotationGestureFromPtr(global::System.IntPtr cPtr)
{
RotationGesture ret = new RotationGesture(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.RotationGesture.DeleteRotationGesture(swigCPtr);
}
}
}