57b41a4db42c573aaedba1959eddbfbf8ed2078f
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Animation.cs
1 /*
2  * Copyright(c) 2017 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
21     using System;
22     using System.ComponentModel;
23     using System.Runtime.InteropServices;
24     using Tizen.NUI.BaseComponents;
25
26     using System.Collections;
27     using System.Collections.Generic;
28     using System.Linq;
29     using System.Reflection;
30     using System.Xml;
31     using Tizen.NUI.Binding.Internals;
32     using Tizen.NUI.Binding;
33     using System.Globalization;
34     using Tizen.NUI.Xaml.Internals;
35
36     /// <summary>
37     /// Animation can be used to animate the properties of any number of objects, typically view.<br />
38     /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
39     /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
40     /// 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 />
41     /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
42     /// </summary>
43     /// <since_tizen> 3 </since_tizen>
44     public class Animation : BaseHandle
45     {
46         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
47
48         internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
49         {
50             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
51
52             _animationFinishedEventCallback = OnFinished;
53             _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
54         }
55
56         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
57         {
58             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
59         }
60
61         /// <summary>
62         /// To make animation instance be disposed.
63         /// </summary>
64         /// <since_tizen> 3 </since_tizen>
65         protected override void Dispose(DisposeTypes type)
66         {
67             if (this != null)
68             {
69                 if (_animationFinishedEventCallback != null)
70                 {
71                     FinishedSignal().Disconnect(_finishedCallbackOfNative);
72                 }
73
74                 if (_animationProgressReachedEventCallback != null)
75                 {
76
77                     ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
78                 }
79             }
80
81             if(disposed)
82             {
83                 return;
84             }
85             if(type == DisposeTypes.Explicit)
86             {
87                 //Called by User
88                 //Release your own managed resources here.
89                 //You should release all of your own disposable objects here.
90
91             }
92             else if(type == DisposeTypes.Implicit)
93             {
94
95             }
96
97             if (this != null)
98             {
99                 this.Clear();
100             }
101
102             //Release your own unmanaged resources here.
103             //You should not access any managed member here except static instance.
104             //because the execution order of Finalizes is non-deterministic.
105
106             if (swigCPtr.Handle != global::System.IntPtr.Zero)
107             {
108                 if (swigCMemOwn)
109                 {
110                     swigCMemOwn = false;
111                     NDalicPINVOKE.delete_Animation(swigCPtr);
112                 }
113                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
114             }
115
116             base.Dispose(type);
117         }
118
119         /// <summary>
120         /// Creates an initialized animation.<br />
121         /// The animation will not loop.<br />
122         /// The default end action is "Cancel".<br />
123         /// The default alpha function is linear.<br />
124         /// </summary>
125         /// <remarks>DurationmSeconds must be greater than zero.</remarks>
126         /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
127         /// <since_tizen> 3 </since_tizen>
128         public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
129         {
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131         }
132
133         private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
134         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
135         private delegate void AnimationFinishedEventCallbackType(IntPtr data);
136         private event EventHandler _animationFinishedEventHandler;
137
138         private System.IntPtr _finishedCallbackOfNative;
139
140         /**
141         * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
142         * The finished signal is emitted when an animation's animations have finished.
143         */
144         /// <since_tizen> 3 </since_tizen>
145         public event EventHandler Finished
146         {
147             add
148             {
149                 if (_animationFinishedEventHandler == null && disposed == false)
150                 {
151                     FinishedSignal().Connect(_finishedCallbackOfNative);
152                 }
153                 _animationFinishedEventHandler += value;
154             }
155             remove
156             {
157                 _animationFinishedEventHandler -= value;
158
159                 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
160                 {
161                     FinishedSignal().Disconnect(_finishedCallbackOfNative);
162                 }
163             }
164         }
165         private void OnFinished(IntPtr data)
166         {
167             if (_animationFinishedEventHandler != null)
168             {
169                 //here we send all data to user event handlers
170                 _animationFinishedEventHandler(this, null);
171             }
172         }
173
174         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
175         private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
176         private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
177         private event EventHandler _animationProgressReachedEventHandler;
178         /**
179         * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
180         * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
181         */
182         /// <since_tizen> 3 </since_tizen>
183         public event EventHandler ProgressReached
184         {
185             add
186             {
187                 if (_animationProgressReachedEventHandler == null)
188                 {
189                     _animationProgressReachedEventCallback = OnProgressReached;
190                     ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
191                 }
192
193                 _animationProgressReachedEventHandler += value;
194             }
195             remove
196             {
197                 _animationProgressReachedEventHandler -= value;
198
199                 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
200                 {
201                     ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
202                 }
203             }
204         }
205         private void OnProgressReached(IntPtr data)
206         {
207             if (_animationProgressReachedEventHandler != null)
208             {
209                 //here we send all data to user event handlers
210                 _animationProgressReachedEventHandler(this, null);
211             }
212         }
213
214         private float MilliSecondsToSeconds(int millisec)
215         {
216             return (float)millisec / 1000.0f;
217         }
218
219         private int SecondsToMilliSeconds(float sec)
220         {
221             return (int)(sec * 1000);
222         }
223
224
225         /// <summary>
226         /// Gets or sets the duration in milliseconds of the animation.
227         /// </summary>
228         /// <since_tizen> 3 </since_tizen>
229         public int Duration
230         {
231             set
232             {
233                 SetDuration(MilliSecondsToSeconds(value));
234             }
235             get
236             {
237                 return SecondsToMilliSeconds(GetDuration());
238             }
239         }
240
241         /// <summary>
242         ///  Gets or sets the default alpha function for the animation.
243         /// </summary>
244         /// <since_tizen> 3 </since_tizen>
245         public AlphaFunction DefaultAlphaFunction
246         {
247             set
248             {
249                 SetDefaultAlphaFunction(value);
250             }
251             get
252             {
253                 AlphaFunction ret = GetDefaultAlphaFunction();
254                 return ret;
255             }
256         }
257
258         /// <summary>
259         /// Queries the state of the animation.
260         /// </summary>
261         /// <since_tizen> 3 </since_tizen>
262         public States State
263         {
264             get
265             {
266                 return GetState();
267             }
268         }
269
270         /// <summary>
271         /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
272         /// This property resets the looping value and should not be used with the Looping property.<br />
273         /// Setting this parameter does not cause the animation to Play().<br />
274         /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
275         /// The loop count is initially 1 for play once.<br />
276         /// </summary>
277         /// <since_tizen> 3 </since_tizen>
278         public int LoopCount
279         {
280             set
281             {
282                 SetLoopCount(value);
283             }
284             get
285             {
286                 int ret = GetLoopCount();
287                 return ret;
288             }
289         }
290
291         /// <summary>
292         /// Gets or sets the status of whether the animation will loop.<br />
293         /// This property resets the loop count and should not be used with the LoopCount property.<br />
294         /// Setting this parameter does not cause the animation to Play().<br />
295         /// </summary>
296         /// <since_tizen> 3 </since_tizen>
297         public bool Looping
298         {
299             set
300             {
301                 SetLooping(value);
302             }
303             get
304             {
305                 bool ret = IsLooping();
306                 return ret;
307             }
308         }
309
310
311         /// <summary>
312         /// Gets or sets the end action of the animation.<br />
313         /// This action is performed when the animation ends or if it is stopped.<br />
314         /// The default end action is cancel.<br />
315         /// </summary>
316         /// <since_tizen> 3 </since_tizen>
317         public EndActions EndAction
318         {
319             set
320             {
321                 SetEndAction(value);
322             }
323             get
324             {
325                 return GetEndAction();
326             }
327         }
328
329
330         /// <summary>
331         /// Stops the animation.
332         /// </summary>
333         /// <param name="action">The end action can be set.</param>
334         /// <since_tizen> 3 </since_tizen>
335         public void Stop(EndActions action = EndActions.Cancel)
336         {
337             SetEndAction(action);
338             NDalicPINVOKE.Animation_Stop(swigCPtr);
339             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340         }
341
342         /// <summary>
343         /// Gets the current loop count.<br />
344         /// A value 0 indicating the current loop count when looping.<br />
345         /// </summary>
346         /// <since_tizen> 3 </since_tizen>
347         public int CurrentLoop
348         {
349             get
350             {
351                 return GetCurrentLoop();
352             }
353         }
354
355         /// <summary>
356         /// Gets or sets the disconnect action.<br />
357         /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
358         /// The default action is cancel.<br />
359         /// </summary>
360         /// <since_tizen> 3 </since_tizen>
361         public EndActions DisconnectAction
362         {
363             set
364             {
365                 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
366                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367             }
368             get
369             {
370                 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
371                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
372                 return ret;
373             }
374         }
375
376
377         /// <summary>
378         /// Gets or sets the progress of the animation.<br />
379         /// The animation will play (or continue playing) from this point.<br />
380         /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
381         /// otherwise, it will be ignored.<br />
382         /// </summary>
383         /// <since_tizen> 3 </since_tizen>
384         public float CurrentProgress
385         {
386             set
387             {
388                 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
389                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390             }
391             get
392             {
393                 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
394                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395                 return ret;
396             }
397         }
398
399         /// <summary>
400         /// Gets or sets specificifications of a speed factor for the animation.<br />
401         /// The speed factor is a multiplier of the normal velocity of the animation.<br />
402         /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
403         /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
404         /// </summary>
405         /// <since_tizen> 3 </since_tizen>
406         public float SpeedFactor
407         {
408             set
409             {
410                 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
411                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412             }
413             get
414             {
415                 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
416                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417                 return ret;
418             }
419         }
420
421         /// <summary>
422         /// Gets or sets the playing range.<br />
423         /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
424         /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
425         /// </summary>
426         /// <since_tizen> 3 </since_tizen>
427         public RelativeVector2 PlayRange
428         {
429             set
430             {
431                 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
432                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433             }
434             get
435             {
436                 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
437                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438                 return ret;
439             }
440         }
441
442
443         /// <summary>
444         /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
445         /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
446         /// One notification can be set on each animation.
447         /// </summary>
448         /// <since_tizen> 3 </since_tizen>
449         public float ProgressNotification
450         {
451             set
452             {
453                 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
454                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455             }
456             get
457             {
458                 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
459                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
460                 return ret;
461             }
462         }
463
464         /// <summary>
465         /// Animates a property value by a relative amount.<br />
466         /// </summary>
467         /// <param name="target">The target object to animate.</param>
468         /// <param name="property">The target property to animate.</param>
469         /// <param name="relativeValue">The property value will change by this amount.</param>
470         /// <param name="alphaFunction">The alpha function to apply.</param>
471         /// <since_tizen> 3 </since_tizen>
472         public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
473         {
474             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
475
476             PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
477             if(propertyType.Equals(PropertyType.Float))
478             {
479                 System.Type type = relativeValue.GetType();
480                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
481                 {
482                     int num = (int)relativeValue;
483                     relativeValue = (float)num;
484                 }
485             }
486
487             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
488
489             if (alphaFunction != null)
490             {
491                 AnimateBy(_prop, val, alphaFunction);
492             }
493             else
494             {
495                 AnimateBy(_prop, val);
496             }
497         }
498
499         /// <summary>
500         /// Animates a property value by a relative amount.<br />
501         /// </summary>
502         /// <param name="target">The target object to animate.</param>
503         /// <param name="property">The target property to animate.</param>
504         /// <param name="relativeValue">The property value will change by this amount.</param>
505         /// <param name="startTime">The start time of the animation.</param>
506         /// <param name="endTime">The end time of the animation.</param>
507         /// <param name="alphaFunction">The alpha function to apply.</param>
508         /// <since_tizen> 3 </since_tizen>
509         public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
510         {
511             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
512
513             PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
514             if(propertyType.Equals(PropertyType.Float))
515             {
516                 System.Type type = relativeValue.GetType();
517                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
518                 {
519                     int num = (int)relativeValue;
520                     relativeValue = (float)num;
521                 }
522             }
523
524             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
525
526             if (alphaFunction != null)
527             {
528                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
529                 AnimateBy(_prop, val, alphaFunction, time);
530             }
531             else
532             {
533                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
534                 AnimateBy(_prop, val, time);
535             }
536         }
537
538         /// <summary>
539         /// Animates a property to a destination value.<br />
540         /// </summary>
541         /// <param name="target">The target object to animate.</param>
542         /// <param name="property">The target property to animate.</param>
543         /// <param name="destinationValue">The destination value.</param>
544         /// <param name="alphaFunction">The alpha function to apply.</param>
545         /// <since_tizen> 3 </since_tizen>
546         public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
547         {
548             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
549
550             PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
551             if(propertyType.Equals(PropertyType.Float))
552             {
553                 System.Type type = destinationValue.GetType();
554                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
555                 {
556                     int num = (int)destinationValue;
557                     destinationValue = (float)num;
558                 }
559             }
560
561             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
562
563             if (alphaFunction != null)
564             {
565                 AnimateTo(_prop, val, alphaFunction);
566             }
567             else
568             {
569                 AnimateTo(_prop, val);
570             }
571         }
572         private string[] _properties = null;
573
574         /// <summary>
575         /// Gets or sets the properties of the animation.
576         /// </summary>
577         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
578         [EditorBrowsable(EditorBrowsableState.Never)]
579         public string[] Properties
580         {
581             get
582             {
583                 return _properties;
584             }
585             set
586             {
587                 _properties = value;
588             }
589         }
590
591         private string[] _destValue = null;
592
593         /// <summary>
594         /// Gets or sets the destination value for each property of the animation.
595         /// </summary>
596         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
597         [EditorBrowsable(EditorBrowsableState.Never)]
598         public string[] DestValue
599         {
600             get
601             {
602                 return _destValue;
603             }
604             set
605             {
606                 _destValue = value;
607             }
608         }
609
610         private int[] _startTime = null;
611
612         /// <summary>
613         /// Gets or sets the start time for each property of the animation.
614         /// </summary>
615         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
616         [EditorBrowsable(EditorBrowsableState.Never)]
617         public int[] StartTime
618         {
619             get
620             {
621                 return _startTime;
622             }
623             set
624             {
625                 _startTime = value;
626             }
627         }
628
629         private int[] _endTime = null;
630
631         /// <summary>
632         /// Gets or sets the end time for each property of the animation.
633         /// </summary>
634         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
635         [EditorBrowsable(EditorBrowsableState.Never)]
636         public int[] EndTime
637         {
638             get
639             {
640                 return _endTime;
641             }
642             set
643             {
644                 _endTime = value;
645             }
646         }
647
648         /// <summary>
649         /// Animates one or more properties to a destination value.<br />
650         /// </summary>
651         /// <param name="target">The target object to animate.</param>
652         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
653         [EditorBrowsable(EditorBrowsableState.Never)]
654         public void PlayAnimateTo(View target)
655         {
656             Clear();
657             if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
658             {
659                 int length = _properties.Length;
660                 for (int index = 0; index < length; index++)
661                 {
662                     //object destinationValue = _destValue[index];
663                     var elementType = target.GetType();
664                     PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
665                     //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
666                     if (propertyInfo != null)
667                     {
668                         object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
669
670                         if(destinationValue != null)
671                         {
672                             AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
673                         }
674                     }
675                 }
676                 Play();
677             }
678         }
679
680         internal object ConvertTo(object value, Type toType)
681         {
682             Func<object> getConverter = () =>
683             {
684                 MemberInfo memberInfo;
685
686                 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
687                 if (converterTypeName == null)
688                     return null;
689
690                 Type convertertype = Type.GetType(converterTypeName);
691                 return Activator.CreateInstance(convertertype);
692             };
693
694             return ConvertTo(value, toType, getConverter);
695         }
696
697         internal object ConvertTo(object value, Type toType, Func<object> getConverter)
698         {
699             if (value == null)
700                 return null;
701
702             var str = value as string;
703             if (str != null)
704             {
705                 //If there's a [TypeConverter], use it
706                 object converter = getConverter?.Invoke();
707                 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
708                 if (xfTypeConverter != null)
709                     return value = xfTypeConverter.ConvertFromInvariantString(str);
710                 var converterType = converter?.GetType();
711                 if (converterType != null)
712                 {
713                     var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
714                         new[] { typeof(string) });
715                     if (convertFromStringInvariant != null)
716                         return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
717                 }
718
719                 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
720                 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
721                     toType = Nullable.GetUnderlyingType(toType);
722
723                 //Obvious Built-in conversions
724                 if (toType.GetTypeInfo().IsEnum)
725                     return Enum.Parse(toType, str, true);
726                 if (toType == typeof(SByte))
727                     return SByte.Parse(str, CultureInfo.InvariantCulture);
728                 if (toType == typeof(Int16))
729                     return Int16.Parse(str, CultureInfo.InvariantCulture);
730                 if (toType == typeof(Int32))
731                     return Int32.Parse(str, CultureInfo.InvariantCulture);
732                 if (toType == typeof(Int64))
733                     return Int64.Parse(str, CultureInfo.InvariantCulture);
734                 if (toType == typeof(Byte))
735                     return Byte.Parse(str, CultureInfo.InvariantCulture);
736                 if (toType == typeof(UInt16))
737                     return UInt16.Parse(str, CultureInfo.InvariantCulture);
738                 if (toType == typeof(UInt32))
739                     return UInt32.Parse(str, CultureInfo.InvariantCulture);
740                 if (toType == typeof(UInt64))
741                     return UInt64.Parse(str, CultureInfo.InvariantCulture);
742                 if (toType == typeof(Single))
743                     return Single.Parse(str, CultureInfo.InvariantCulture);
744                 if (toType == typeof(Double))
745                     return Double.Parse(str, CultureInfo.InvariantCulture);
746                 if (toType == typeof(Boolean))
747                     return Boolean.Parse(str);
748                 if (toType == typeof(TimeSpan))
749                     return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
750                 if (toType == typeof(DateTime))
751                     return DateTime.Parse(str, CultureInfo.InvariantCulture);
752                 if (toType == typeof(Char))
753                 {
754                     char c = '\0';
755                     Char.TryParse(str, out c);
756                     return c;
757                 }
758                 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
759                     return str.Substring(2);
760                 if (toType == typeof(String))
761                     return value;
762                 if (toType == typeof(Decimal))
763                     return Decimal.Parse(str, CultureInfo.InvariantCulture);
764             }
765
766             //if the value is not assignable and there's an implicit conversion, convert
767             if (value != null && !toType.IsAssignableFrom(value.GetType()))
768             {
769                 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
770                                  ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
771                 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
772                 //                ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
773
774                 if (opImplicit != null)
775                 {
776                     value = opImplicit.Invoke(null, new[] { value });
777                     return value;
778                 }
779             }
780
781             var nativeValueConverterService = DependencyService.Get<INativeValueConverterService>();
782
783             object nativeValue = null;
784             if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue))
785                 return nativeValue;
786
787             return value;
788         }
789
790         internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
791         {
792             var converterAttribute =
793                 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
794             if (converterAttribute == null)
795                 return null;
796             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
797                 return (string)converterAttribute.ConstructorArguments[0].Value;
798             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
799                 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
800             return null;
801         }
802
803         internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
804         {
805 #if NETSTANDARD1_0
806             var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
807 #else
808             var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
809             var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
810 #endif
811             if (mi == null) return null;
812             if (!mi.IsSpecialName) return null;
813             if (!mi.IsPublic) return null;
814             if (!mi.IsStatic) return null;
815             if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
816
817             return mi;
818         }
819
820
821         /// <summary>
822         /// Animates a property to a destination value.<br />
823         /// </summary>
824         /// <param name="target">The target object to animate.</param>
825         /// <param name="property">The target property to animate.</param>
826         /// <param name="destinationValue">The destination value.</param>
827         /// <param name="startTime">The start time of the animation.</param>
828         /// <param name="endTime">The end time of the animation.</param>
829         /// <param name="alphaFunction">The alpha function to apply.</param>
830         /// <since_tizen> 3 </since_tizen>
831         public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
832         {
833             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
834
835             PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
836             if(propertyType.Equals(PropertyType.Float))
837             {
838                 System.Type type = destinationValue.GetType();
839                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
840                 {
841                     int num = (int)destinationValue;
842                     destinationValue = (float)num;
843                 }
844             }
845
846             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
847
848             if (alphaFunction != null)
849             {
850                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
851                 AnimateTo(_prop, val, alphaFunction, time);
852             }
853             else
854             {
855                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
856                 AnimateTo(_prop, val, time);
857             }
858         }
859
860         /// <summary>
861         /// Animates a property between keyframes.
862         /// </summary>
863         /// <param name="target">The target object to animate.</param>
864         /// <param name="property">The target property to animate.</param>
865         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
866         /// <param name="interpolation">The method used to interpolate between values.</param>
867         /// <param name="alphaFunction">The alpha function to apply.</param>
868         /// <since_tizen> 3 </since_tizen>
869         public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
870         {
871             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
872
873             if (_prop.propertyIndex == Property.INVALID_INDEX)
874             {
875                 throw new System.ArgumentException("second argument string property is invalid parameter!");
876             }
877
878             if (alphaFunction != null)
879             {
880                 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
881             }
882             else
883             {
884                 AnimateBetween(_prop, keyFrames, interpolation);
885             }
886         }
887
888
889         /// <summary>
890         /// Animates a property between keyframes.
891         /// </summary>
892         /// <param name="target">The target object to animate</param>
893         /// <param name="property">The target property to animate</param>
894         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
895         /// <param name="startTime">The start time of animation in milliseconds.</param>
896         /// <param name="endTime">The end time of animation in milliseconds.</param>
897         /// <param name="interpolation">The method used to interpolate between values.</param>
898         /// <param name="alphaFunction">The alpha function to apply.</param>
899         /// <since_tizen> 3 </since_tizen>
900         public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
901         {
902             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
903
904             Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
905             if (alphaFunction != null)
906             {
907                 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
908             }
909             else
910             {
911                 AnimateBetween(_prop, keyFrames, time, interpolation);
912             }
913         }
914
915         /// <summary>
916         /// Animates the view's position and orientation through a predefined path.<br />
917         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
918         /// If forward is the zero vector then no rotation will happen.<br />
919         /// </summary>
920         /// <param name="view">The view to animate.</param>
921         /// <param name="path">It defines position and orientation.</param>
922         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
923         /// <param name="alphaFunction">The alpha function to apply.</param>
924         /// <since_tizen> 3 </since_tizen>
925         public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
926         {
927             if (alphaFunction == null)
928             {
929                 Animate(view, path, forward);
930             }
931             else
932             {
933                 Animate(view, path, forward, alphaFunction);
934             }
935         }
936
937         /// <summary>
938         /// Animates the view's position and orientation through a predefined path.<br />
939         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
940         /// If forward is the zero vector then no rotation will happen.<br />
941         /// </summary>
942         /// <param name="view">The view to animate.</param>
943         /// <param name="path">It defines position and orientation.</param>
944         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
945         /// <param name="startTime">The start time of the animation.</param>
946         /// <param name="endTime">The end time of the animation.</param>
947         /// <param name="alphaFunction">The alpha function to apply.</param>
948         /// <since_tizen> 3 </since_tizen>
949         public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
950         {
951             TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
952             if (alphaFunction == null)
953             {
954                 Animate(view, path, forward, time);
955             }
956             else
957             {
958                 Animate(view, path, forward, alphaFunction, time);
959             }
960         }
961
962         /// <summary>
963         /// Creates an initialized animation.<br />
964         /// The animation will not loop.<br />
965         /// The default end action is "Cancel".<br />
966         /// The default alpha function is linear.<br />
967         /// </summary>
968         /// <since_tizen> 3 </since_tizen>
969         public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
970         {
971             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
972         }
973
974         internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
975         {
976             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
977
978         }
979
980         /// <summary>
981         /// Downcasts a handle to animation handle.<br />
982         /// If handle points to an animation object, the downcast produces a valid handle.<br />
983         /// If not, the returned handle is left uninitialized.<br />
984         /// </summary>
985         /// <param name="handle">Handle to an object.</param>
986         /// <returns>Handle to an animation object or an uninitialized handle.</returns>
987         /// <since_tizen> 3 </since_tizen>
988         public static Animation DownCast(BaseHandle handle)
989         {
990             Animation ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
991             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
992             return ret;
993         }
994
995         internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
996         {
997             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
998         }
999
1000         internal Animation Assign(Animation rhs)
1001         {
1002             Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
1003             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1004             return ret;
1005         }
1006
1007         internal void SetDuration(float seconds)
1008         {
1009             NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
1010             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011         }
1012
1013         internal float GetDuration()
1014         {
1015             float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
1016             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1017             return ret;
1018         }
1019
1020         internal void SetLooping(bool looping)
1021         {
1022             NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
1023             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1024         }
1025
1026         internal void SetLoopCount(int count)
1027         {
1028             NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
1029             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1030         }
1031
1032         internal int GetLoopCount()
1033         {
1034             int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
1035             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1036             return ret;
1037         }
1038
1039         internal int GetCurrentLoop()
1040         {
1041             int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
1042             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1043             return ret;
1044         }
1045
1046         internal bool IsLooping()
1047         {
1048             bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
1049             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1050             return ret;
1051         }
1052
1053         internal void SetEndAction(Animation.EndActions action)
1054         {
1055             NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
1056             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1057         }
1058
1059         internal Animation.EndActions GetEndAction()
1060         {
1061             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
1062             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1063             return ret;
1064         }
1065
1066         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1067         {
1068             NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
1069             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070         }
1071
1072         internal Animation.EndActions GetDisconnectAction()
1073         {
1074             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
1075             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076             return ret;
1077         }
1078
1079         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1080         {
1081             NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1082             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1083         }
1084
1085         internal AlphaFunction GetDefaultAlphaFunction()
1086         {
1087             AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
1088             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1089             return ret;
1090         }
1091
1092         internal void SetCurrentProgress(float progress)
1093         {
1094             NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
1095             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1096         }
1097
1098         internal float GetCurrentProgress()
1099         {
1100             float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
1101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1102             return ret;
1103         }
1104
1105         internal void SetSpeedFactor(float factor)
1106         {
1107             NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
1108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109         }
1110
1111         internal float GetSpeedFactor()
1112         {
1113             float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
1114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1115             return ret;
1116         }
1117
1118         internal void SetPlayRange(Vector2 range)
1119         {
1120             NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1121             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1122         }
1123
1124         internal Vector2 GetPlayRange()
1125         {
1126             Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
1127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1128             return ret;
1129         }
1130
1131         private static bool? disableAnimation = null;
1132         private bool DisableAnimation
1133         {
1134             get
1135             {
1136                 if (disableAnimation.HasValue == false)
1137                 {
1138                     string type = Environment.GetEnvironmentVariable("PlatformSmartType");
1139                     if (type == "Entry")
1140                         disableAnimation = true;
1141                     else
1142                         disableAnimation = false;
1143                 }
1144                 return disableAnimation.Value;
1145             }
1146         }
1147
1148         /// <summary>
1149         /// Plays the animation.
1150         /// </summary>
1151         /// <since_tizen> 3 </since_tizen>
1152         public void Play()
1153         {
1154             NDalicPINVOKE.Animation_Play(swigCPtr);
1155             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1156
1157             if (DisableAnimation == true)
1158                 Stop(EndActions.StopFinal);
1159         }
1160
1161         /// <summary>
1162         /// Plays the animation from a given point.<br />
1163         /// The progress must be in the 0-1 interval or in the play range interval if defined,
1164         /// otherwise, it will be ignored.<br />
1165         /// </summary>
1166         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
1167         /// <since_tizen> 3 </since_tizen>
1168         public void PlayFrom(float progress)
1169         {
1170             NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
1171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1172         }
1173
1174         /// <summary>
1175         /// Plays the animation after a given delay time.<br/>
1176         /// The delay time is not included in the looping time.<br/>
1177         /// When the delay time is a negative value, it would treat as play immediately.<br/>
1178         /// </summary>
1179         /// <param name="delayMilliseconds">The delay time.</param>
1180         /// <since_tizen> 4 </since_tizen>
1181         public void PlayAfter(int delayMilliseconds)
1182         {
1183             NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
1184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1185         }
1186
1187         /// <summary>
1188         /// Pauses the animation.
1189         /// </summary>
1190         /// <since_tizen> 3 </since_tizen>
1191         public void Pause()
1192         {
1193             NDalicPINVOKE.Animation_Pause(swigCPtr);
1194             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1195         }
1196
1197         internal Animation.States GetState()
1198         {
1199             Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
1200             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1201             return ret;
1202         }
1203
1204         /// <summary>
1205         /// Stops the animation.
1206         /// </summary>
1207         /// <since_tizen> 3 </since_tizen>
1208         public void Stop()
1209         {
1210             NDalicPINVOKE.Animation_Stop(swigCPtr);
1211             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1212         }
1213
1214         /// <summary>
1215         /// Clears the animation.<br />
1216         /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
1217         /// </summary>
1218         /// <since_tizen> 3 </since_tizen>
1219         public void Clear()
1220         {
1221             NDalicPINVOKE.Animation_Clear(swigCPtr);
1222             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1223         }
1224
1225         internal AnimationSignal FinishedSignal()
1226         {
1227             AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
1228             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1229             return ret;
1230         }
1231
1232         internal AnimationSignal ProgressReachedSignal()
1233         {
1234             AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
1235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236             return ret;
1237         }
1238
1239         internal void AnimateBy(Property target, PropertyValue relativeValue)
1240         {
1241             NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1242             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1243         }
1244
1245         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1246         {
1247             NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1248             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1249         }
1250
1251         internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1252         {
1253             NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1254             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1255         }
1256
1257         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1258         {
1259             NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1260             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1261         }
1262
1263         internal void AnimateTo(Property target, PropertyValue destinationValue)
1264         {
1265             NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1267         }
1268
1269         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1270         {
1271             NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1272             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1273         }
1274
1275         internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1276         {
1277             NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1279         }
1280
1281         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1282         {
1283             NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1284             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1285         }
1286
1287         internal void AnimateBetween(Property target, KeyFrames keyFrames)
1288         {
1289             NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1290             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291         }
1292
1293         internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1294         {
1295             NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1296             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1297         }
1298
1299         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1300         {
1301             NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1302             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1303         }
1304
1305         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1306         {
1307             NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1309         }
1310
1311         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1312         {
1313             NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1314             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1315         }
1316
1317         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1318         {
1319             NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1320             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1321         }
1322
1323         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1324         {
1325             NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1326             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1327         }
1328
1329         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1330         {
1331             NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1332             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1333         }
1334
1335         internal void Animate(View view, Path path, Vector3 forward)
1336         {
1337             NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1338             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1339         }
1340
1341         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1342         {
1343             NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1344             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1345         }
1346
1347         internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1348         {
1349             NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1351         }
1352
1353         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1354         {
1355             NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1356             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1357         }
1358
1359         internal void Show(View view, float delaySeconds)
1360         {
1361             NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1362             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1363         }
1364
1365         internal void Hide(View view, float delaySeconds)
1366         {
1367             NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1368             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369         }
1370
1371         /// <summary>
1372         /// Enumeration for what to do when the animation ends, stopped, or destroyed.
1373         /// </summary>
1374         /// <since_tizen> 3 </since_tizen>
1375         public enum EndActions
1376         {
1377             /// <summary>
1378             /// When the animation ends, the animated property values are saved.
1379             /// </summary>
1380             Cancel,
1381             /// <summary>
1382             /// When the animation ends, the animated property values are forgotten.
1383             /// </summary>
1384             Discard,
1385             /// <summary>
1386             /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
1387             /// </summary>
1388             StopFinal
1389         }
1390
1391         /// <summary>
1392         /// Enumeration for what interpolation method to use on key-frame animations.
1393         /// </summary>
1394         /// <since_tizen> 3 </since_tizen>
1395         public enum Interpolation
1396         {
1397             /// <summary>
1398             /// Values in between key frames are interpolated using a linear polynomial. (Default)
1399             /// </summary>
1400             Linear,
1401             /// <summary>
1402             /// Values in between key frames are interpolated using a cubic polynomial.
1403             /// </summary>
1404             Cubic
1405         }
1406
1407         /// <summary>
1408         /// Enumeration for what state the animation is in.
1409         /// </summary>
1410         /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
1411         /// <since_tizen> 3 </since_tizen>
1412         public enum States
1413         {
1414             /// <summary>
1415             /// The animation has stopped.
1416             /// </summary>
1417             Stopped,
1418             /// <summary>
1419             /// The animation is playing.
1420             /// </summary>
1421             Playing,
1422             /// <summary>
1423             /// The animation is paused.
1424             /// </summary>
1425             Paused
1426         }
1427
1428     }
1429
1430 }