1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
23 public class Animatable : BaseHandle
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if (type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
56 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 NDalicPINVOKE.delete_Handle(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 /// Create an instance of animatable.
72 /// <since_tizen> 3 </since_tizen>
73 public Animatable() : this(NDalicPINVOKE.Handle_New(), true)
75 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79 internal uint GetPropertyCount()
81 uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
82 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87 /// Queries the name of a property.
89 /// <param name="index">The index of the property.</param>
90 /// <returns>The name of the property.</returns>
91 /// <since_tizen> 3 </since_tizen>
92 public string GetPropertyName(int index)
94 string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100 /// Queries the index of a property.
102 /// <param name="name">The name of the property.</param>
103 /// <returns>The index of the property.</returns>
104 /// <since_tizen> 3 </since_tizen>
105 public int GetPropertyIndex(string name)
107 int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// Queries whether a property can be writable.
115 /// <param name="index">The index of the property.</param>
116 /// <returns>True if the property is writable.</returns>
117 /// <since_tizen> 3 </since_tizen>
118 public bool IsPropertyWritable(int index)
120 bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 /// whether a writable property can be the target of an animation.
128 /// <param name="index">The index of the property.</param>
129 /// <returns>True if the property is animatable.</returns>
130 /// <since_tizen> 3 </since_tizen>
131 public bool IsPropertyAnimatable(int index)
133 bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// Queries the type of a property.
141 /// <param name="index">The index of the property.</param>
142 /// <returns>The type of the property.</returns>
143 /// <since_tizen> 3 </since_tizen>
144 public PropertyType GetPropertyType(int index)
146 PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 /// Sets the value of an existing property.
154 /// <param name="index">The index of the property.</param>
155 /// <param name="propertyValue">The new value of the property.</param>
156 /// <since_tizen> 3 </since_tizen>
157 public void SetProperty(int index, PropertyValue propertyValue)
159 Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
163 /// Registers a new animatable property.
165 /// <param name="name">The name of the property.</param>
166 /// <param name="propertyValue">The new value of the property.</param>
167 /// <returns>The type of the property.</returns>
168 /// <since_tizen> 3 </since_tizen>
169 public int RegisterProperty(string name, PropertyValue propertyValue)
171 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// Registers a new animatable property.
179 /// <param name="name">The name of the property.</param>
180 /// <param name="propertyValue">The new value of the property.</param>
181 /// <param name="accessMode">The property access mode (writable, animatable etc).</param>
182 /// <returns>The type of the property.</returns>
183 /// <since_tizen> 3 </since_tizen>
184 public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
186 int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 /// Retrieves a property value.
194 /// <param name="index">The index of the property.</param>
195 /// <returns>The property value.</returns>
196 /// <since_tizen> 3 </since_tizen>
197 public PropertyValue GetProperty(int index)
199 PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
204 /// Adds a property notification to this object.
206 /// <param name="property">The name of the property.</param>
207 /// <param name="condition">The notification will be triggered when this condition is satisfied.</param>
208 /// <returns>A handle to the newly created PropertyNotification.</returns>
209 /// <since_tizen> 4 </since_tizen>
210 public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
212 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, PropertyHelper.GetPropertyFromString(this, property).propertyIndex, PropertyCondition.getCPtr(condition)), true);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
219 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Removes a property notification from this object.
227 /// <param name="propertyNotification">The propertyNotification to be removed.</param>
228 /// <since_tizen> 4 </since_tizen>
229 public void RemovePropertyNotification(PropertyNotification propertyNotification)
231 NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// Removes a property notification from this object.
238 /// <since_tizen> 4 </since_tizen>
239 public void RemovePropertyNotifications()
241 NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 internal void RemoveConstraints()
247 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 internal void RemoveConstraints(uint tag)
253 NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 /// Enumeration for Handle's capabilities that can be queried.
260 /// <since_tizen> 3 </since_tizen>
261 public enum Capability
263 DYNAMIC_PROPERTIES = 0x01