Merge "Handle becomes Animatable" into devel/master
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / 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 Dali {
18
19 public class Animatable : BaseHandle {
20   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21
22   internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn) {
23     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24   }
25
26   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj) {
27     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28   }
29
30   ~Animatable() {
31     DisposeQueue.Instance.Add(this);
32   }
33
34   public override void Dispose() {
35     if (!Stage.IsInstalled()) {
36       DisposeQueue.Instance.Add(this);
37       return;
38     }
39
40     lock(this) {
41       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42         if (swigCMemOwn) {
43           swigCMemOwn = false;
44           NDalicPINVOKE.delete_Handle(swigCPtr);
45         }
46         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47       }
48       global::System.GC.SuppressFinalize(this);
49       base.Dispose();
50     }
51   }
52
53
54   public Animatable () : this (NDalicPINVOKE.Handle_New(), true) {
55       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56
57   }
58   public Animatable(Animatable handle) : this(NDalicPINVOKE.new_Handle__SWIG_1(Animatable.getCPtr(handle)), true) {
59     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60   }
61
62   public bool Supports(Animatable.Capability capability) {
63     bool ret = NDalicPINVOKE.Handle_Supports(swigCPtr, (int)capability);
64     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65     return ret;
66   }
67
68   public uint GetPropertyCount() {
69     uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr);
70     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71     return ret;
72   }
73
74   public string GetPropertyName(int index) {
75     string ret = NDalicPINVOKE.Handle_GetPropertyName(swigCPtr, index);
76     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77     return ret;
78   }
79
80   public int GetPropertyIndex(string name) {
81     int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name);
82     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83     return ret;
84   }
85
86   public bool IsPropertyWritable(int index) {
87     bool ret = NDalicPINVOKE.Handle_IsPropertyWritable(swigCPtr, index);
88     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89     return ret;
90   }
91
92   public bool IsPropertyAnimatable(int index) {
93     bool ret = NDalicPINVOKE.Handle_IsPropertyAnimatable(swigCPtr, index);
94     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95     return ret;
96   }
97
98   public bool IsPropertyAConstraintInput(int index) {
99     bool ret = NDalicPINVOKE.Handle_IsPropertyAConstraintInput(swigCPtr, index);
100     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101     return ret;
102   }
103
104   public Property.Type GetPropertyType(int index) {
105     Property.Type ret = (Property.Type)NDalicPINVOKE.Handle_GetPropertyType(swigCPtr, index);
106     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107     return ret;
108   }
109
110   public void SetProperty(int index, Property.Value propertyValue)
111   {
112     Dali.Object.SetProperty( swigCPtr, index, propertyValue );
113   }
114
115   public int RegisterProperty(string name, Property.Value propertyValue) {
116     int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_0(swigCPtr, name, Property.Value.getCPtr(propertyValue));
117     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118     return ret;
119   }
120
121   public int RegisterProperty(string name, Property.Value propertyValue, Property.AccessMode accessMode) {
122     int ret = NDalicPINVOKE.Handle_RegisterProperty__SWIG_1(swigCPtr, name, Property.Value.getCPtr(propertyValue), (int)accessMode);
123     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124     return ret;
125   }
126
127   public Property.Value GetProperty(int index)
128   {
129     Property.Value ret = Dali.Object.GetProperty( swigCPtr, index );
130     return ret;
131   }
132
133   public void GetPropertyIndices(VectorInteger indices) {
134     NDalicPINVOKE.Handle_GetPropertyIndices(swigCPtr, VectorInteger.getCPtr(indices));
135     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136   }
137
138   public PropertyNotification AddPropertyNotification(int index, PropertyCondition condition) {
139     PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_0(swigCPtr, index, PropertyCondition.getCPtr(condition)), true);
140     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141     return ret;
142   }
143
144   public PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition) {
145     PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true);
146     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147     return ret;
148   }
149
150   public void RemovePropertyNotification(PropertyNotification propertyNotification) {
151     NDalicPINVOKE.Handle_RemovePropertyNotification(swigCPtr, PropertyNotification.getCPtr(propertyNotification));
152     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153   }
154
155   public void RemovePropertyNotifications() {
156     NDalicPINVOKE.Handle_RemovePropertyNotifications(swigCPtr);
157     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158   }
159
160   public void RemoveConstraints() {
161     NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr);
162     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163   }
164
165   public void RemoveConstraints(uint tag) {
166     NDalicPINVOKE.Handle_RemoveConstraints__SWIG_1(swigCPtr, tag);
167     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168   }
169
170   public enum Capability {
171     DYNAMIC_PROPERTIES = 0x01
172   }
173
174 }
175
176 }