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