2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.ComponentModel;
25 /// A set of key frames for a property that can be animated using DALi animation.<br />
26 /// This allows the generation of key frame objects from individual Property::Values.<br />
28 public class KeyFrames : BaseHandle
30 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn)
34 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj)
39 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 /// <since_tizen> 3 </since_tizen>
46 protected override void Dispose(DisposeTypes type)
53 if(type == DisposeTypes.Explicit)
56 //Release your own managed resources here.
57 //You should release all of your own disposable objects here.
60 //Release your own unmanaged resources here.
61 //You should not access any managed member here except static instance.
62 //because the execution order of Finalizes is non-deterministic.
64 if (swigCPtr.Handle != global::System.IntPtr.Zero)
69 NDalicPINVOKE.delete_KeyFrames(swigCPtr);
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
82 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
83 /// <param name="value">A value.</param>
84 /// <since_tizen> 3 </since_tizen>
85 public void Add(float progress, object value)
87 PropertyValue val = PropertyValue.CreateFromObject(value);
94 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
95 /// <param name="value">A value</param>
96 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
97 /// <since_tizen> 3 </since_tizen>
98 public void Add(float progress, object value, AlphaFunction alpha)
100 PropertyValue val = PropertyValue.CreateFromObject(value);
101 Add(progress, val, alpha);
105 /// Creates an initialized KeyFrames handle.
107 /// <since_tizen> 3 </since_tizen>
108 public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true)
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 /// Downcasts a handle to keyFrame handle.
117 /// <since_tizen> 3 </since_tizen>
118 /// Please do not use! this will be deprecated!
119 /// Instead please use as keyword.
120 [Obsolete("Please DO NOT use! This will be deprecated, instead please USE as keyword.")]
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public static KeyFrames DownCast(BaseHandle handle)
124 KeyFrames ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as KeyFrames;
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 /// Gets the type of the key frame.
132 /// <returns>The key frame property type</returns>
133 /// <since_tizen> 3 </since_tizen>
134 public new PropertyType GetType()
136 PropertyType ret = (PropertyType)NDalicPINVOKE.KeyFrames_GetType(swigCPtr);
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 /// Adds a key frame.
144 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
145 /// <param name="value">A value.</param>
146 /// <since_tizen> 3 </since_tizen>
147 public void Add(float progress, PropertyValue value)
149 NDalicPINVOKE.KeyFrames_Add__SWIG_0(swigCPtr, progress, PropertyValue.getCPtr(value));
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 /// Adds a key frame.
156 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
157 /// <param name="value">A value.</param>
158 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
159 /// <since_tizen> 3 </since_tizen>
160 public void Add(float progress, PropertyValue value, AlphaFunction alpha)
162 NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();