6c30075d3ddd71fcf1c06a1a87d3e32223174e46
[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 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// This object translates data from a property array of maps into an array of animators.
23     /// This is normally used when animating visuals.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public class TransitionData : BaseHandle
27     {
28
29         /// <summary>
30         /// Create an instance of TransitionData.
31         /// </summary>
32         /// <param name="transition">The transition data to store (a single animator).</param>
33         /// <since_tizen> 3 </since_tizen>
34         public TransitionData(PropertyMap transition) : this(Interop.TransitionData.NewByMap(PropertyMap.getCPtr(transition)), true)
35         {
36             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37
38         }
39
40         /// <summary>
41         /// Create an instance of TransitionData.
42         /// </summary>
43         /// <param name="transition">The transition data to store (an array of maps of animators).</param>
44         /// <since_tizen> 3 </since_tizen>
45         public TransitionData(PropertyArray transition) : this(Interop.TransitionData.NewByArray(PropertyArray.getCPtr(transition)), true)
46         {
47             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48
49         }
50
51         /// <summary>
52         /// Create an instance of TransitionData by copy constructor.
53         /// </summary>
54         /// <param name="handle">Handle to an object.</param>
55         /// <since_tizen> 3 </since_tizen>
56         public TransitionData(TransitionData handle) : this(Interop.TransitionData.NewTransitionData(TransitionData.getCPtr(handle)), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59         }
60
61         internal TransitionData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TransitionData.Upcast(cPtr), cMemoryOwn)
62         {
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.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.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         /// This will not be public opened.
96         [EditorBrowsable(EditorBrowsableState.Never)]
97         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
98         {
99             Interop.TransitionData.DeleteTransitionData(swigCPtr);
100         }
101     }
102 }