14aa69470fc57fc6541187d20bc8c193f34a2c88
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / TransitionData.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     /// <summary>
21     /// This object translates data from a property array of maps into an array of animators.
22     /// </summary>
23     /// <since_tizen> 3 </since_tizen>
24     public class TransitionData : BaseHandle
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         /// <summary>
29         /// Create an instance of TransitionData.
30         /// </summary>
31         /// <param name="transition">The transition data to store (a single animator).</param>
32         /// <since_tizen> 3 </since_tizen>
33         public TransitionData(PropertyMap transition) : this(Interop.TransitionData.TransitionData_New__SWIG_0(PropertyMap.getCPtr(transition)), true)
34         {
35             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
36
37         }
38
39         /// <summary>
40         /// Create an instance of TransitionData.
41         /// </summary>
42         /// <param name="transition">The transition data to store (an array of maps of animators).</param>
43         /// <since_tizen> 3 </since_tizen>
44         public TransitionData(PropertyArray transition) : this(Interop.TransitionData.TransitionData_New__SWIG_1(PropertyArray.getCPtr(transition)), true)
45         {
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47
48         }
49
50         /// <summary>
51         /// Create an instance of TransitionData by copy constructor.
52         /// </summary>
53         /// <param name="handle">Handle to an object.</param>
54         /// <since_tizen> 3 </since_tizen>
55         public TransitionData(TransitionData handle) : this(Interop.TransitionData.new_TransitionData__SWIG_1(TransitionData.getCPtr(handle)), true)
56         {
57             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58         }
59
60         internal TransitionData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TransitionData.TransitionData_SWIGUpcast(cPtr), cMemoryOwn)
61         {
62             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
63         }
64
65         /// <summary>
66         /// returns the count of the individual property transitions stored within this handle.
67         /// </summary>
68         /// <returns>A handle to the image at the the specified position.</returns>
69         /// <since_tizen> 3 </since_tizen>
70         public uint Count()
71         {
72             uint ret = Interop.TransitionData.TransitionData_Count(swigCPtr);
73             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74             return ret;
75         }
76
77         /// <summary>
78         /// returns the count of the individual property transitions stored within this handle.
79         /// </summary>
80         /// <param name="index">The index of the animator.</param>
81         /// <returns>A property map representing the animator.</returns>
82         /// <since_tizen> 3 </since_tizen>
83         public PropertyMap GetAnimatorAt(uint index)
84         {
85             PropertyMap ret = new PropertyMap(Interop.TransitionData.TransitionData_GetAnimatorAt(swigCPtr, index), true);
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87             return ret;
88         }
89
90         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransitionData obj)
91         {
92             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
93         }
94
95         /// <summary>
96         /// Dispose.
97         /// </summary>
98         /// <param name="type">The dispose type</param>
99         /// <since_tizen> 3 </since_tizen>
100         protected override void Dispose(DisposeTypes type)
101         {
102             if (disposed)
103             {
104                 return;
105             }
106
107             //Release your own unmanaged resources here.
108             //You should not access any managed member here except static instance.
109             //because the execution order of Finalizes is non-deterministic.
110
111             if (swigCPtr.Handle != global::System.IntPtr.Zero)
112             {
113                 if (swigCMemOwn)
114                 {
115                     swigCMemOwn = false;
116                     Interop.TransitionData.delete_TransitionData(swigCPtr);
117                 }
118                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
119             }
120
121             base.Dispose(type);
122         }
123     }
124 }