[NUI] Public some apis of TableView,Animation,NUIApplication (#483)
[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         public string[] Properties
578         {
579             get
580             {
581                 return _properties;
582             }
583             set
584             {
585                 _properties = value;
586             }
587         }
588
589         private string[] _destValue = null;
590
591         /// <summary>
592         /// Gets or sets the destination value for each property of the animation.
593         /// </summary>
594         public string[] DestValue
595         {
596             get
597             {
598                 return _destValue;
599             }
600             set
601             {
602                 _destValue = value;
603             }
604         }
605
606         private int[] _startTime = null;
607
608         /// <summary>
609         /// Gets or sets the start time for each property of the animation.
610         /// </summary>
611         public int[] StartTime
612         {
613             get
614             {
615                 return _startTime;
616             }
617             set
618             {
619                 _startTime = value;
620             }
621         }
622
623         private int[] _endTime = null;
624
625         /// <summary>
626         /// Gets or sets the end time for each property of the animation.
627         /// </summary>
628         public int[] EndTime
629         {
630             get
631             {
632                 return _endTime;
633             }
634             set
635             {
636                 _endTime = value;
637             }
638         }
639
640         /// <summary>
641         /// Animates one or more properties to a destination value.<br />
642         /// </summary>
643         /// <param name="target">The target object to animate.</param>
644         public void PlayAnimateTo(View target)
645         {
646             Clear();
647             if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
648             {
649                 int length = _properties.Length;
650                 for (int index = 0; index < length; index++)
651                 {
652                     //object destinationValue = _destValue[index];
653                     var elementType = target.GetType();
654                     PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
655                     //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
656                     if (propertyInfo != null)
657                     {
658                         object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
659
660                         if(destinationValue != null)
661                         {
662                             AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
663                         }
664                     }
665                 }
666                 Play();
667             }
668         }
669
670         internal object ConvertTo(object value, Type toType)
671         {
672             Func<object> getConverter = () =>
673             {
674                 MemberInfo memberInfo;
675
676                 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
677                 if (converterTypeName == null)
678                     return null;
679
680                 Type convertertype = Type.GetType(converterTypeName);
681                 return Activator.CreateInstance(convertertype);
682             };
683
684             return ConvertTo(value, toType, getConverter);
685         }
686
687         internal object ConvertTo(object value, Type toType, Func<object> getConverter)
688         {
689             if (value == null)
690                 return null;
691
692             var str = value as string;
693             if (str != null)
694             {
695                 //If there's a [TypeConverter], use it
696                 object converter = getConverter?.Invoke();
697                 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
698                 if (xfTypeConverter != null)
699                     return value = xfTypeConverter.ConvertFromInvariantString(str);
700                 var converterType = converter?.GetType();
701                 if (converterType != null)
702                 {
703                     var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
704                         new[] { typeof(string) });
705                     if (convertFromStringInvariant != null)
706                         return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
707                 }
708
709                 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
710                 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
711                     toType = Nullable.GetUnderlyingType(toType);
712
713                 //Obvious Built-in conversions
714                 if (toType.GetTypeInfo().IsEnum)
715                     return Enum.Parse(toType, str, true);
716                 if (toType == typeof(SByte))
717                     return SByte.Parse(str, CultureInfo.InvariantCulture);
718                 if (toType == typeof(Int16))
719                     return Int16.Parse(str, CultureInfo.InvariantCulture);
720                 if (toType == typeof(Int32))
721                     return Int32.Parse(str, CultureInfo.InvariantCulture);
722                 if (toType == typeof(Int64))
723                     return Int64.Parse(str, CultureInfo.InvariantCulture);
724                 if (toType == typeof(Byte))
725                     return Byte.Parse(str, CultureInfo.InvariantCulture);
726                 if (toType == typeof(UInt16))
727                     return UInt16.Parse(str, CultureInfo.InvariantCulture);
728                 if (toType == typeof(UInt32))
729                     return UInt32.Parse(str, CultureInfo.InvariantCulture);
730                 if (toType == typeof(UInt64))
731                     return UInt64.Parse(str, CultureInfo.InvariantCulture);
732                 if (toType == typeof(Single))
733                     return Single.Parse(str, CultureInfo.InvariantCulture);
734                 if (toType == typeof(Double))
735                     return Double.Parse(str, CultureInfo.InvariantCulture);
736                 if (toType == typeof(Boolean))
737                     return Boolean.Parse(str);
738                 if (toType == typeof(TimeSpan))
739                     return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
740                 if (toType == typeof(DateTime))
741                     return DateTime.Parse(str, CultureInfo.InvariantCulture);
742                 if (toType == typeof(Char))
743                 {
744                     char c = '\0';
745                     Char.TryParse(str, out c);
746                     return c;
747                 }
748                 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
749                     return str.Substring(2);
750                 if (toType == typeof(String))
751                     return value;
752                 if (toType == typeof(Decimal))
753                     return Decimal.Parse(str, CultureInfo.InvariantCulture);
754             }
755
756             //if the value is not assignable and there's an implicit conversion, convert
757             if (value != null && !toType.IsAssignableFrom(value.GetType()))
758             {
759                 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
760                                  ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
761                 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
762                 //                ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
763
764                 if (opImplicit != null)
765                 {
766                     value = opImplicit.Invoke(null, new[] { value });
767                     return value;
768                 }
769             }
770
771             var nativeValueConverterService = DependencyService.Get<INativeValueConverterService>();
772
773             object nativeValue = null;
774             if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue))
775                 return nativeValue;
776
777             return value;
778         }
779
780         internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
781         {
782             var converterAttribute =
783                 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
784             if (converterAttribute == null)
785                 return null;
786             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
787                 return (string)converterAttribute.ConstructorArguments[0].Value;
788             if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
789                 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
790             return null;
791         }
792
793         internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
794         {
795 #if NETSTANDARD1_0
796             var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
797 #else
798             var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
799             var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
800 #endif
801             if (mi == null) return null;
802             if (!mi.IsSpecialName) return null;
803             if (!mi.IsPublic) return null;
804             if (!mi.IsStatic) return null;
805             if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
806
807             return mi;
808         }
809
810
811         /// <summary>
812         /// Animates a property to a destination value.<br />
813         /// </summary>
814         /// <param name="target">The target object to animate.</param>
815         /// <param name="property">The target property to animate.</param>
816         /// <param name="destinationValue">The destination value.</param>
817         /// <param name="startTime">The start time of the animation.</param>
818         /// <param name="endTime">The end time of the animation.</param>
819         /// <param name="alphaFunction">The alpha function to apply.</param>
820         /// <since_tizen> 3 </since_tizen>
821         public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
822         {
823             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
824
825             PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
826             if(propertyType.Equals(PropertyType.Float))
827             {
828                 System.Type type = destinationValue.GetType();
829                 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
830                 {
831                     int num = (int)destinationValue;
832                     destinationValue = (float)num;
833                 }
834             }
835
836             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
837
838             if (alphaFunction != null)
839             {
840                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
841                 AnimateTo(_prop, val, alphaFunction, time);
842             }
843             else
844             {
845                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
846                 AnimateTo(_prop, val, time);
847             }
848         }
849
850         /// <summary>
851         /// Animates a property between keyframes.
852         /// </summary>
853         /// <param name="target">The target object to animate.</param>
854         /// <param name="property">The target property to animate.</param>
855         /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
856         /// <param name="interpolation">The method used to interpolate between values.</param>
857         /// <param name="alphaFunction">The alpha function to apply.</param>
858         /// <since_tizen> 3 </since_tizen>
859         public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
860         {
861             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
862
863             if (_prop.propertyIndex == Property.INVALID_INDEX)
864             {
865                 throw new System.ArgumentException("second argument string property is invalid parameter!");
866             }
867
868             if (alphaFunction != null)
869             {
870                 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
871             }
872             else
873             {
874                 AnimateBetween(_prop, keyFrames, interpolation);
875             }
876         }
877
878
879         /// <summary>
880         /// Animates a property between keyframes.
881         /// </summary>
882         /// <param name="target">The target object to animate</param>
883         /// <param name="property">The target property to animate</param>
884         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
885         /// <param name="startTime">The start time of animation in milliseconds.</param>
886         /// <param name="endTime">The end time of animation in milliseconds.</param>
887         /// <param name="interpolation">The method used to interpolate between values.</param>
888         /// <param name="alphaFunction">The alpha function to apply.</param>
889         /// <since_tizen> 3 </since_tizen>
890         public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
891         {
892             Property _prop = PropertyHelper.GetPropertyFromString(target, property);
893
894             Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
895             if (alphaFunction != null)
896             {
897                 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
898             }
899             else
900             {
901                 AnimateBetween(_prop, keyFrames, time, interpolation);
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="alphaFunction">The alpha function to apply.</param>
914         /// <since_tizen> 3 </since_tizen>
915         public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
916         {
917             if (alphaFunction == null)
918             {
919                 Animate(view, path, forward);
920             }
921             else
922             {
923                 Animate(view, path, forward, alphaFunction);
924             }
925         }
926
927         /// <summary>
928         /// Animates the view's position and orientation through a predefined path.<br />
929         /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
930         /// If forward is the zero vector then no rotation will happen.<br />
931         /// </summary>
932         /// <param name="view">The view to animate.</param>
933         /// <param name="path">It defines position and orientation.</param>
934         /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
935         /// <param name="startTime">The start time of the animation.</param>
936         /// <param name="endTime">The end time of the animation.</param>
937         /// <param name="alphaFunction">The alpha function to apply.</param>
938         /// <since_tizen> 3 </since_tizen>
939         public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
940         {
941             TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
942             if (alphaFunction == null)
943             {
944                 Animate(view, path, forward, time);
945             }
946             else
947             {
948                 Animate(view, path, forward, alphaFunction, time);
949             }
950         }
951
952         /// <summary>
953         /// Creates an initialized animation.<br />
954         /// The animation will not loop.<br />
955         /// The default end action is "Cancel".<br />
956         /// The default alpha function is linear.<br />
957         /// </summary>
958         /// <since_tizen> 3 </since_tizen>
959         public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
960         {
961             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
962         }
963
964         internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
965         {
966             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967
968         }
969
970         /// <summary>
971         /// Downcasts a handle to animation handle.<br />
972         /// If handle points to an animation object, the downcast produces a valid handle.<br />
973         /// If not, the returned handle is left uninitialized.<br />
974         /// </summary>
975         /// <param name="handle">Handle to an object.</param>
976         /// <returns>Handle to an animation object or an uninitialized handle.</returns>
977         /// <since_tizen> 3 </since_tizen>
978         public static Animation DownCast(BaseHandle handle)
979         {
980             Animation ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
981             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
982             return ret;
983         }
984
985         internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
986         {
987             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988         }
989
990         internal Animation Assign(Animation rhs)
991         {
992             Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
993             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994             return ret;
995         }
996
997         internal void SetDuration(float seconds)
998         {
999             NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
1000             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1001         }
1002
1003         internal float GetDuration()
1004         {
1005             float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
1006             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1007             return ret;
1008         }
1009
1010         internal void SetLooping(bool looping)
1011         {
1012             NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
1013             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1014         }
1015
1016         internal void SetLoopCount(int count)
1017         {
1018             NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
1019             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020         }
1021
1022         internal int GetLoopCount()
1023         {
1024             int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
1025             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026             return ret;
1027         }
1028
1029         internal int GetCurrentLoop()
1030         {
1031             int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
1032             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1033             return ret;
1034         }
1035
1036         internal bool IsLooping()
1037         {
1038             bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
1039             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1040             return ret;
1041         }
1042
1043         internal void SetEndAction(Animation.EndActions action)
1044         {
1045             NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
1046             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1047         }
1048
1049         internal Animation.EndActions GetEndAction()
1050         {
1051             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
1052             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053             return ret;
1054         }
1055
1056         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1057         {
1058             NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
1059             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1060         }
1061
1062         internal Animation.EndActions GetDisconnectAction()
1063         {
1064             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
1065             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1066             return ret;
1067         }
1068
1069         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1070         {
1071             NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1072             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1073         }
1074
1075         internal AlphaFunction GetDefaultAlphaFunction()
1076         {
1077             AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
1078             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079             return ret;
1080         }
1081
1082         internal void SetCurrentProgress(float progress)
1083         {
1084             NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
1085             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1086         }
1087
1088         internal float GetCurrentProgress()
1089         {
1090             float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
1091             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1092             return ret;
1093         }
1094
1095         internal void SetSpeedFactor(float factor)
1096         {
1097             NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
1098             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1099         }
1100
1101         internal float GetSpeedFactor()
1102         {
1103             float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
1104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105             return ret;
1106         }
1107
1108         internal void SetPlayRange(Vector2 range)
1109         {
1110             NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1112         }
1113
1114         internal Vector2 GetPlayRange()
1115         {
1116             Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
1117             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118             return ret;
1119         }
1120
1121         private static bool? disableAnimation = null;
1122         private bool DisableAnimation
1123         {
1124             get
1125             {
1126                 if (disableAnimation.HasValue == false)
1127                 {
1128                     string type = Environment.GetEnvironmentVariable("PlatformSmartType");
1129                     if (type == "Entry")
1130                         disableAnimation = true;
1131                     else
1132                         disableAnimation = false;
1133                 }
1134                 return disableAnimation.Value;
1135             }
1136         }
1137
1138         /// <summary>
1139         /// Plays the animation.
1140         /// </summary>
1141         /// <since_tizen> 3 </since_tizen>
1142         public void Play()
1143         {
1144             NDalicPINVOKE.Animation_Play(swigCPtr);
1145             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1146
1147             if (DisableAnimation == true)
1148                 Stop(EndActions.StopFinal);
1149         }
1150
1151         /// <summary>
1152         /// Plays the animation from a given point.<br />
1153         /// The progress must be in the 0-1 interval or in the play range interval if defined,
1154         /// otherwise, it will be ignored.<br />
1155         /// </summary>
1156         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
1157         /// <since_tizen> 3 </since_tizen>
1158         public void PlayFrom(float progress)
1159         {
1160             NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
1161             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1162         }
1163
1164         /// <summary>
1165         /// Plays the animation after a given delay time.<br/>
1166         /// The delay time is not included in the looping time.<br/>
1167         /// When the delay time is a negative value, it would treat as play immediately.<br/>
1168         /// </summary>
1169         /// <param name="delayMilliseconds">The delay time.</param>
1170         /// <since_tizen> 4 </since_tizen>
1171         public void PlayAfter(int delayMilliseconds)
1172         {
1173             NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
1174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175         }
1176
1177         /// <summary>
1178         /// Pauses the animation.
1179         /// </summary>
1180         /// <since_tizen> 3 </since_tizen>
1181         public void Pause()
1182         {
1183             NDalicPINVOKE.Animation_Pause(swigCPtr);
1184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1185         }
1186
1187         internal Animation.States GetState()
1188         {
1189             Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
1190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1191             return ret;
1192         }
1193
1194         /// <summary>
1195         /// Stops the animation.
1196         /// </summary>
1197         /// <since_tizen> 3 </since_tizen>
1198         public void Stop()
1199         {
1200             NDalicPINVOKE.Animation_Stop(swigCPtr);
1201             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1202         }
1203
1204         /// <summary>
1205         /// Clears the animation.<br />
1206         /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
1207         /// </summary>
1208         /// <since_tizen> 3 </since_tizen>
1209         public void Clear()
1210         {
1211             NDalicPINVOKE.Animation_Clear(swigCPtr);
1212             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1213         }
1214
1215         internal AnimationSignal FinishedSignal()
1216         {
1217             AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
1218             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1219             return ret;
1220         }
1221
1222         internal AnimationSignal ProgressReachedSignal()
1223         {
1224             AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
1225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226             return ret;
1227         }
1228
1229         internal void AnimateBy(Property target, PropertyValue relativeValue)
1230         {
1231             NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1232             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1233         }
1234
1235         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1236         {
1237             NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1239         }
1240
1241         internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1242         {
1243             NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1244             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1245         }
1246
1247         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1248         {
1249             NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1250             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1251         }
1252
1253         internal void AnimateTo(Property target, PropertyValue destinationValue)
1254         {
1255             NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1256             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1257         }
1258
1259         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1260         {
1261             NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1262             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263         }
1264
1265         internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1266         {
1267             NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1268             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1269         }
1270
1271         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1272         {
1273             NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1274             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1275         }
1276
1277         internal void AnimateBetween(Property target, KeyFrames keyFrames)
1278         {
1279             NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1280             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1281         }
1282
1283         internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1284         {
1285             NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1286             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1287         }
1288
1289         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1290         {
1291             NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1293         }
1294
1295         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1296         {
1297             NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1299         }
1300
1301         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1302         {
1303             NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1304             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305         }
1306
1307         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1308         {
1309             NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1310             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1311         }
1312
1313         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1314         {
1315             NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1316             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1317         }
1318
1319         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1320         {
1321             NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323         }
1324
1325         internal void Animate(View view, Path path, Vector3 forward)
1326         {
1327             NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1328             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1329         }
1330
1331         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1332         {
1333             NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1334             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1335         }
1336
1337         internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1338         {
1339             NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1340             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1341         }
1342
1343         internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1344         {
1345             NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1346             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1347         }
1348
1349         internal void Show(View view, float delaySeconds)
1350         {
1351             NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1352             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1353         }
1354
1355         internal void Hide(View view, float delaySeconds)
1356         {
1357             NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1358             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1359         }
1360
1361         /// <summary>
1362         /// Enumeration for what to do when the animation ends, stopped, or destroyed.
1363         /// </summary>
1364         /// <since_tizen> 3 </since_tizen>
1365         public enum EndActions
1366         {
1367             /// <summary>
1368             /// When the animation ends, the animated property values are saved.
1369             /// </summary>
1370             Cancel,
1371             /// <summary>
1372             /// When the animation ends, the animated property values are forgotten.
1373             /// </summary>
1374             Discard,
1375             /// <summary>
1376             /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
1377             /// </summary>
1378             StopFinal
1379         }
1380
1381         /// <summary>
1382         /// Enumeration for what interpolation method to use on key-frame animations.
1383         /// </summary>
1384         /// <since_tizen> 3 </since_tizen>
1385         public enum Interpolation
1386         {
1387             /// <summary>
1388             /// Values in between key frames are interpolated using a linear polynomial. (Default)
1389             /// </summary>
1390             Linear,
1391             /// <summary>
1392             /// Values in between key frames are interpolated using a cubic polynomial.
1393             /// </summary>
1394             Cubic
1395         }
1396
1397         /// <summary>
1398         /// Enumeration for what state the animation is in.
1399         /// </summary>
1400         /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
1401         /// <since_tizen> 3 </since_tizen>
1402         public enum States
1403         {
1404             /// <summary>
1405             /// The animation has stopped.
1406             /// </summary>
1407             Stopped,
1408             /// <summary>
1409             /// The animation is playing.
1410             /// </summary>
1411             Playing,
1412             /// <summary>
1413             /// The animation is paused.
1414             /// </summary>
1415             Paused
1416         }
1417
1418     }
1419
1420 }