a718fb821a5ba2925c2d87001be095a2d8c19a3c
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Animatable.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16
17 namespace Tizen.NUI
18 {
19
20     public class Animatable : BaseHandle
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23
24         internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn)
25         {
26             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         protected override void Dispose(DisposeTypes type)
35         {
36             if (disposed)
37             {
38                 return;
39             }
40
41             if (type == DisposeTypes.Explicit)
42             {
43                 //Called by User
44                 //Release your own managed resources here.
45                 //You should release all of your own disposable objects here.
46
47             }
48
49             //Release your own unmanaged resources here.
50             //You should not access any managed member here except static instance.
51             //because the execution order of Finalizes is non-deterministic.
52
53             if (swigCPtr.Handle != global::System.IntPtr.Zero)
54             {
55                 if (swigCMemOwn)
56                 {
57                     swigCMemOwn = false;
58
59                     //Unreference this instance from Registry.
60                     Registry.Unregister(this);
61
62                     NDalicPINVOKE.delete_Handle(swigCPtr);
63                 }
64                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
65             }
66
67             base.Dispose(type);
68         }
69
70
71         public Animatable() : this(NDalicPINVOKE.Handle_New(), true)
72         {
73             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74
75         }
76
77         internal uint GetPropertyCount()
78         {
79             uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81             return ret;
82         }
83
84         public string GetPropertyName(int index)
85         {
86             string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
87             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88             return ret;
89         }
90
91         public int GetPropertyIndex(string name)
92         {
93             int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name);
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95             return ret;
96         }
97
98         public bool IsPropertyWritable(int index)
99         {
100             bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102             return ret;
103         }
104
105         public bool IsPropertyAnimatable(int index)
106         {
107             bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109             return ret;
110         }
111
112         public PropertyType GetPropertyType(int index)
113         {
114             PropertyType ret = (PropertyType)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
115             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116             return ret;
117         }
118
119         public void SetProperty(int index, PropertyValue propertyValue)
120         {
121             Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
122         }
123
124         public int RegisterProperty(string name, PropertyValue propertyValue)
125         {
126             int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, PropertyValue.getCPtr(propertyValue));
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
132         {
133             int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, PropertyValue.getCPtr(propertyValue), (int)accessMode);
134             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135             return ret;
136         }
137
138         public PropertyValue GetProperty(int index)
139         {
140             PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);
141             return ret;
142         }
143
144         internal PropertyNotification AddPropertyNotification(int index, PropertyCondition condition)
145         {
146             PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, index, PropertyCondition.getCPtr(condition)), true);
147             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148             return ret;
149         }
150
151         internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition)
152         {
153             PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155             return ret;
156         }
157
158         internal void RemovePropertyNotification(PropertyNotification propertyNotification)
159         {
160             NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
161             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162         }
163
164         internal void RemovePropertyNotifications()
165         {
166             NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168         }
169
170         internal void RemoveConstraints()
171         {
172             NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174         }
175
176         internal void RemoveConstraints(uint tag)
177         {
178             NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180         }
181
182         public enum Capability
183         {
184             DYNAMIC_PROPERTIES = 0x01
185         }
186
187     }
188
189 }