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.
24 public class Animatable : BaseHandle
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj)
35 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
39 /// To make the Animatable instance be disposed.
41 /// <since_tizen> 3 </since_tizen>
42 protected override void Dispose(DisposeTypes type)
49 if (type == DisposeTypes.Explicit)
52 //Release your own managed resources here.
53 //You should release all of your own disposable objects here.
57 //Release your own unmanaged resources here.
58 //You should not access any managed member here except static instance.
59 //because the execution order of Finalizes is non-deterministic.
61 if (swigCPtr.Handle != global::System.IntPtr.Zero)
66 NDalicPINVOKE.delete_Handle(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 /// Create an instance of animatable.
77 /// <since_tizen> 3 </since_tizen>
78 public Animatable() : this(NDalicPINVOKE.Handle_New(), true)
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84 internal uint GetPropertyCount()
86 uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 /// Queries the name of a property.
94 /// <param name="index">The index of the property.</param>
95 /// <returns>The name of the property.</returns>
96 /// <since_tizen> 3 </since_tizen>
97 public string GetPropertyName(int index)
99 string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// Queries the index of a property.
107 /// <param name="name">The name of the property.</param>
108 /// <returns>The index of the property.</returns>
109 /// <since_tizen> 3 </since_tizen>
110 public int GetPropertyIndex(string name)
112 string daliPropertyName = name.Substring(0, 1).ToLower() + name.Substring(1);
114 int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, daliPropertyName);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 /// Queries whether a property can be writable.
122 /// <param name="index">The index of the property.</param>
123 /// <returns>True if the property is writable.</returns>
124 /// <since_tizen> 3 </since_tizen>
125 public bool IsPropertyWritable(int index)
127 bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// whether a writable property can be the target of an animation.
135 /// <param name="index">The index of the property.</param>
136 /// <returns>True if the property is animatable.</returns>
137 /// <since_tizen> 3 </since_tizen>
138 public bool IsPropertyAnimatable(int index)
140 bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 /// Queries the type of a property.
148 /// <param name="index">The index of the property.</param>
149 /// <returns>The type of the property.</returns>
150 /// <since_tizen> 3 </since_tizen>
151 public PropertyType GetPropertyType(int index)
153 PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 /// Sets the value of an existing property.
161 /// <param name="index">The index of the property.</param>
162 /// <param name="propertyValue">The new value of the property.</param>
163 /// <since_tizen> 3 </since_tizen>
164 public void SetProperty(int index, PropertyValue propertyValue)
166 Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
170 /// Registers a new animatable property.
172 /// <param name="name">The name of the property.</param>
173 /// <param name="propertyValue">The new value of the property.</param>
174 /// <returns>The type of the property.</returns>
175 /// <since_tizen> 3 </since_tizen>
176 public int RegisterProperty(string name, PropertyValue propertyValue)
178 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 /// Registers a new animatable property.
186 /// <param name="name">The name of the property.</param>
187 /// <param name="propertyValue">The new value of the property.</param>
188 /// <param name="accessMode">The property access mode (writable, animatable etc).</param>
189 /// <returns>The type of the property.</returns>
190 /// <since_tizen> 3 </since_tizen>
191 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
193 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// Retrieves a property value.
201 /// <param name="index">The index of the property.</param>
202 /// <returns>The property value.</returns>
203 /// <since_tizen> 3 </since_tizen>
204 public PropertyValue GetProperty(int index)
206 PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
211 /// Adds a property notification to this object.
213 /// <param name="property">The name of the property.</param>
214 /// <param name="condition">The notification will be triggered when this condition is satisfied.</param>
215 /// <returns>A handle to the newly created PropertyNotification.</returns>
216 /// <since_tizen> 4 </since_tizen>
217 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
219 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
226 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 /// Removes a property notification from this object.
234 /// <param name="propertyNotification">The propertyNotification to be removed.</param>
235 /// <since_tizen> 4 </since_tizen>
236 public void RemovePropertyNotification(PropertyNotification propertyNotification)
238 NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 /// Removes a property notification from this object.
245 /// <since_tizen> 4 </since_tizen>
246 public void RemovePropertyNotifications()
248 NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 internal void RemoveConstraints()
254 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 internal void RemoveConstraints(uint tag)
260 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 /// Enumeration for Handle's capabilities that can be queried.
267 /// <since_tizen> 3 </since_tizen>
268 public enum Capability
271 /// Some objects support dynamic property creation at run-time.
272 /// New properties are registered by calling RegisterProperty() with an unused property name.
274 /// <since_tizen> 3 </since_tizen>
275 DYNAMIC_PROPERTIES = 0x01