[NUI] Deprecated Animation.Stop(EndActions)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Animation / Animation.cs
1 /*
2  * Copyright(c) 2021 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
18 namespace Tizen.NUI
19 {
20     using System;
21     using System.ComponentModel;
22     using System.Runtime.InteropServices;
23     using System.Collections.Generic;
24     using System.Linq;
25     using System.Reflection;
26     using System.Globalization;
27     using System.Diagnostics.CodeAnalysis;
28
29     using Tizen.NUI.BaseComponents;
30
31     /// <summary>
32     /// Animation can be used to animate the properties of any number of objects, typically view.<br />
33     /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
34     /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
35     /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br />
36     /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
37     /// </summary>
38     /// <since_tizen> 3 </since_tizen>
39     public class Animation : BaseHandle
40     {
41         private static bool? disableAnimation = null;
42
43         private AnimationFinishedEventCallbackType animationFinishedEventCallback;
44         private System.IntPtr finishedCallbackOfNative;
45
46         private AnimationProgressReachedEventCallbackType animationProgressReachedEventCallback;
47
48         private string[] properties = null;
49         private string[] destValue = null;
50         private int[] startTime = null;
51         private int[] endTime = null;
52
53         private List<string> propertyList = null;
54         private List<string> destValueList = null;
55         private List<int> startTimeList = null;
56         private List<int> endTimeList = null;
57
58         /// <summary>
59         /// Creates an initialized animation.<br />
60         /// The animation will not loop.<br />
61         /// The default end action is "Cancel".<br />
62         /// The default alpha function is linear.<br />
63         /// </summary>
64         /// <remarks>DurationmSeconds must be greater than zero.</remarks>
65         /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
66         /// <since_tizen> 3 </since_tizen>
67         public Animation(int durationMilliSeconds) : this(Interop.Animation.New((float)durationMilliSeconds / 1000.0f), true)
68         {
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70         }
71
72         internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
73         {
74             animationFinishedEventCallback = OnFinished;
75             finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(animationFinishedEventCallback);
76         }
77
78         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79         private delegate void AnimationFinishedEventCallbackType(IntPtr data);
80
81         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82         private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
83
84         private event EventHandler animationFinishedEventHandler;
85
86         /// <summary>
87         /// Event for the finished signal which can be used to subscribe or unsubscribe the event handler.<br />
88         /// The finished signal is emitted when an animation's animations have finished.<br />
89         /// </summary>
90         /// <since_tizen> 3 </since_tizen>
91         public event EventHandler Finished
92         {
93             add
94             {
95                 if (animationFinishedEventHandler == null && disposed == false)
96                 {
97                     AnimationSignal finishedSignal = FinishedSignal();
98                     finishedSignal.Connect(finishedCallbackOfNative);
99                     finishedSignal.Dispose();
100                 }
101                 animationFinishedEventHandler += value;
102             }
103             remove
104             {
105                 animationFinishedEventHandler -= value;
106
107                 AnimationSignal finishedSignal = FinishedSignal();
108                 if (animationFinishedEventHandler == null && finishedSignal.Empty() == false)
109                 {
110                     finishedSignal.Disconnect(finishedCallbackOfNative);
111                 }
112                 finishedSignal.Dispose();
113             }
114         }
115
116         private event EventHandler animationProgressReachedEventHandler;
117
118         /// <summary>
119         /// Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.<br />
120         /// The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.<br />
121         /// </summary>
122         /// <remark>
123         /// This value only be applied if animation state is Stopped.
124         /// </remark>
125         /// <since_tizen> 3 </since_tizen>
126         public event EventHandler ProgressReached
127         {
128             add
129             {
130                 if (animationProgressReachedEventHandler == null)
131                 {
132                     animationProgressReachedEventCallback = OnProgressReached;
133                     AnimationSignal progressReachedSignal = ProgressReachedSignal();
134                     progressReachedSignal?.Connect(animationProgressReachedEventCallback);
135                     progressReachedSignal?.Dispose();
136                 }
137
138                 animationProgressReachedEventHandler += value;
139             }
140             remove
141             {
142                 animationProgressReachedEventHandler -= value;
143
144                 AnimationSignal progressReachedSignal = ProgressReachedSignal();
145                 if (animationProgressReachedEventHandler == null && progressReachedSignal?.Empty() == false)
146                 {
147                     progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
148                 }
149                 progressReachedSignal.Dispose();
150             }
151         }
152
153         /// <summary>
154         /// Enumeration for what to do when the animation ends, stopped, or destroyed.
155         /// </summary>
156         /// <since_tizen> 3 </since_tizen>
157         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
158         public enum EndActions
159         {
160             /// <summary>
161             /// When the animation ends, the animated property values are saved.
162             /// </summary>
163             Cancel,
164             /// <summary>
165             /// When the animation ends, the animated property values are forgotten.
166             /// </summary>
167             Discard,
168             /// <summary>
169             /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
170             /// </summary>
171             StopFinal
172         }
173
174         /// <summary>
175         /// Enumeration for what interpolation method to use on key-frame animations.
176         /// </summary>
177         /// <since_tizen> 3 </since_tizen>
178         public enum Interpolation
179         {
180             /// <summary>
181             /// Values in between key frames are interpolated using a linear polynomial. (Default)
182             /// </summary>
183             Linear,
184             /// <summary>
185             /// Values in between key frames are interpolated using a cubic polynomial.
186             /// </summary>
187             Cubic
188         }
189
190         /// <summary>
191         /// Enumeration for what state the animation is in.
192         /// </summary>
193         /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
194         /// <since_tizen> 3 </since_tizen>
195         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
196         public enum States
197         {
198             /// <summary>
199             /// The animation has stopped.
200             /// </summary>
201             Stopped,
202             /// <summary>
203             /// The animation is playing.
204             /// </summary>
205             Playing,
206             /// <summary>
207             /// The animation is paused.
208             /// </summary>
209             Paused
210         }
211
212         /// <summary>
213         /// Enumeration for what looping mode is in.
214         /// </summary>
215         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
216         [EditorBrowsable(EditorBrowsableState.Never)]
217         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
218         public enum LoopingModes
219         {
220             /// <summary>
221             /// When the animation arrives at the end in looping mode, the animation restarts from the beginning. (Default)
222             /// </summary>
223             /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
224             [EditorBrowsable(EditorBrowsableState.Never)]
225             Restart,
226             /// <summary>
227             /// When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
228             /// </summary>
229             /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
230             [EditorBrowsable(EditorBrowsableState.Never)]
231             AutoReverse
232         }
233
234         /// <summary>
235         /// Gets or sets the duration in milliseconds of the animation.
236         /// This duration is applied to the animations are added after the Duration is set.
237         /// </summary>
238         /// <example>
239         /// <code>
240         /// animation.AnimateTo(actor, "position", destination);
241         /// animation.Duration = 500; // This duration 500 is only applied to the size animation.
242         /// animation.AnimateTo(actor, "size", size);
243         /// </code>
244         /// </example>
245         /// <since_tizen> 3 </since_tizen>
246         public int Duration
247         {
248             set
249             {
250                 SetDuration(MilliSecondsToSeconds(value));
251             }
252             get
253             {
254                 return SecondsToMilliSeconds(GetDuration());
255             }
256         }
257
258         /// <summary>
259         /// Gets or sets the default alpha function for the animation.
260         /// This DefaultAlphaFunction is only applied to the animations are added after the DefaultAlphaFunction is set.
261         /// </summary>
262         /// <example>
263         /// <code>
264         /// animation.AnimateTo(actor, "position", destination);
265         /// animation.DefaultAlphaFunction = newAlphaFunction; // This newAlphaFunction is applied only for the size animation.
266         /// animation.AnimateTo(actor, "size", size);
267         /// </code>
268         /// </example>
269         /// <since_tizen> 3 </since_tizen>
270         public AlphaFunction DefaultAlphaFunction
271         {
272             set
273             {
274                 SetDefaultAlphaFunction(value);
275             }
276             get
277             {
278                 AlphaFunction ret = GetDefaultAlphaFunction();
279                 return ret;
280             }
281         }
282
283         /// <summary>
284         /// Queries the state of the animation.
285         /// </summary>
286         /// <since_tizen> 3 </since_tizen>
287         public States State
288         {
289             get
290             {
291                 return GetState();
292             }
293         }
294
295         /// <summary>
296         /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
297         /// This property resets the looping value and should not be used with the Looping property.<br />
298         /// Setting this parameter does not cause the animation to Play().<br />
299         /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
300         /// The loop count is initially 1 for play once.<br />
301         /// </summary>
302         /// <since_tizen> 3 </since_tizen>
303         public int LoopCount
304         {
305             set
306             {
307                 SetLoopCount(value);
308             }
309             get
310             {
311                 int ret = GetLoopCount();
312                 return ret;
313             }
314         }
315
316         /// <summary>
317         /// Gets or sets the status of whether the animation will loop.<br />
318         /// This property resets the loop count and should not be used with the LoopCount property.<br />
319         /// Setting this parameter does not cause the animation to Play().<br />
320         /// </summary>
321         /// <since_tizen> 3 </since_tizen>
322         public bool Looping
323         {
324             set
325             {
326                 SetLooping(value);
327             }
328             get
329             {
330                 bool ret = IsLooping();
331                 return ret;
332             }
333         }
334
335
336         /// <summary>
337         /// Gets or sets the end action of the animation.<br />
338         /// This action is performed when the animation ends or if it is stopped.<br />
339         /// The default end action is EndActions.Cancel.<br />
340         /// </summary>
341         /// <remark>
342         /// Change the action value from EndActions.Discard, or to EndActions.Discard during animation is playing / paused will not works well.
343         /// </remark>
344         /// <since_tizen> 3 </since_tizen>
345         public EndActions EndAction
346         {
347             set
348             {
349                 SetEndAction(value);
350             }
351             get
352             {
353                 return GetEndAction();
354             }
355         }
356
357         /// <summary>
358         /// Gets the current loop count.<br />
359         /// A value 0 indicating the current loop count when looping.<br />
360         /// </summary>
361         /// <since_tizen> 3 </since_tizen>
362         public int CurrentLoop
363         {
364             get
365             {
366                 return GetCurrentLoop();
367             }
368         }
369
370         /// <summary>
371         /// Gets or sets the disconnect action.<br />
372         /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
373         /// The default action is EndActions.StopFinal.<br />
374         /// </summary>
375         /// <since_tizen> 3 </since_tizen>
376         public EndActions DisconnectAction
377         {
378             set
379             {
380                 Interop.Animation.SetDisconnectAction(SwigCPtr, (int)value);
381                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382             }
383             get
384             {
385                 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(SwigCPtr);
386                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
387                 return ret;
388             }
389         }
390
391
392         /// <summary>
393         /// Gets or sets the progress of the animation.<br />
394         /// The animation will play (or continue playing) from this point.<br />
395         /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
396         /// otherwise, it will be ignored.<br />
397         /// </summary>
398         /// <since_tizen> 3 </since_tizen>
399         public float CurrentProgress
400         {
401             set
402             {
403                 Interop.Animation.SetCurrentProgress(SwigCPtr, value);
404                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405             }
406             get
407             {
408                 float ret = Interop.Animation.GetCurrentProgress(SwigCPtr);
409                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
410                 return ret;
411             }
412         }
413
414         /// <summary>
415         /// Gets or sets specifications of a speed factor for the animation.<br />
416         /// The speed factor is a multiplier of the normal velocity of the animation.<br />
417         /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
418         /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
419         /// </summary>
420         /// <since_tizen> 3 </since_tizen>
421         public float SpeedFactor
422         {
423             set
424             {
425                 Interop.Animation.SetSpeedFactor(SwigCPtr, value);
426                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427             }
428             get
429             {
430                 float ret = Interop.Animation.GetSpeedFactor(SwigCPtr);
431                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
432                 return ret;
433             }
434         }
435
436         /// <summary>
437         /// Gets or sets the playing range.<br />
438         /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
439         /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
440         /// </summary>
441         /// <since_tizen> 3 </since_tizen>
442         public RelativeVector2 PlayRange
443         {
444             set
445             {
446                 Interop.Animation.SetPlayRange(SwigCPtr, Vector2.getCPtr(value));
447                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
448             }
449             get
450             {
451                 Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(SwigCPtr), true);
452                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
453                 return ret;
454             }
455         }
456
457
458         /// <summary>
459         /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
460         /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30%<br />
461         /// One notification can be set on each animation.
462         /// </summary>
463         /// <remark>
464         /// This value only be applied if animation state is Stopped.
465         /// </remark>
466         /// <since_tizen> 3 </since_tizen>
467         public float ProgressNotification
468         {
469             set
470             {
471                 Interop.Animation.SetProgressNotification(SwigCPtr, value);
472                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473             }
474             get
475             {
476                 float ret = Interop.Animation.GetProgressNotification(SwigCPtr);
477                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
478                 return ret;
479             }
480         }
481
482         /// <summary>
483         /// Enumeration for what looping mode is in.
484         /// </summary>
485         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
486         [EditorBrowsable(EditorBrowsableState.Never)]
487         public LoopingModes LoopingMode
488         {
489             set
490             {
491                 Interop.Animation.SetLoopingMode(SwigCPtr, (int)value);
492                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493             }
494             get
495             {
496                 Animation.LoopingModes ret = (Animation.LoopingModes)Interop.Animation.GetLoopingMode(SwigCPtr);
497                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
498                 return ret;
499             }
500         }
501
502         /// <summary>
503         /// Sets and Gets the blend point to interpolate animate property
504         ///
505         /// BlendPoint is a value between [0,1], If the value of the keyframe whose progress is 0 is different from the current value,
506         /// the property is animated as it smoothly blends until the progress reaches the blendPoint.
507         /// </summary>
508         /// <remarks>
509         /// The blend point only affects animation registered with AnimateBetween. Other animations operate the same as when Play() is called.
510         /// And the blend point needs to be set before this animation plays. If the blend point changes after playback, animation continuity cannot be guaranteed.
511         /// </remarks>
512         /// <remarks>
513         /// In the case of a looping animation, the animation is blended only in the first loop.
514         /// </remarks>
515         [EditorBrowsable(EditorBrowsableState.Never)]
516         public float BlendPoint
517         {
518             set
519             {
520                 Interop.Animation.SetBlendPoint(SwigCPtr, value);
521                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522             }
523             get
524             {
525                 float ret = Interop.Animation.GetBlendPoint(SwigCPtr);
526                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
527                 return ret;
528             }
529         }
530
531         /// <summary>
532         /// Gets or sets the properties of the animation.
533         /// </summary>
534         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use PropertyList instead")]
535         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
536         public string[] Properties
537         {
538             get
539             {
540                 return properties;
541             }
542             set
543             {
544                 properties = value;
545             }
546         }
547
548         /// <summary>
549         /// Gets or sets the destination value for each property of the animation.
550         /// </summary>
551         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use DestValueList instead")]
552         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
553         public string[] DestValue
554         {
555             get
556             {
557                 return destValue;
558             }
559             set
560             {
561                 destValue = value;
562             }
563         }
564
565         /// <summary>
566         /// Gets or sets the start time for each property of the animation.
567         /// </summary>
568         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use StartTimeList instead")]
569         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
570         public int[] StartTime
571         {
572             get
573             {
574                 return startTime;
575             }
576             set
577             {
578                 startTime = value;
579             }
580         }
581
582         /// <summary>
583         /// Gets or sets the end time for each property of the animation.
584         /// </summary>
585         //ToDo : will raise deprecated-ACR, [Obsolete("Deprecated in API9, will be removed in API11, Use EndTimeList instead")]
586         [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "This API will be deprecated, so suppressing the warning for now")]
587         public int[] EndTime
588         {
589             get
590             {
591                 return endTime;
592             }
593             set
594             {
595                 endTime = value;
596             }
597         }
598
599         /// <summary>
600         /// Get the list of the properties of the animation.
601         /// </summary>
602         [EditorBrowsable(EditorBrowsableState.Never)]
603         public IList<string> PropertyList
604         {
605             get
606             {
607                 if (null == propertyList)
608                 {
609                     propertyList = new List<string>();
610                 }
611
612                 return propertyList;
613             }
614         }
615
616         /// <summary>
617         /// Get the list of the destination value for each property of the animation.
618         /// </summary>
619         [EditorBrowsable(EditorBrowsableState.Never)]
620         public IList<string> DestValueList
621         {
622             get
623             {
624                 if (null == destValueList)
625                 {
626                     destValueList = new List<string>();
627                 }
628
629                 return destValueList;
630             }
631         }
632
633         /// <summary>
634         /// Get the list of the start time for each property of the animation.
635         /// </summary>
636         [EditorBrowsable(EditorBrowsableState.Never)]
637         public IList<int> StartTimeList
638         {
639             get
640             {
641                 if (null == startTimeList)
642                 {
643                     startTimeList = new List<int>();
644                 }
645
646                 return startTimeList;
647             }
648         }
649
650         /// <summary>
651         /// Get the list of end time for each property of the animation.
652         /// </summary>
653         [EditorBrowsable(EditorBrowsableState.Never)]
654         public IList<int> EndTimeList
655         {
656             get
657             {
658                 if (null == endTimeList)
659                 {
660                     endTimeList = new List<int>();
661                 }
662
663                 return endTimeList;
664             }
665         }
666
667         private bool DisableAnimation
668         {
669             get
670             {
671                 if (disableAnimation.HasValue == false)
672                 {
673                     string type = Environment.GetEnvironmentVariable("PlatformSmartType");
674                     if (type == "Entry")
675                         disableAnimation = true;
676                     else
677                         disableAnimation = false;
678                 }
679                 return disableAnimation.Value;
680             }
681         }
682
683         /// <summary>
684         /// Downcasts a handle to animation handle.<br />
685         /// If handle points to an animation object, the downcast produces a valid handle.<br />
686         /// If not, the returned handle is left uninitialized.<br />
687         /// </summary>
688         /// <param name="handle">Handle to an object.</param>
689         /// <returns>Handle to an animation object or an uninitialized handle.</returns>
690         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
691         internal static Animation DownCast(BaseHandle handle)
692         {
693             if (handle == null)
694             {
695                 throw new ArgumentNullException(nameof(handle));
696             }
697             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
698             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
699             return ret;
700         }
701
702         /// <summary>
703         /// Stops the animation. It will change this animation's EndAction property.
704         /// </summary>
705         /// <remarks>
706         /// Change the value from EndActions.Discard, or to EndActions.Discard during animation is playing / paused will not works well.<br/>
707         /// If you want to stop by EndActions.Discard, EndAction property also should be EndActions.Discard before Play API called. <br/>
708         /// <br/>
709         /// This method is deprecated since API11 because EndActions property concept is not matched with Stop(). <br/>
710         /// Use <see cref="EndAction"/> property instead.
711         /// </remarks>
712         /// <param name="action">The end action can be set.</param>
713         /// <since_tizen> 3 </since_tizen>
714         [Obsolete("Deprecated in API11, will be removed in API13. Use EndAction property instead.")]
715         public void Stop(EndActions action)
716         {
717             SetEndAction(action);
718             Interop.Animation.Stop(SwigCPtr);
719             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
720         }
721
722         /// <summary>
723         /// Animates a property value by a relative amount.<br />
724         /// </summary>
725         /// <param name="target">The target animatable object to animate.</param>
726         /// <param name="property">The target property to animate.</param>
727         /// <param name="relativeValue">The property value will change by this amount.</param>
728         /// <param name="alphaFunction">The alpha function to apply.</param>
729         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
730         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
731         /// This will not be public opened.
732         [EditorBrowsable(EditorBrowsableState.Never)]
733         public void AnimateBy(Animatable target, string property, object relativeValue, AlphaFunction alphaFunction = null)
734         {
735             if (target == null)
736             {
737                 throw new ArgumentNullException(nameof(target));
738             }
739             if (property == null)
740             {
741                 throw new ArgumentNullException(nameof(property));
742             }
743             if (relativeValue == null)
744             {
745                 throw new ArgumentNullException(nameof(relativeValue));
746             }
747
748             using (var result = PropertyHelper.Search(target, property))
749             {
750                 if (result == null)
751                 {
752                     throw new ArgumentException("string property is invalid");
753                 }
754
755                 var current = result;
756                 while (current != null)
757                 {
758
759                     var targetValueIntPtr = current.RefineValueIntPtr(relativeValue);
760                     if (targetValueIntPtr == global::System.IntPtr.Zero)
761                     {
762                         throw new ArgumentException("Invalid " + nameof(relativeValue));
763                     }
764                     AnimateByIntPtr(current.Property, targetValueIntPtr, alphaFunction);
765                     Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
766                     current = current.NextResult;
767                 }
768             }
769         }
770
771         /// <summary>
772         /// Animates a property value by a relative amount.<br />
773         /// </summary>
774         /// <param name="target">The target animatable object to animate.</param>
775         /// <param name="property">The target property to animate.</param>
776         /// <param name="relativeValue">The property value will change by this amount.</param>
777         /// <param name="startTime">The start time of the animation.</param>
778         /// <param name="endTime">The end time of the animation.</param>
779         /// <param name="alphaFunction">The alpha function to apply.</param>
780         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
781         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
782         /// This will not be public opened.
783         [EditorBrowsable(EditorBrowsableState.Never)]
784         public void AnimateBy(Animatable target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
785         {
786             if (target == null)
787             {
788                 throw new ArgumentNullException(nameof(target));
789             }
790             if (property == null)
791             {
792                 throw new ArgumentNullException(nameof(property));
793             }
794             if (relativeValue == null)
795             {
796                 throw new ArgumentNullException(nameof(relativeValue));
797             }
798
799             using (var result = PropertyHelper.Search(target, property))
800             {
801                 if (result == null)
802                 {
803                     throw new ArgumentException("string property is invalid");
804                 }
805
806                 var current = result;
807                 using (var time = new TimePeriod(startTime, endTime - startTime))
808                     while (current != null)
809                     {
810
811                         var targetValueIntPtr = current.RefineValueIntPtr(relativeValue);
812                         if (targetValueIntPtr == global::System.IntPtr.Zero)
813                         {
814                             throw new ArgumentException("Invalid " + nameof(relativeValue));
815                         }
816                         AnimateByIntPtr(current.Property, targetValueIntPtr, alphaFunction, time);
817                         Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
818                         current = current.NextResult;
819                     }
820             }
821         }
822
823         /// <summary>
824         /// Animates a property value by a relative amount.<br />
825         /// </summary>
826         /// <param name="target">The target object to animate.</param>
827         /// <param name="property">The target property to animate.</param>
828         /// <param name="relativeValue">The property value will change by this amount.</param>
829         /// <param name="alphaFunction">The alpha function to apply.</param>
830         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
831         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
832         /// <since_tizen> 3 </since_tizen>
833         public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
834         {
835             AnimateBy(target as Animatable, property, relativeValue, alphaFunction);
836         }
837
838         /// <summary>
839         /// Animates a property value by a relative amount.<br />
840         /// </summary>
841         /// <param name="target">The target object to animate.</param>
842         /// <param name="property">The target property to animate.</param>
843         /// <param name="relativeValue">The property value will change by this amount.</param>
844         /// <param name="startTime">The start time of the animation.</param>
845         /// <param name="endTime">The end time of the animation.</param>
846         /// <param name="alphaFunction">The alpha function to apply.</param>
847         /// <exception cref="ArgumentNullException"> Thrown when target or property or relativeValue is null. </exception>
848         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given relativeValue is invalid format. </exception>
849         /// <since_tizen> 3 </since_tizen>
850         public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
851         {
852             AnimateBy(target as Animatable, property, relativeValue, startTime, endTime, alphaFunction);
853         }
854
855         /// <summary>
856         /// Animates a property to a destination value.<br />
857         /// </summary>
858         /// <param name="target">The target animatable object to animate.</param>
859         /// <param name="property">The target property to animate.</param>
860         /// <param name="destinationValue">The destination value.</param>
861         /// <param name="alphaFunction">The alpha function to apply.</param>
862         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
863         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
864         /// This will not be public opened.
865         [EditorBrowsable(EditorBrowsableState.Never)]
866         public void AnimateTo(Animatable target, string property, object destinationValue, AlphaFunction alphaFunction = null)
867         {
868             if (target == null)
869             {
870                 throw new ArgumentNullException(nameof(target));
871             }
872             if (property == null)
873             {
874                 throw new ArgumentNullException(nameof(property));
875             }
876             if (destinationValue == null)
877             {
878                 throw new ArgumentNullException(nameof(destinationValue));
879             }
880
881             using (var result = PropertyHelper.Search(target, property))
882             {
883                 if (result == null)
884                 {
885                     throw new ArgumentException("string property is invalid");
886                 }
887
888                 var current = result;
889                 while (current != null)
890                 {
891
892                     var targetValueIntPtr = current.RefineValueIntPtr(destinationValue);
893                     if (targetValueIntPtr == global::System.IntPtr.Zero)
894                     {
895                         throw new ArgumentException("Invalid " + nameof(destinationValue));
896                     }
897                     AnimateToIntPtr(current.Property, targetValueIntPtr, alphaFunction);
898                     Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
899                     current = current.NextResult;
900                 }
901             }
902         }
903
904         /// <summary>
905         /// Animates a property to a destination value.<br />
906         /// </summary>
907         /// <param name="target">The target animatable object to animate.</param>
908         /// <param name="property">The target property to animate.</param>
909         /// <param name="destinationValue">The destination value.</param>
910         /// <param name="startTime">The start time of the animation.</param>
911         /// <param name="endTime">The end time of the animation.</param>
912         /// <param name="alphaFunction">The alpha function to apply.</param>
913         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
914         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
915         /// This will not be public opened.
916         [EditorBrowsable(EditorBrowsableState.Never)]
917         public void AnimateTo(Animatable target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
918         {
919             if (target == null)
920             {
921                 throw new ArgumentNullException(nameof(target));
922             }
923             if (property == null)
924             {
925                 throw new ArgumentNullException(nameof(property));
926             }
927             if (destinationValue == null)
928             {
929                 throw new ArgumentNullException(nameof(destinationValue));
930             }
931
932             using (var result = PropertyHelper.Search(target, property))
933             {
934                 if (result == null)
935                 {
936                     throw new ArgumentException("string property is invalid");
937                 }
938
939                 var current = result;
940                 using (var time = new TimePeriod(startTime, endTime - startTime))
941                     while (current != null)
942                     {
943 #if NUI_ANIMATION_PROPERTY_CHANGE_1
944                         var targetValueIntPtr = current.RefineValueIntPtr(destinationValue);
945                         if (targetValueIntPtr == global::System.IntPtr.Zero)
946                         {
947                             throw new ArgumentException("Invalid " + nameof(destinationValue));
948                         }
949                         AnimateToIntPtr(current.Property, targetValueIntPtr, alphaFunction, time);
950                         Interop.PropertyValue.DeletePropertyValueIntPtr(targetValueIntPtr);
951 #else
952                         var targetValue = current.RefineValue(destinationValue) ?? throw new ArgumentException("Invalid " + nameof(destinationValue));
953                         AnimateTo(current.Property, targetValue, alphaFunction, time);
954                         targetValue.Dispose();
955 #endif
956                         current = current.NextResult;
957                     }
958             }
959         }
960
961         /// <summary>
962         /// Animates a property to a destination value.<br />
963         /// </summary>
964         /// <param name="target">The target object to animate.</param>
965         /// <param name="property">The target property to animate.</param>
966         /// <param name="destinationValue">The destination value.</param>
967         /// <param name="alphaFunction">The alpha function to apply.</param>
968         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
969         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
970         /// <since_tizen> 3 </since_tizen>
971         public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
972         {
973             AnimateTo(target as Animatable, property, destinationValue, alphaFunction);
974         }
975
976         /// <summary>
977         /// Animates a property to a destination value.<br />
978         /// </summary>
979         /// <param name="target">The target object to animate.</param>
980         /// <param name="property">The target property to animate.</param>
981         /// <param name="destinationValue">The destination value.</param>
982         /// <param name="startTime">The start time of the animation.</param>
983         /// <param name="endTime">The end time of the animation.</param>
984         /// <param name="alphaFunction">The alpha function to apply.</param>
985         /// <exception cref="ArgumentNullException"> Thrown when target or property or destinationValue is null. </exception>
986         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given destinationValue is invalid format. </exception>
987         /// <since_tizen> 3 </since_tizen>
988         public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
989         {
990             AnimateTo(target as Animatable, property, destinationValue, startTime, endTime, alphaFunction);
991         }
992
993         /// <summary>
994         /// Animates one or more properties to a destination value.<br />
995         /// </summary>
996         /// <param name="target">The target object to animate.</param>
997         /// <exception cref="ArgumentNullException"> Thrown when target is null. </exception>
998         public void PlayAnimateTo(View target)
999         {
1000             if (target == null)
1001             {
1002                 throw new ArgumentNullException(nameof(target));
1003             }
1004
1005             Clear();
1006
1007             if (null != propertyList && null != destValueList && null != startTimeList && null != endTimeList)
1008             {
1009                 if (propertyList.Count == destValueList.Count
1010                     &&
1011                     startTimeList.Count == endTimeList.Count
1012                     &&
1013                     propertyList.Count == startTimeList.Count)
1014                 {
1015                     int count = propertyList.Count;
1016                     for (int index = 0; index < count; index++)
1017                     {
1018                         var elementType = target.GetType();
1019                         PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == propertyList[index]);
1020
1021                         if (propertyInfo != null)
1022                         {
1023                             object destinationValue = ConvertTo(destValueList[index], propertyInfo.PropertyType);
1024
1025                             if (destinationValue != null)
1026                             {
1027                                 AnimateTo(target, propertyList[index], destinationValue, startTimeList[index], endTimeList[index]);
1028                             }
1029                         }
1030                     }
1031                     Play();
1032                 }
1033             }
1034             else
1035             {
1036                 if (properties.Length == destValue.Length && startTime.Length == endTime.Length && properties.Length == startTime.Length)
1037                 {
1038                     int length = properties.Length;
1039                     for (int index = 0; index < length; index++)
1040                     {
1041                         //object destinationValue = _destValue[index];
1042                         var elementType = target.GetType();
1043                         PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == properties[index]);
1044                         //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
1045                         if (propertyInfo != null)
1046                         {
1047                             object destinationValue = ConvertTo(destValue[index], propertyInfo.PropertyType);
1048
1049                             if (destinationValue != null)
1050                             {
1051                                 AnimateTo(target, properties[index], destinationValue, startTime[index], endTime[index]);
1052                             }
1053                         }
1054                     }
1055                     Play();
1056                 }
1057             }
1058         }
1059
1060         /// <summary>
1061         /// Animates a property between keyframes.
1062         /// </summary>
1063         /// <param name="target">The target animatable object to animate.</param>
1064         /// <param name="property">The target property to animate.</param>
1065         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
1066         /// <param name="interpolation">The method used to interpolate between values.</param>
1067         /// <param name="alphaFunction">The alpha function to apply.</param>
1068         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1069         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1070         /// This will not be public opened.
1071         [EditorBrowsable(EditorBrowsableState.Never)]
1072         public void AnimateBetween(Animatable target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1073         {
1074             if (target == null)
1075             {
1076                 throw new ArgumentNullException(nameof(target));
1077             }
1078             if (property == null)
1079             {
1080                 throw new ArgumentNullException(nameof(property));
1081             }
1082             if (keyFrames == null)
1083             {
1084                 throw new ArgumentNullException(nameof(keyFrames));
1085             }
1086
1087             using (var result = PropertyHelper.Search(target, property))
1088             {
1089                 if (result == null)
1090                 {
1091                     throw new ArgumentException("string property is invalid");
1092                 }
1093
1094                 var current = result;
1095                 while (current != null)
1096                 {
1097                     // NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
1098                     AnimateBetween(current.Property, current.RefineKeyFrames(keyFrames) ?? throw new ArgumentException("Invalid " + nameof(keyFrames)), alphaFunction, interpolation);
1099                     current = current.NextResult;
1100                 }
1101             }
1102         }
1103
1104         /// <summary>
1105         /// Animates a property between keyframes.
1106         /// </summary>
1107         /// <param name="target">The target animatable object to animate</param>
1108         /// <param name="property">The target property to animate</param>
1109         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
1110         /// <param name="startTime">The start time of animation in milliseconds.</param>
1111         /// <param name="endTime">The end time of animation in milliseconds.</param>
1112         /// <param name="interpolation">The method used to interpolate between values.</param>
1113         /// <param name="alphaFunction">The alpha function to apply.</param>
1114         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1115         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1116         /// This will not be public opened.
1117         [EditorBrowsable(EditorBrowsableState.Never)]
1118         public void AnimateBetween(Animatable target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1119         {
1120             if (target == null)
1121             {
1122                 throw new ArgumentNullException(nameof(target));
1123             }
1124             if (property == null)
1125             {
1126                 throw new ArgumentNullException(nameof(property));
1127             }
1128             if (keyFrames == null)
1129             {
1130                 throw new ArgumentNullException(nameof(keyFrames));
1131             }
1132
1133             using (var result = PropertyHelper.Search(target, property))
1134             {
1135                 if (result == null)
1136                 {
1137                     throw new ArgumentException("string property is invalid");
1138                 }
1139
1140                 var current = result;
1141                 using (var time = new TimePeriod(startTime, endTime - startTime))
1142                     while (current != null)
1143                     {
1144                         // NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
1145                         AnimateBetween(current.Property, current.RefineKeyFrames(keyFrames) ?? throw new ArgumentException("Invalid " + nameof(keyFrames)), alphaFunction, time, interpolation);
1146                         current = current.NextResult;
1147                     }
1148             }
1149         }
1150
1151         /// <summary>
1152         /// Animates a property between keyframes.
1153         /// </summary>
1154         /// <param name="target">The target object to animate.</param>
1155         /// <param name="property">The target property to animate.</param>
1156         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
1157         /// <param name="interpolation">The method used to interpolate between values.</param>
1158         /// <param name="alphaFunction">The alpha function to apply.</param>
1159         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1160         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1161         /// <since_tizen> 3 </since_tizen>
1162         public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1163         {
1164             AnimateBetween(target as Animatable, property, keyFrames, interpolation, alphaFunction);
1165         }
1166
1167         /// <summary>
1168         /// Animates a property between keyframes.
1169         /// </summary>
1170         /// <param name="target">The target object to animate</param>
1171         /// <param name="property">The target property to animate</param>
1172         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
1173         /// <param name="startTime">The start time of animation in milliseconds.</param>
1174         /// <param name="endTime">The end time of animation in milliseconds.</param>
1175         /// <param name="interpolation">The method used to interpolate between values.</param>
1176         /// <param name="alphaFunction">The alpha function to apply.</param>
1177         /// <exception cref="ArgumentNullException"> Thrown when target or property or keyFrames is null. </exception>
1178         /// <exception cref="ArgumentException"> Thrown when it failed to find a property from given string or the given keyFrames has invalid value. </exception>
1179         /// <since_tizen> 3 </since_tizen>
1180         public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
1181         {
1182             AnimateBetween(target as Animatable, property, keyFrames, startTime, endTime, interpolation, alphaFunction);
1183         }
1184
1185         /// <summary>
1186         /// Animates the view's position and orientation through a predefined path.<br />
1187         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
1188         /// If forward is the zero vector then no rotation will happen.<br />
1189         /// </summary>
1190         /// <param name="view">The view to animate.</param>
1191         /// <param name="path">It defines position and orientation.</param>
1192         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
1193         /// <param name="alphaFunction">The alpha function to apply.</param>
1194         /// <since_tizen> 3 </since_tizen>
1195         public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
1196         {
1197             if (alphaFunction == null)
1198             {
1199                 Animate(view, path, forward);
1200             }
1201             else
1202             {
1203                 Animate(view, path, forward, alphaFunction);
1204             }
1205         }
1206
1207         /// <summary>
1208         /// Animates the view's position and orientation through a predefined path.<br />
1209         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
1210         /// If forward is the zero vector then no rotation will happen.<br />
1211         /// </summary>
1212         /// <param name="view">The view to animate.</param>
1213         /// <param name="path">It defines position and orientation.</param>
1214         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
1215         /// <param name="startTime">The start time of the animation.</param>
1216         /// <param name="endTime">The end time of the animation.</param>
1217         /// <param name="alphaFunction">The alpha function to apply.</param>
1218         /// <since_tizen> 3 </since_tizen>
1219         public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
1220         {
1221             TimePeriod time = new TimePeriod(startTime, endTime - startTime);
1222             if (alphaFunction == null)
1223             {
1224                 Animate(view, path, forward, time);
1225             }
1226             else
1227             {
1228                 Animate(view, path, forward, alphaFunction, time);
1229             }
1230             time.Dispose();
1231         }
1232
1233         /// <summary>
1234         /// Creates an initialized animation.<br />
1235         /// The animation will not loop.<br />
1236         /// The default end action is "Cancel".<br />
1237         /// The default alpha function is linear.<br />
1238         /// </summary>
1239         /// <since_tizen> 3 </since_tizen>
1240         public Animation() : this(Interop.Animation.New(0.0f), true)
1241         {
1242             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1243         }
1244
1245         /// <summary>
1246         /// Plays the animation.
1247         /// </summary>
1248         /// <since_tizen> 3 </since_tizen>
1249         public void Play()
1250         {
1251             Interop.Animation.Play(SwigCPtr);
1252             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1253
1254             if (DisableAnimation == true)
1255                 Stop(EndActions.StopFinal);
1256         }
1257
1258         /// <summary>
1259         /// Plays the animation from a given point.<br />
1260         /// The progress must be in the 0-1 interval or in the play range interval if defined,
1261         /// otherwise, it will be ignored.<br />
1262         /// </summary>
1263         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
1264         /// <since_tizen> 3 </since_tizen>
1265         public void PlayFrom(float progress)
1266         {
1267             Interop.Animation.PlayFrom(SwigCPtr, progress);
1268             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1269         }
1270
1271         /// <summary>
1272         /// Plays the animation after a given delay time.<br/>
1273         /// The delay time is not included in the looping time.<br/>
1274         /// When the delay time is a negative value, it would treat as play immediately.<br/>
1275         /// </summary>
1276         /// <param name="delayMilliseconds">The delay time.</param>
1277         /// <since_tizen> 4 </since_tizen>
1278         public void PlayAfter(int delayMilliseconds)
1279         {
1280             Interop.Animation.PlayAfter(SwigCPtr, MilliSecondsToSeconds(delayMilliseconds));
1281             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1282         }
1283
1284         /// <summary>
1285         /// Pauses the animation.
1286         /// </summary>
1287         /// <since_tizen> 3 </since_tizen>
1288         public void Pause()
1289         {
1290             Interop.Animation.Pause(SwigCPtr);
1291             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1292         }
1293
1294         /// <summary>
1295         /// Stops the animation.
1296         /// </summary>
1297         /// <since_tizen> 3 </since_tizen>
1298         public void Stop()
1299         {
1300             Interop.Animation.Stop(SwigCPtr);
1301             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1302         }
1303
1304         /// <summary>
1305         /// Clears the animation.<br />
1306         /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
1307         /// </summary>
1308         /// <since_tizen> 3 </since_tizen>
1309         public void Clear()
1310         {
1311             Interop.Animation.Clear(SwigCPtr);
1312             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1313         }
1314
1315         internal object ConvertTo(object value, Type toType)
1316         {
1317             Func<object> getConverter = () =>
1318             {
1319                 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
1320                 if (converterTypeName == null)
1321                     return null;
1322
1323                 Type convertertype = Type.GetType(converterTypeName);
1324                 return Activator.CreateInstance(convertertype);
1325             };
1326
1327             return ConvertTo(value, toType, getConverter);
1328         }
1329
1330         internal object ConvertTo(object value, Type toType, Func<object> getConverter)
1331         {
1332             if (value == null)
1333                 return null;
1334
1335             var str = value as string;
1336             if (str != null)
1337             {
1338                 //If there's a [TypeConverter], use it
1339                 object converter = getConverter?.Invoke();
1340                 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
1341                 if (xfTypeConverter != null)
1342                     return value = xfTypeConverter.ConvertFromInvariantString(str);
1343                 var converterType = converter?.GetType();
1344                 if (converterType != null)
1345                 {
1346                     var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
1347                         new[] { typeof(string) });
1348                     if (convertFromStringInvariant != null)
1349                         return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
1350                 }
1351
1352                 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
1353                 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
1354                     toType = Nullable.GetUnderlyingType(toType);
1355
1356                 //Obvious Built-in conversions
1357                 if (toType.GetTypeInfo().IsEnum)
1358                     return Enum.Parse(toType, str, true);
1359                 if (toType == typeof(SByte))
1360                     return SByte.Parse(str, CultureInfo.InvariantCulture);
1361                 if (toType == typeof(Int16))
1362                     return Int16.Parse(str, CultureInfo.InvariantCulture);
1363                 if (toType == typeof(Int32))
1364                     return Int32.Parse(str, CultureInfo.InvariantCulture);
1365                 if (toType == typeof(Int64))
1366                     return Int64.Parse(str, CultureInfo.InvariantCulture);
1367                 if (toType == typeof(Byte))
1368                     return Byte.Parse(str, CultureInfo.InvariantCulture);
1369                 if (toType == typeof(UInt16))
1370                     return UInt16.Parse(str, CultureInfo.InvariantCulture);
1371                 if (toType == typeof(UInt32))
1372                     return UInt32.Parse(str, CultureInfo.InvariantCulture);
1373                 if (toType == typeof(UInt64))
1374                     return UInt64.Parse(str, CultureInfo.InvariantCulture);
1375                 if (toType == typeof(Single))
1376                     return Single.Parse(str, CultureInfo.InvariantCulture);
1377                 if (toType == typeof(Double))
1378                     return Double.Parse(str, CultureInfo.InvariantCulture);
1379                 if (toType == typeof(Boolean))
1380                     return Boolean.Parse(str);
1381                 if (toType == typeof(TimeSpan))
1382                     return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
1383                 if (toType == typeof(DateTime))
1384                     return DateTime.Parse(str, CultureInfo.InvariantCulture);
1385                 if (toType == typeof(Char))
1386                 {
1387                     char c = '\0';
1388                     _ = Char.TryParse(str, out c);
1389                     return c;
1390                 }
1391                 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
1392                     return str.Substring(2);
1393                 if (toType == typeof(String))
1394                     return value;
1395                 if (toType == typeof(Decimal))
1396                     return Decimal.Parse(str, CultureInfo.InvariantCulture);
1397             }
1398
1399             //if the value is not assignable and there's an implicit conversion, convert
1400             if (value != null && !toType.IsAssignableFrom(value.GetType()))
1401             {
1402                 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
1403                                  ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
1404                 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
1405                 //                ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
1406
1407                 if (opImplicit != null)
1408                 {
1409                     value = opImplicit.Invoke(null, new[] { value });
1410                     return value;
1411                 }
1412             }
1413
1414             return value;
1415         }
1416
1417         internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
1418         {
1419             var converterAttribute =
1420                 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
1421             if (converterAttribute == null)
1422                 return null;
1423             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
1424                 return (string)converterAttribute.ConstructorArguments[0].Value;
1425             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
1426                 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
1427             return null;
1428         }
1429
1430         internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
1431         {
1432 #if NETSTANDARD1_0
1433             var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
1434 #else
1435             var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
1436             var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
1437 #endif
1438             if (mi == null) return null;
1439             if (!mi.IsSpecialName) return null;
1440             if (!mi.IsPublic) return null;
1441             if (!mi.IsStatic) return null;
1442             if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
1443
1444             return mi;
1445         }
1446
1447         internal Animation(float durationSeconds) : this(Interop.Animation.New(durationSeconds), true)
1448         {
1449             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1450
1451         }
1452
1453         internal Animation(Animation handle) : this(Interop.Animation.NewAnimation(Animation.getCPtr(handle)), true)
1454         {
1455             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1456         }
1457
1458         internal Animation Assign(Animation rhs)
1459         {
1460             Animation ret = new Animation(Interop.Animation.Assign(SwigCPtr, Animation.getCPtr(rhs)), false);
1461             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1462             return ret;
1463         }
1464
1465         internal void SetDuration(float seconds)
1466         {
1467             Interop.Animation.SetDuration(SwigCPtr, seconds);
1468             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1469         }
1470
1471         internal float GetDuration()
1472         {
1473             float ret = Interop.Animation.GetDuration(SwigCPtr);
1474             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1475             return ret;
1476         }
1477
1478         internal void SetLooping(bool looping)
1479         {
1480             Interop.Animation.SetLooping(SwigCPtr, looping);
1481             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1482         }
1483
1484         internal void SetLoopCount(int count)
1485         {
1486             Interop.Animation.SetLoopCount(SwigCPtr, count);
1487             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1488         }
1489
1490         internal int GetLoopCount()
1491         {
1492             int ret = Interop.Animation.GetLoopCount(SwigCPtr);
1493             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1494             return ret;
1495         }
1496
1497         internal int GetCurrentLoop()
1498         {
1499             int ret = Interop.Animation.GetCurrentLoop(SwigCPtr);
1500             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1501             return ret;
1502         }
1503
1504         internal bool IsLooping()
1505         {
1506             bool ret = Interop.Animation.IsLooping(SwigCPtr);
1507             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1508             return ret;
1509         }
1510
1511         internal void SetEndAction(Animation.EndActions action)
1512         {
1513             Interop.Animation.SetEndAction(SwigCPtr, (int)action);
1514             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1515         }
1516
1517         internal Animation.EndActions GetEndAction()
1518         {
1519             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetEndAction(SwigCPtr);
1520             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1521             return ret;
1522         }
1523
1524         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1525         {
1526             Interop.Animation.SetDisconnectAction(SwigCPtr, (int)disconnectAction);
1527             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1528         }
1529
1530         internal Animation.EndActions GetDisconnectAction()
1531         {
1532             Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(SwigCPtr);
1533             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1534             return ret;
1535         }
1536
1537         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1538         {
1539             Interop.Animation.SetDefaultAlphaFunction(SwigCPtr, AlphaFunction.getCPtr(alpha));
1540             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1541         }
1542
1543         internal AlphaFunction GetDefaultAlphaFunction()
1544         {
1545             AlphaFunction ret = new AlphaFunction(Interop.Animation.GetDefaultAlphaFunction(SwigCPtr), true);
1546             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1547             return ret;
1548         }
1549
1550         internal void SetCurrentProgress(float progress)
1551         {
1552             Interop.Animation.SetCurrentProgress(SwigCPtr, progress);
1553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1554         }
1555
1556         internal float GetCurrentProgress()
1557         {
1558             float ret = Interop.Animation.GetCurrentProgress(SwigCPtr);
1559             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1560             return ret;
1561         }
1562
1563         internal void SetSpeedFactor(float factor)
1564         {
1565             Interop.Animation.SetSpeedFactor(SwigCPtr, factor);
1566             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1567         }
1568
1569         internal float GetSpeedFactor()
1570         {
1571             float ret = Interop.Animation.GetSpeedFactor(SwigCPtr);
1572             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1573             return ret;
1574         }
1575
1576         internal void SetPlayRange(Vector2 range)
1577         {
1578             Interop.Animation.SetPlayRange(SwigCPtr, Vector2.getCPtr(range));
1579             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1580         }
1581
1582         internal Vector2 GetPlayRange()
1583         {
1584             Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(SwigCPtr), true);
1585             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1586             return ret;
1587         }
1588
1589         internal Animation.States GetState()
1590         {
1591             Animation.States ret = (Animation.States)Interop.Animation.GetState(SwigCPtr);
1592             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1593             return ret;
1594         }
1595
1596         internal AnimationSignal FinishedSignal()
1597         {
1598             AnimationSignal ret = new AnimationSignal(Interop.Animation.FinishedSignal(SwigCPtr), false);
1599             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1600             return ret;
1601         }
1602
1603         internal AnimationSignal ProgressReachedSignal()
1604         {
1605             AnimationSignal ret = new AnimationSignal(Interop.Animation.ProgressReachedSignal(SwigCPtr), false);
1606             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1607             return ret;
1608         }
1609
1610         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1611         {
1612             if (alpha == null)
1613             {
1614                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1615             }
1616             else
1617             {
1618                 Interop.Animation.AnimateByAlphaFunction(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1619             }
1620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1621         }
1622
1623         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1624         {
1625             if (alpha == null)
1626             {
1627                 Interop.Animation.AnimateByTimePeriod(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1628             }
1629             else
1630             {
1631                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1632             }
1633             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1634         }
1635
1636         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1637         {
1638             if (alpha == null)
1639             {
1640                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1641             }
1642             else
1643             {
1644                 Interop.Animation.AnimateToAlphaFunction(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1645             }
1646             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1647         }
1648
1649         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1650         {
1651             if (alpha == null)
1652             {
1653                 Interop.Animation.AnimateToTimePeriod(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1654             }
1655             else
1656             {
1657                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1658             }
1659             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1660         }
1661
1662
1663         internal void AnimateByIntPtr(Property target, global::System.IntPtr relativeValueIntPtr, AlphaFunction alpha)
1664         {
1665             if (alpha == null)
1666             {
1667                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr);
1668             }
1669             else
1670             {
1671                 Interop.Animation.AnimateByAlphaFunction(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, AlphaFunction.getCPtr(alpha));
1672             }
1673             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1674         }
1675
1676         internal void AnimateByIntPtr(Property target, global::System.IntPtr relativeValueIntPtr, AlphaFunction alpha, TimePeriod period)
1677         {
1678             if (alpha == null)
1679             {
1680                 Interop.Animation.AnimateByTimePeriod(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, TimePeriod.getCPtr(period));
1681             }
1682             else
1683             {
1684                 Interop.Animation.AnimateBy(SwigCPtr, Property.getCPtr(target), relativeValueIntPtr, AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1685             }
1686             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1687         }
1688
1689         internal void AnimateToIntPtr(Property target, global::System.IntPtr destinationValueIntPtr, AlphaFunction alpha)
1690         {
1691             if (alpha == null)
1692             {
1693                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr);
1694             }
1695             else
1696             {
1697                 Interop.Animation.AnimateToAlphaFunction(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, AlphaFunction.getCPtr(alpha));
1698             }
1699             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1700         }
1701
1702         internal void AnimateToIntPtr(Property target, global::System.IntPtr destinationValueIntPtr, AlphaFunction alpha, TimePeriod period)
1703         {
1704             if (alpha == null)
1705             {
1706                 Interop.Animation.AnimateToTimePeriod(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, TimePeriod.getCPtr(period));
1707             }
1708             else
1709             {
1710                 Interop.Animation.AnimateTo(SwigCPtr, Property.getCPtr(target), destinationValueIntPtr, AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1711             }
1712             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1713         }
1714
1715         internal void AnimateBetween(Property target, KeyFrames keyFrames)
1716         {
1717             Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1718             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1719         }
1720
1721         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1722         {
1723             Interop.Animation.AnimateBetweenAlphaFunction(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1724             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1725         }
1726
1727         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1728         {
1729             if (alpha == null)
1730             {
1731                 Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1732             }
1733             else
1734             {
1735                 Interop.Animation.AnimateBetweenAlphaFunctionInterpolation(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1736             }
1737             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1738         }
1739
1740         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1741         {
1742             Interop.Animation.AnimateBetweenTimePeriod(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1743             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1744         }
1745
1746         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1747         {
1748             Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1749             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1750         }
1751
1752         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1753         {
1754             if (alpha == null)
1755             {
1756                 Interop.Animation.AnimateBetweenTimePeriodInterpolation(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1757             }
1758             else
1759             {
1760                 Interop.Animation.AnimateBetween(SwigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1761             }
1762             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1763         }
1764
1765         internal void Animate(View view, Path path, Vector3 forward)
1766         {
1767             Interop.Animation.Animate(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1768             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1769         }
1770
1771         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1772         {
1773             Interop.Animation.AnimateAlphaFunction(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1774             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1775         }
1776
1777         internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1778         {
1779             Interop.Animation.AnimateTimePeriod(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1780             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1781         }
1782
1783         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1784         {
1785             Interop.Animation.Animate(SwigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1786             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1787         }
1788
1789         internal void Show(View view, float delaySeconds)
1790         {
1791             Interop.Animation.Show(SwigCPtr, View.getCPtr(view), delaySeconds);
1792             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1793         }
1794
1795         internal void Hide(View view, float delaySeconds)
1796         {
1797             Interop.Animation.Hide(SwigCPtr, View.getCPtr(view), delaySeconds);
1798             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1799         }
1800
1801         /// <summary>
1802         /// To make animation instance be disposed.
1803         /// </summary>
1804         /// <since_tizen> 3 </since_tizen>
1805         protected override void Dispose(DisposeTypes type)
1806         {
1807             if (disposed)
1808             {
1809                 return;
1810             }
1811
1812             if (animationFinishedEventHandler != null)
1813             {
1814                 AnimationSignal finishedSignal = FinishedSignal();
1815                 finishedSignal?.Disconnect(finishedCallbackOfNative);
1816                 finishedSignal?.Dispose();
1817                 animationFinishedEventHandler = null;
1818             }
1819
1820             if (animationProgressReachedEventCallback != null)
1821             {
1822                 AnimationSignal progressReachedSignal = ProgressReachedSignal();
1823                 progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
1824                 progressReachedSignal?.Dispose();
1825                 animationProgressReachedEventCallback = null;
1826             }
1827
1828             base.Dispose(type);
1829         }
1830
1831         /// This will not be public opened.
1832         [EditorBrowsable(EditorBrowsableState.Never)]
1833         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1834         {
1835             if (swigCPtr.Handle == IntPtr.Zero || Disposed)
1836             {
1837                 Tizen.Log.Fatal("NUI", $"[ERROR] Animation ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} Disposed={Disposed}");
1838                 return;
1839             }
1840             Interop.Animation.DeleteAnimation(swigCPtr);
1841         }
1842
1843         private void OnFinished(IntPtr data)
1844         {
1845             if (animationFinishedEventHandler != null)
1846             {
1847                 //here we send all data to user event handlers
1848                 animationFinishedEventHandler(this, null);
1849             }
1850         }
1851
1852         private void OnProgressReached(IntPtr data)
1853         {
1854             if (animationProgressReachedEventHandler != null)
1855             {
1856                 //here we send all data to user event handlers
1857                 animationProgressReachedEventHandler(this, null);
1858             }
1859         }
1860
1861         private float MilliSecondsToSeconds(int millisec)
1862         {
1863             return (float)millisec / 1000.0f;
1864         }
1865
1866         private int SecondsToMilliSeconds(float sec)
1867         {
1868             return (int)(sec * 1000);
1869         }
1870     }
1871 }