add property types include Opacity & CreateFromObject() types added
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / KeyFrames.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 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI
28 {
29
30     /// <summary>
31     /// A set of key frames for a property that can be animated using Dali Animation.<br>
32     /// This allows the generation of key frame objects from individual Property::Values.<br>
33     /// </summary>
34     public class KeyFrames : BaseHandle
35     {
36         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37
38         internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn)
39         {
40             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41         }
42
43         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj)
44         {
45             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46         }
47
48         ~KeyFrames()
49         {
50             DisposeQueue.Instance.Add(this);
51         }
52
53         public override void Dispose()
54         {
55             if (!Stage.IsInstalled())
56             {
57                 DisposeQueue.Instance.Add(this);
58                 return;
59             }
60
61             lock (this)
62             {
63                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
64                 {
65                     if (swigCMemOwn)
66                     {
67                         swigCMemOwn = false;
68                         NDalicPINVOKE.delete_KeyFrames(swigCPtr);
69                     }
70                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71                 }
72                 global::System.GC.SuppressFinalize(this);
73                 base.Dispose();
74             }
75         }
76
77
78
79         /// <summary>
80         /// Adds a key frame.
81         /// </summary>
82         /// <param name="progress">A progress value between 0.0 and 1.0</param>
83         /// <param name="value">A value</param>
84         public void Add(float progress, object value)
85         {
86             PropertyValue val = PropertyValue.CreateFromObject(value);
87             Add(progress, val);
88         }
89
90         /// <summary>
91         /// Adds a key frame.
92         /// </summary>
93         /// <param name="progress">A progress value between 0.0 and 1.0</param>
94         /// <param name="value">A value</param>
95         /// <param name="alpha">The alpha function used to blend to the next keyframe</param>
96         public void Add(float progress, object value, AlphaFunction alpha)
97         {
98             PropertyValue val = PropertyValue.CreateFromObject(value);
99             Add(progress, val, alpha);
100         }
101
102         /// <summary>
103         /// Creates an initialized KeyFrames handle.
104         /// </summary>
105         public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true)
106         {
107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108
109         }
110         /// <summary>
111         /// Downcasts a handle to KeyFrames handle.<br>
112         /// If handle points to a KeyFrames object, the downcast produces valid handle.<br>
113         /// If not, the returned handle is left uninitialized.<br>
114         /// </summary>
115         /// <param name="handle">Handle to an object</param>
116         /// <returns>Handle to a KeyFrames object or an uninitialized handle</returns>
117         public static KeyFrames DownCast(BaseHandle handle)
118         {
119             KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_DownCast(BaseHandle.getCPtr(handle)), true);
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121             return ret;
122         }
123
124         internal KeyFrames(KeyFrames handle) : this(NDalicPINVOKE.new_KeyFrames__SWIG_1(KeyFrames.getCPtr(handle)), true)
125         {
126             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127         }
128
129         internal KeyFrames Assign(KeyFrames rhs)
130         {
131             KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_Assign(swigCPtr, KeyFrames.getCPtr(rhs)), false);
132             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133             return ret;
134         }
135
136         /// <summary>
137         /// Gets the type of the key frame.
138         /// </summary>
139         /// <returns>The key frame property type</returns>
140         public PropertyType GetType()
141         {
142             PropertyType ret = (PropertyType)NDalicPINVOKE.KeyFrames_GetType(swigCPtr);
143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144             return ret;
145         }
146
147         /// <summary>
148         /// Adds a key frame.
149         /// </summary>
150         /// <param name="progress">A progress value between 0.0 and 1.0</param>
151         /// <param name="value">A value</param>
152         public void Add(float progress, PropertyValue value)
153         {
154             NDalicPINVOKE.KeyFrames_Add__SWIG_0(swigCPtr, progress, PropertyValue.getCPtr(value));
155             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156         }
157
158         /// <summary>
159         /// Adds a key frame.
160         /// </summary>
161         /// <param name="progress">A progress value between 0.0 and 1.0</param>
162         /// <param name="value">A value</param>
163         /// <param name="alpha">The alpha function used to blend to the next keyframe</param>
164         public void Add(float progress, PropertyValue value, AlphaFunction alpha)
165         {
166             NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
167             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168         }
169
170     }
171
172 }