/* * Copyright(c) 2017 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; using System.Text; namespace Tizen.NUI { /// /// Animatable. /// /// 3 public class Animatable : BaseHandle { /// /// Create an instance of animatable. /// /// 3 public Animatable() : this(Interop.Handle.Handle_New(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Handle.Handle_SWIGUpcast(cPtr), cMemoryOwn) { } /// /// Enumeration for Handle's capabilities that can be queried. /// /// 3 public enum Capability { /// /// Some objects support dynamic property creation at run-time. /// New properties are registered by calling RegisterProperty() with an unused property name. /// /// 3 DYNAMIC_PROPERTIES = 0x01 } /// /// Queries the name of a property. /// /// The index of the property. /// The name of the property. /// 3 public string GetPropertyName(int index) { string ret = Interop.Handle.Handle_GetPropertyName(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Queries the index of a property. /// /// The name of the property. /// The index of the property. /// 3 public int GetPropertyIndex(string name) { // Convert property string to be lowercase StringBuilder sb = new StringBuilder(name); sb[0] = (char)(sb[0] | 0x20); string str = sb.ToString(); int ret = Interop.Handle.Handle_GetPropertyIndex(swigCPtr, str); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Queries whether a property can be writable. /// /// The index of the property. /// True if the property is writable. /// 3 public bool IsPropertyWritable(int index) { bool ret = Interop.Handle.Handle_IsPropertyWritable(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// whether a writable property can be the target of an animation. /// /// The index of the property. /// True if the property is animatable. /// 3 public bool IsPropertyAnimatable(int index) { bool ret = Interop.Handle.Handle_IsPropertyAnimatable(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Queries the type of a property. /// /// The index of the property. /// The type of the property. /// 3 public PropertyType GetPropertyType(int index) { PropertyType ret = (PropertyType)Interop.Handle.Handle_GetPropertyType(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Sets the value of an existing property. /// /// The index of the property. /// The new value of the property. /// 3 public void SetProperty(int index, PropertyValue propertyValue) { Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue); } /// /// Registers a new animatable property. /// /// The name of the property. /// The new value of the property. /// The type of the property. /// 3 public int RegisterProperty(string name, PropertyValue propertyValue) { int ret = Interop.Handle.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Registers a new animatable property. /// /// The name of the property. /// The new value of the property. /// The property access mode (writable, animatable etc). /// The type of the property. /// 3 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode) { int ret = Interop.Handle.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Retrieves a property value. /// /// The index of the property. /// The property value. /// 3 public PropertyValue GetProperty(int index) { PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index); return ret; } /// /// Adds a property notification to this object. /// /// The name of the property. /// The notification will be triggered when this condition is satisfied. /// A handle to the newly created PropertyNotification. /// 4 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition) { PropertyNotification ret = new PropertyNotification(Interop.Handle.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Removes a property notification from this object. /// /// The propertyNotification to be removed. /// 4 public void RemovePropertyNotification(PropertyNotification propertyNotification) { Interop.Handle.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Removes a property notification from this object. /// /// 4 public void RemovePropertyNotifications() { Interop.Handle.Handle_RemovePropertyNotifications(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } internal uint GetPropertyCount() { uint ret = Interop.HandleInternal.Handle_GetPropertyCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition) { PropertyNotification ret = new PropertyNotification(Interop.Handle.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal void RemoveConstraints() { Interop.HandleInternal.Handle_RemoveConstraints__SWIG_0(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void RemoveConstraints(uint tag) { Interop.HandleInternal.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Handle.delete_Handle(swigCPtr); } } }