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 /// <since_tizen> 3 </since_tizen>
29 public class KeyFrames : BaseHandle
33 /// Creates an initialized KeyFrames handle.
35 /// <since_tizen> 3 </since_tizen>
36 public KeyFrames() : this(Interop.KeyFrames.New(), true)
38 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
42 internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.KeyFrames.Upcast(cPtr), cMemoryOwn)
49 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
50 /// <param name="value">A value.</param>
51 /// <since_tizen> 3 </since_tizen>
52 public void Add(float progress, object value)
54 PropertyValue val = PropertyValue.CreateFromObject(value);
61 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
62 /// <param name="value">A value</param>
63 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
64 /// <since_tizen> 3 </since_tizen>
65 public void Add(float progress, object value, AlphaFunction alpha)
67 PropertyValue val = PropertyValue.CreateFromObject(value);
68 Add(progress, val, alpha);
72 /// Gets the type of the key frame.
74 /// <returns>The key frame property type</returns>
75 /// <since_tizen> 3 </since_tizen>
76 public new PropertyType GetType()
78 PropertyType ret = (PropertyType)Interop.KeyFrames.GetType(SwigCPtr);
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
87 /// <param name="value">A value.</param>
88 /// <since_tizen> 3 </since_tizen>
89 public void Add(float progress, PropertyValue value)
91 Interop.KeyFrames.Add(SwigCPtr, progress, PropertyValue.getCPtr(value));
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
99 /// <param name="value">A value.</param>
100 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
101 /// <since_tizen> 3 </since_tizen>
102 public void Add(float progress, PropertyValue value, AlphaFunction alpha)
104 Interop.KeyFrames.Add(SwigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj)
110 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
113 /// This will not be public opened.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
117 Interop.KeyFrames.DeleteKeyFrames(swigCPtr);