1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 /// A set of key frames for a property that can be animated using DALi animation.<br>
24 /// This allows the generation of key frame objects from individual Property::Values.<br>
26 public class KeyFrames : BaseHandle
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn)
32 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
35 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj)
37 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
40 protected override void Dispose(DisposeTypes type)
47 if(type == DisposeTypes.Explicit)
50 //Release your own managed resources here.
51 //You should release all of your own disposable objects here.
54 //Release your own unmanaged resources here.
55 //You should not access any managed member here except static instance.
56 //because the execution order of Finalizes is non-deterministic.
58 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63 NDalicPINVOKE.delete_KeyFrames(swigCPtr);
65 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
77 /// <param name="value">A value.</param>
78 /// <since_tizen> 3 </since_tizen>
79 public void Add(float progress, object value)
81 PropertyValue val = PropertyValue.CreateFromObject(value);
88 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
89 /// <param name="value">A value</param>
90 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
91 /// <since_tizen> 3 </since_tizen>
92 public void Add(float progress, object value, AlphaFunction alpha)
94 PropertyValue val = PropertyValue.CreateFromObject(value);
95 Add(progress, val, alpha);
99 /// Creates an initialized KeyFrames handle.
101 /// <since_tizen> 3 </since_tizen>
102 public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 [Obsolete("Please do not use! this will be deprecated")]
109 public static KeyFrames DownCast(BaseHandle handle)
111 KeyFrames ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as KeyFrames;
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 /// Gets the type of the key frame.
119 /// <returns>The key frame property type</returns>
120 /// <since_tizen> 3 </since_tizen>
121 public new PropertyType GetType()
123 PropertyType ret = (PropertyType)NDalicPINVOKE.KeyFrames_GetType(swigCPtr);
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 /// Adds a key frame.
131 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
132 /// <param name="value">A value.</param>
133 /// <since_tizen> 3 </since_tizen>
134 public void Add(float progress, PropertyValue value)
136 NDalicPINVOKE.KeyFrames_Add__SWIG_0(swigCPtr, progress, PropertyValue.getCPtr(value));
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 /// Adds a key frame.
143 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
144 /// <param name="value">A value.</param>
145 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
146 /// <since_tizen> 3 </since_tizen>
147 public void Add(float progress, PropertyValue value, AlphaFunction alpha)
149 NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();