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;
31 internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn)
33 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
36 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj)
38 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 /// To make the Animatable instance be disposed.
44 /// <since_tizen> 3 </since_tizen>
45 protected override void Dispose(DisposeTypes type)
52 if (type == DisposeTypes.Explicit)
55 //Release your own managed resources here.
56 //You should release all of your own disposable objects here.
60 //Release your own unmanaged resources here.
61 //You should not access any managed member here except static instance.
62 //because the execution order of Finalizes is non-deterministic.
64 if (swigCPtr.Handle != global::System.IntPtr.Zero)
69 NDalicPINVOKE.delete_Handle(swigCPtr);
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
78 /// Create an instance of animatable.
80 /// <since_tizen> 3 </since_tizen>
81 public Animatable() : this(NDalicPINVOKE.Handle_New(), true)
83 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87 internal uint GetPropertyCount()
89 uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
90 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 /// Queries the name of a property.
97 /// <param name="index">The index of the property.</param>
98 /// <returns>The name of the property.</returns>
99 /// <since_tizen> 3 </since_tizen>
100 public string GetPropertyName(int index)
102 string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 /// Queries the index of a property.
110 /// <param name="name">The name of the property.</param>
111 /// <returns>The index of the property.</returns>
112 /// <since_tizen> 3 </since_tizen>
113 public int GetPropertyIndex(string name)
115 // Convert property string to be lowercase
116 StringBuilder sb = new StringBuilder(name);
117 sb[0] = (char)(sb[0] | 0x20);
118 string str = sb.ToString();
120 int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, str);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 /// Queries whether a property can be writable.
128 /// <param name="index">The index of the property.</param>
129 /// <returns>True if the property is writable.</returns>
130 /// <since_tizen> 3 </since_tizen>
131 public bool IsPropertyWritable(int index)
133 bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// whether a writable property can be the target of an animation.
141 /// <param name="index">The index of the property.</param>
142 /// <returns>True if the property is animatable.</returns>
143 /// <since_tizen> 3 </since_tizen>
144 public bool IsPropertyAnimatable(int index)
146 bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 /// Queries the type of a property.
154 /// <param name="index">The index of the property.</param>
155 /// <returns>The type of the property.</returns>
156 /// <since_tizen> 3 </since_tizen>
157 public PropertyType GetPropertyType(int index)
159 PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// Sets the value of an existing property.
167 /// <param name="index">The index of the property.</param>
168 /// <param name="propertyValue">The new value of the property.</param>
169 /// <since_tizen> 3 </since_tizen>
170 public void SetProperty(int index, PropertyValue propertyValue)
172 Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
176 /// Registers a new animatable property.
178 /// <param name="name">The name of the property.</param>
179 /// <param name="propertyValue">The new value of the property.</param>
180 /// <returns>The type of the property.</returns>
181 /// <since_tizen> 3 </since_tizen>
182 public int RegisterProperty(string name, PropertyValue propertyValue)
184 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 /// Registers a new animatable property.
192 /// <param name="name">The name of the property.</param>
193 /// <param name="propertyValue">The new value of the property.</param>
194 /// <param name="accessMode">The property access mode (writable, animatable etc).</param>
195 /// <returns>The type of the property.</returns>
196 /// <since_tizen> 3 </since_tizen>
197 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
199 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 /// Retrieves a property value.
207 /// <param name="index">The index of the property.</param>
208 /// <returns>The property value.</returns>
209 /// <since_tizen> 3 </since_tizen>
210 public PropertyValue GetProperty(int index)
212 PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
217 /// Adds a property notification to this object.
219 /// <param name="property">The name of the property.</param>
220 /// <param name="condition">The notification will be triggered when this condition is satisfied.</param>
221 /// <returns>A handle to the newly created PropertyNotification.</returns>
222 /// <since_tizen> 4 </since_tizen>
223 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
225 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
232 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 /// Removes a property notification from this object.
240 /// <param name="propertyNotification">The propertyNotification to be removed.</param>
241 /// <since_tizen> 4 </since_tizen>
242 public void RemovePropertyNotification(PropertyNotification propertyNotification)
244 NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 /// Removes a property notification from this object.
251 /// <since_tizen> 4 </since_tizen>
252 public void RemovePropertyNotifications()
254 NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 internal void RemoveConstraints()
260 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 internal void RemoveConstraints(uint tag)
266 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// Enumeration for Handle's capabilities that can be queried.
273 /// <since_tizen> 3 </since_tizen>
274 public enum Capability
277 /// Some objects support dynamic property creation at run-time.
278 /// New properties are registered by calling RegisterProperty() with an unused property name.
280 /// <since_tizen> 3 </since_tizen>
281 DYNAMIC_PROPERTIES = 0x01