2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
26 /// <since_tizen> 3 </since_tizen>
27 public class Animatable : BaseHandle
29 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 /// Create an instance of animatable.
34 /// <since_tizen> 3 </since_tizen>
35 public Animatable() : this(NDalicPINVOKE.Handle_New(), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
41 internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
47 /// Enumeration for Handle's capabilities that can be queried.
49 /// <since_tizen> 3 </since_tizen>
50 public enum Capability
53 /// Some objects support dynamic property creation at run-time.
54 /// New properties are registered by calling RegisterProperty() with an unused property name.
56 /// <since_tizen> 3 </since_tizen>
57 DYNAMIC_PROPERTIES = 0x01
61 /// Queries the name of a property.
63 /// <param name="index">The index of the property.</param>
64 /// <returns>The name of the property.</returns>
65 /// <since_tizen> 3 </since_tizen>
66 public string GetPropertyName(int index)
68 string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
69 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 /// Queries the index of a property.
76 /// <param name="name">The name of the property.</param>
77 /// <returns>The index of the property.</returns>
78 /// <since_tizen> 3 </since_tizen>
79 public int GetPropertyIndex(string name)
81 // Convert property string to be lowercase
82 StringBuilder sb = new StringBuilder(name);
83 sb[0] = (char)(sb[0] | 0x20);
84 string str = sb.ToString();
86 int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, str);
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 /// Queries whether a property can be writable.
94 /// <param name="index">The index of the property.</param>
95 /// <returns>True if the property is writable.</returns>
96 /// <since_tizen> 3 </since_tizen>
97 public bool IsPropertyWritable(int index)
99 bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// whether a writable property can be the target of an animation.
107 /// <param name="index">The index of the property.</param>
108 /// <returns>True if the property is animatable.</returns>
109 /// <since_tizen> 3 </since_tizen>
110 public bool IsPropertyAnimatable(int index)
112 bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 /// Queries the type of a property.
120 /// <param name="index">The index of the property.</param>
121 /// <returns>The type of the property.</returns>
122 /// <since_tizen> 3 </since_tizen>
123 public PropertyType GetPropertyType(int index)
125 PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// Sets the value of an existing property.
133 /// <param name="index">The index of the property.</param>
134 /// <param name="propertyValue">The new value of the property.</param>
135 /// <since_tizen> 3 </since_tizen>
136 public void SetProperty(int index, PropertyValue propertyValue)
138 Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
142 /// Registers a new animatable property.
144 /// <param name="name">The name of the property.</param>
145 /// <param name="propertyValue">The new value of the property.</param>
146 /// <returns>The type of the property.</returns>
147 /// <since_tizen> 3 </since_tizen>
148 public int RegisterProperty(string name, PropertyValue propertyValue)
150 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 /// Registers a new animatable property.
158 /// <param name="name">The name of the property.</param>
159 /// <param name="propertyValue">The new value of the property.</param>
160 /// <param name="accessMode">The property access mode (writable, animatable etc).</param>
161 /// <returns>The type of the property.</returns>
162 /// <since_tizen> 3 </since_tizen>
163 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
165 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// Retrieves a property value.
173 /// <param name="index">The index of the property.</param>
174 /// <returns>The property value.</returns>
175 /// <since_tizen> 3 </since_tizen>
176 public PropertyValue GetProperty(int index)
178 PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
183 /// Adds a property notification to this object.
185 /// <param name="property">The name of the property.</param>
186 /// <param name="condition">The notification will be triggered when this condition is satisfied.</param>
187 /// <returns>A handle to the newly created PropertyNotification.</returns>
188 /// <since_tizen> 4 </since_tizen>
189 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
191 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// Removes a property notification from this object.
199 /// <param name="propertyNotification">The propertyNotification to be removed.</param>
200 /// <since_tizen> 4 </since_tizen>
201 public void RemovePropertyNotification(PropertyNotification propertyNotification)
203 NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 /// Removes a property notification from this object.
210 /// <since_tizen> 4 </since_tizen>
211 public void RemovePropertyNotifications()
213 NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj)
219 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
222 internal uint GetPropertyCount()
224 uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
231 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 internal void RemoveConstraints()
238 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 internal void RemoveConstraints(uint tag)
244 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 /// To make the Animatable instance be disposed.
251 /// <since_tizen> 3 </since_tizen>
252 protected override void Dispose(DisposeTypes type)
259 if (type == DisposeTypes.Explicit)
262 //Release your own managed resources here.
263 //You should release all of your own disposable objects here.
267 //Release your own unmanaged resources here.
268 //You should not access any managed member here except static instance.
269 //because the execution order of Finalizes is non-deterministic.
271 if (swigCPtr.Handle != global::System.IntPtr.Zero)
276 NDalicPINVOKE.delete_Handle(swigCPtr);
278 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);