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 int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name);
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 /// Queries whether a property can be writable.
120 /// <param name="index">The index of the property.</param>
121 /// <returns>True if the property is writable.</returns>
122 /// <since_tizen> 3 </since_tizen>
123 public bool IsPropertyWritable(int index)
125 bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// whether a writable property can be the target of an animation.
133 /// <param name="index">The index of the property.</param>
134 /// <returns>True if the property is animatable.</returns>
135 /// <since_tizen> 3 </since_tizen>
136 public bool IsPropertyAnimatable(int index)
138 bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 /// Queries the type of a property.
146 /// <param name="index">The index of the property.</param>
147 /// <returns>The type of the property.</returns>
148 /// <since_tizen> 3 </since_tizen>
149 public PropertyType GetPropertyType(int index)
151 PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 /// Sets the value of an existing property.
159 /// <param name="index">The index of the property.</param>
160 /// <param name="propertyValue">The new value of the property.</param>
161 /// <since_tizen> 3 </since_tizen>
162 public void SetProperty(int index, PropertyValue propertyValue)
164 Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
168 /// Registers a new animatable property.
170 /// <param name="name">The name of the property.</param>
171 /// <param name="propertyValue">The new value of the property.</param>
172 /// <returns>The type of the property.</returns>
173 /// <since_tizen> 3 </since_tizen>
174 public int RegisterProperty(string name, PropertyValue propertyValue)
176 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 /// Registers a new animatable property.
184 /// <param name="name">The name of the property.</param>
185 /// <param name="propertyValue">The new value of the property.</param>
186 /// <param name="accessMode">The property access mode (writable, animatable etc).</param>
187 /// <returns>The type of the property.</returns>
188 /// <since_tizen> 3 </since_tizen>
189 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
191 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// Retrieves a property value.
199 /// <param name="index">The index of the property.</param>
200 /// <returns>The property value.</returns>
201 /// <since_tizen> 3 </since_tizen>
202 public PropertyValue GetProperty(int index)
204 PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
209 /// Adds a property notification to this object.
211 /// <param name="property">The name of the property.</param>
212 /// <param name="condition">The notification will be triggered when this condition is satisfied.</param>
213 /// <returns>A handle to the newly created PropertyNotification.</returns>
214 /// <since_tizen> 4 </since_tizen>
215 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
217 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
224 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 /// Removes a property notification from this object.
232 /// <param name="propertyNotification">The propertyNotification to be removed.</param>
233 /// <since_tizen> 4 </since_tizen>
234 public void RemovePropertyNotification(PropertyNotification propertyNotification)
236 NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 /// Removes a property notification from this object.
243 /// <since_tizen> 4 </since_tizen>
244 public void RemovePropertyNotifications()
246 NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 internal void RemoveConstraints()
252 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 internal void RemoveConstraints(uint tag)
258 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 /// Enumeration for Handle's capabilities that can be queried.
265 /// <since_tizen> 3 </since_tizen>
266 public enum Capability
269 /// Some objects support dynamic property creation at run-time.
270 /// New properties are registered by calling RegisterProperty() with an unused property name.
272 /// <since_tizen> 3 </since_tizen>
273 DYNAMIC_PROPERTIES = 0x01