ddfac76ea6d85457f5f6d1e81ee68349747d48f5
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / Animation.cs
1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 //
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
18
19 namespace Tizen.NUI
20 {
21
22     using System;
23     using System.Runtime.InteropServices;
24
25     /// <summary>
26     /// Animation can be used to animate the properties of any number of objects, typically Actors.
27     /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.
28     /// This is typically done in the object destructor, and requires either the Animation handle to be stored.
29     /// The overall animation time is superseded by the values given in the Duration property used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.
30     /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.
31     /// </summary>
32     public class Animation : BaseHandle
33     {
34         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36         internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
37         {
38             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39         }
40
41         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
42         {
43             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44         }
45
46         ~Animation()
47         {
48             DisposeQueue.Instance.Add(this);
49         }
50
51         /// <summary>
52         /// To make Animation instance be disposed.
53         /// </summary>
54         public override void Dispose()
55         {
56             if (!Stage.IsInstalled())
57             {
58                 DisposeQueue.Instance.Add(this);
59                 return;
60             }
61
62             lock (this)
63             {
64                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
65                 {
66                     if (swigCMemOwn)
67                     {
68                         swigCMemOwn = false;
69                         NDalicPINVOKE.delete_Animation(swigCPtr);
70                     }
71                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
72                 }
73                 global::System.GC.SuppressFinalize(this);
74                 base.Dispose();
75             }
76         }
77
78         /// <summary>
79         /// Create an initialized Animation.
80         /// The animation will not loop.
81         /// The default end action is "Cancel".
82         /// The default Alpha function is linear.
83         /// Precodition : DurationmSeconds must be greater than zero.
84         /// </summary>
85         /// <param name="durationMilliSeconds">The duration in milli seconds (int).</param>
86         public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
87         {
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89         }
90
91         private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
92         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
93         private delegate void AnimationFinishedEventCallbackType(IntPtr data);
94         private event EventHandler _animationFinishedEventHandler;
95         /**
96         * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
97         * Finished signal is emitted when an Animation's animations have finished.
98         */
99         public event EventHandler Finished
100         {
101             add
102             {
103                 if (_animationFinishedEventHandler == null)
104                 {
105                     _animationFinishedEventCallback = OnFinished;
106                     FinishedSignal().Connect(_animationFinishedEventCallback);
107                 }
108
109                 _animationFinishedEventHandler += value;
110             }
111             remove
112             {
113                 _animationFinishedEventHandler -= value;
114
115                 if (_animationFinishedEventHandler == null && _animationFinishedEventCallback != null)
116                 {
117                     FinishedSignal().Disconnect(_animationFinishedEventCallback);
118                 }
119             }
120         }
121         private void OnFinished(IntPtr data)
122         {
123             if (_animationFinishedEventHandler != null)
124             {
125                 //here we send all data to user event handlers
126                 _animationFinishedEventHandler(this, null);
127             }
128         }
129
130
131         public static Animation GetAnimationFromPtr(global::System.IntPtr cPtr)
132         {
133             Animation ret = new Animation(cPtr, false);
134             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135             return ret;
136         }
137
138         private float MilliSecondsToSeconds(int millisec)
139         {
140             return (float)millisec / 1000.0f;
141         }
142
143         private int SecondsToMilliSeconds(float sec)
144         {
145             return (int)(sec * 1000);
146         }
147
148
149         /// <summary>
150         /// Gets/Sets the duration of animation
151         /// </summary>
152         public int Duration
153         {
154             set
155             {
156                 SetDuration(MilliSecondsToSeconds(value));
157             }
158             get
159             {
160                 return SecondsToMilliSeconds(GetDuration());
161             }
162         }
163
164         /// <summary>
165         ///  Gets/Sets the default alpha function for an animation.
166         /// </summary>
167         public AlphaFunction DefaultAlphaFunction
168         {
169             set
170             {
171                 SetDefaultAlphaFunction(value);
172             }
173             get
174             {
175                 AlphaFunction ret = GetDefaultAlphaFunction();
176                 return ret;
177             }
178         }
179
180         /// <summary>
181         /// Queries the state of the animation.
182         /// </summary>
183         public States State
184         {
185             get
186             {
187                 return GetState();
188             }
189         }
190
191         /// <summary>
192         /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.
193         /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.
194         /// Setting this parameter does not cause the animation to Play().
195         /// 
196         /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever. 
197         /// The loop count is initially 1 for play once.
198         /// </summary>
199         public int LoopCount
200         {
201             set
202             {
203                 SetLoopCount(value);
204             }
205             get
206             {
207                 int ret = GetLoopCount();
208                 return ret;
209             }
210         }
211
212         /// <summary>
213         /// Gets/Sets the status of whether the animation will loop.
214         /// This property resets the loop count and should not be used with LoopCount property.
215         /// Setting this parameter does not cause the animation to Play().
216         /// </summary>
217         public bool Looping
218         {
219             set
220             {
221                 SetLooping(value);
222             }
223             get
224             {
225                 bool ret = IsLooping();
226                 return ret;
227             }
228         }
229
230
231         /// <summary>
232         /// Gets/Sets the end action of the animation.
233         /// This action is performed when the animation ends or if it is stopped.
234         /// Default end action is Cancel
235         /// </summary>
236         public EndActions EndAction
237         {
238             set
239             {
240                 SetEndAction(value);
241             }
242             get
243             {
244                 return GetEndAction();
245             }
246         }
247
248
249         /// <summary>
250         /// Stops the animation.
251         /// </summary>
252         /// <param name="action">end action can be set</param>
253         public void Stop(EndActions action = EndActions.Cancel)
254         {
255             SetEndAction(action);
256             NDalicPINVOKE.Animation_Stop(swigCPtr);
257             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258         }
259
260         /// <summary>
261         /// Gets the current loop count.
262         /// A value 0 to CurrentLoop indicating the current loop count when looping.
263         /// </summary>
264         public int CurrentLoop
265         {
266             get
267             {
268                 return GetCurrentLoop();
269             }
270         }
271
272         /// <summary>
273         /// Gets/Sets the disconnect action.
274         /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
275         /// Default action is to Cancel.
276         /// </summary>
277         public EndActions DisconnectAction
278         {
279             set
280             {
281                 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
282                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283             }
284             get
285             {
286                 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
287                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288                 return ret;
289             }
290         }
291
292
293         /// <summary>
294         /// Gets/Sets the progress of the animation.
295         /// The animation will play(or continue playing) from this point.
296         /// The progress must be in the 0-1 interval or in the play range interval if defined
297         /// otherwise, it will be ignored.
298         /// </summary>
299         public float CurrentProgress
300         {
301             set
302             {
303                 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
304                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305             }
306             get
307             {
308                 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
309                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310                 return ret;
311             }
312         }
313
314         /// <summary>
315         /// Gets/Sets Specifies a speed factor for the animation.
316         /// The speed factor is a multiplier of the normal velocity of the animation.
317         /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.
318         /// It is also possible to specify a negative multiplier to play the animation in reverse.
319         /// </summary>
320         public float SpeedFactor
321         {
322             set
323             {
324                 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
325                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326             }
327             get
328             {
329                 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
330                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331                 return ret;
332             }
333         }
334
335         /// <summary>
336         /// Gets/Sets the playing range.
337         /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
338         /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.
339         /// </summary>
340         public Vector2 PlayRange
341         {
342             set
343             {
344                 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
345                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346             }
347             get
348             {
349                 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
350                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351                 return ret;
352             }
353         }
354
355         /// <summary>
356         /// Animates a property value by a relative amount.
357         /// The default alpha function will be used.
358         /// The effect will start & end when the animation begins & ends.
359         /// </summary>
360         /// <param name="target">The target object to animate</param>
361         /// <param name="property">The target property to animate</param>
362         /// <param name="relativeValue">The property value will change by this amount</param>
363         /// <param name="alphaFunction">The alpha function to apply</param>
364         public void AnimateBy(Actor target, string property, object relativeValue, AlphaFunction alphaFunction = null)
365         {
366             string _str1 = property.Substring(0, 1);
367             string _str2 = property.Substring(1);
368             string _str = _str1.ToLower() + _str2;
369
370             Property _prop = new Property(target, _str);
371             if (_prop.propertyIndex == Property.INVALID_INDEX)
372             {
373                 throw new System.Exception("second argument string property is invalid parameter!");
374             }
375
376             dynamic obj = (object)relativeValue;
377
378             if (alphaFunction != null)
379             {
380                 AnimateBy(_prop, new PropertyValue(obj), alphaFunction);
381             }
382             else
383             {
384                 AnimateBy(_prop, new PropertyValue(obj));
385             }
386         }
387
388         /// <summary>
389         /// Animates a property value by a relative amount.
390         /// The default alpha function will be used.
391         /// The effect will start & end when the animation begins & ends.
392         /// </summary>
393         /// <param name="target">The target object to animate</param>
394         /// <param name="property">The target property to animate</param>
395         /// <param name="relativeValue">The property value will change by this amount</param>
396         /// <param name="startTime">Start time of animation</param>
397         /// <param name="endTime">End time of animation</param>
398         /// <param name="alphaFunction">The alpha function to apply</param>
399         public void AnimateBy(Actor target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
400         {
401             string _str1 = property.Substring(0, 1);
402             string _str2 = property.Substring(1);
403             string _str = _str1.ToLower() + _str2;
404
405             Property _prop = new Property(target, _str);
406             if (_prop.propertyIndex == Property.INVALID_INDEX)
407             {
408                 throw new System.Exception("second argument string property is invalid parameter!");
409             }
410
411             dynamic obj = (object)relativeValue;
412
413             if (alphaFunction != null)
414             {
415                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
416                 AnimateBy(_prop, new PropertyValue(obj), alphaFunction, time);
417             }
418             else
419             {
420                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
421                 AnimateBy(_prop, new PropertyValue(obj), time);
422             }
423         }
424
425         /// <summary>
426         /// Animates a property to a destination value.
427         /// The default alpha function will be used.
428         /// The effect will start & end when the animation begins & ends.
429         /// </summary>
430         /// <param name="target">The target object to animate</param>
431         /// <param name="property">The target property to animate</param>
432         /// <param name="destinationValue">The destination value</param>
433         /// <param name="alphaFunction">The alpha function to apply</param>
434         public void AnimateTo(Actor target, string property, object destinationValue, AlphaFunction alphaFunction = null)
435         {
436             string _str1 = property.Substring(0, 1);
437             string _str2 = property.Substring(1);
438             string _str = _str1.ToLower() + _str2;
439
440             Property _prop = new Property(target, _str);
441             if (_prop.propertyIndex == Property.INVALID_INDEX)
442             {
443                 throw new System.Exception("second argument string property is invalid parameter!");
444             }
445
446             dynamic obj = (object)destinationValue;
447
448             if (alphaFunction != null)
449             {
450                 AnimateTo(_prop, new PropertyValue(obj), alphaFunction);
451             }
452             else
453             {
454                 AnimateTo(_prop, new PropertyValue(obj));
455             }
456         }
457
458         /// <summary>
459         /// Animates a property to a destination value.
460         /// The default alpha function will be used.
461         /// The effect will start & end when the animation begins & ends.
462         /// </summary>
463         /// <param name="target">The target object to animate</param>
464         /// <param name="property">The target property to animate</param>
465         /// <param name="destinationValue">The destination value</param>
466         /// <param name="alphaFunction">The alpha function to apply</param>
467         /// <param name="startTime">Start time of animation</param>
468         /// <param name="endTime">End time of animation</param>
469         /// <param name="alphaFunction"></param>
470         public void AnimateTo(Actor target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
471         {
472             string _str1 = property.Substring(0, 1);
473             string _str2 = property.Substring(1);
474             string _str = _str1.ToLower() + _str2;
475
476             Property _prop = new Property(target, _str);
477             if (_prop.propertyIndex == Property.INVALID_INDEX)
478             {
479                 throw new System.Exception("second argument string property is invalid parameter!");
480             }
481
482             dynamic obj = (object)destinationValue;
483
484             if (alphaFunction != null)
485             {
486                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
487                 AnimateTo(_prop, new PropertyValue(obj), alphaFunction, time);
488             }
489             else
490             {
491                 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
492                 AnimateTo(_prop, new PropertyValue(obj), time);
493             }
494         }
495
496         /// <summary>
497         /// Animates a property between keyframes.
498         /// </summary>
499         /// <param name="target">The target object to animate</param>
500         /// <param name="property">The target property to animate</param>
501         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
502         /// <param name="interpolation">The method used to interpolate between values</param>
503         /// <param name="alphaFunction">The alpha function to apply</param>
504         public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
505         {
506             string _str1 = property.Substring(0, 1);
507             string _str2 = property.Substring(1);
508             string _str = _str1.ToLower() + _str2;
509
510             Property _prop = new Property(target, _str);
511             if (_prop.propertyIndex == Property.INVALID_INDEX)
512             {
513                 throw new System.Exception("second argument string property is invalid parameter!");
514             }
515
516             if (alphaFunction != null)
517             {
518                 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
519             }
520             else
521             {
522                 AnimateBetween(_prop, keyFrames, interpolation);
523             }
524         }
525
526
527         /// <summary>
528         /// Animates a property between keyframes.
529         /// </summary>
530         /// <param name="target">The target object to animate</param>
531         /// <param name="property">The target property to animate</param>
532         /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
533         /// <param name="startTime">Start time of animation</param>
534         /// <param name="endTime">End time of animation</param>
535         /// <param name="interpolation">The method used to interpolate between values</param>
536         /// <param name="alphaFunction">The alpha function to apply</param>
537         public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
538         {
539             string _str1 = property.Substring(0, 1);
540             string _str2 = property.Substring(1);
541             string _str = _str1.ToLower() + _str2;
542
543             Property _prop = new Property(target, _str);
544             if (_prop.propertyIndex == Property.INVALID_INDEX)
545             {
546                 throw new System.Exception("second argument string property is invalid parameter!");
547             }
548
549             Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
550             if (alphaFunction != null)
551             {
552                 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
553             }
554             else
555             {
556                 AnimateBetween(_prop, keyFrames, time, interpolation);
557             }
558         }
559
560         /// <summary>
561         /// Animates an actor's position and orientation through a predefined path.
562         /// The actor will rotate to orient the supplied forward vector with the path's tangent. 
563         /// If forward is the zero vector then no rotation will happen.
564         /// </summary>
565         /// <param name="actor">The actor to animate</param>
566         /// <param name="path">It defines position and orientation</param>
567         /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
568         /// <param name="alphaFunction">The alpha function to apply</param>
569         public void AnimatePath(Actor actor, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
570         {
571             if (alphaFunction == null)
572             {
573                 Animate(actor, path, forward);
574             }
575             else
576             {
577                 Animate(actor, path, forward, alphaFunction);
578             }
579         }
580
581         /// <summary>
582         /// Animates an actor's position and orientation through a predefined path.
583         /// The actor will rotate to orient the supplied forward vector with the path's tangent. 
584         /// If forward is the zero vector then no rotation will happen.
585         /// </summary>
586         /// <param name="actor">The actor to animate</param>
587         /// <param name="path">It defines position and orientation</param>
588         /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
589         /// <param name="startTime">Start time of animation</param>
590         /// <param name="endTime">End time of animation</param>
591         /// <param name="alphaFunction">The alpha function to apply</param>
592         public void AnimatePath(Actor actor, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
593         {
594             TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
595             if (alphaFunction == null)
596             {
597                 Animate(actor, path, forward, time);
598             }
599             else
600             {
601                 Animate(actor, path, forward, alphaFunction, time);
602             }
603         }
604
605         /// <summary>
606         /// Creates an initialized Animation.
607         /// The animation will not loop.
608         /// The default end action is "Cancel".
609         /// The default alpha function is linear.
610         /// </summary>
611         public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
612         {
613             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614         }
615
616         internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
617         {
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619
620         }
621
622         /// <summary>
623         /// Downcasts a handle to Animation handle.
624         /// If handle points to an Animation object, the downcast produces valid handle.
625         /// If not, the returned handle is left uninitialized.
626         /// </summary>
627         /// <param name="handle">Handle to an object</param>
628         /// <returns>Handle to an Animation object or an uninitialized handle</returns>
629         public static Animation DownCast(BaseHandle handle)
630         {
631             Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
632             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633             return ret;
634         }
635
636         internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
637         {
638             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639         }
640
641         internal Animation Assign(Animation rhs)
642         {
643             Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
644             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
645             return ret;
646         }
647
648         internal void SetDuration(float seconds)
649         {
650             NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
651             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652         }
653
654         internal float GetDuration()
655         {
656             float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658             return ret;
659         }
660
661         internal void SetLooping(bool looping)
662         {
663             NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665         }
666
667         internal void SetLoopCount(int count)
668         {
669             NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
670             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671         }
672
673         internal int GetLoopCount()
674         {
675             int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
676             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677             return ret;
678         }
679
680         internal int GetCurrentLoop()
681         {
682             int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
683             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684             return ret;
685         }
686
687         internal bool IsLooping()
688         {
689             bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
690             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691             return ret;
692         }
693
694         internal void SetEndAction(Animation.EndActions action)
695         {
696             NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
697             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698         }
699
700         internal Animation.EndActions GetEndAction()
701         {
702             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
703             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704             return ret;
705         }
706
707         internal void SetDisconnectAction(Animation.EndActions disconnectAction)
708         {
709             NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
710             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
711         }
712
713         internal Animation.EndActions GetDisconnectAction()
714         {
715             Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
716             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717             return ret;
718         }
719
720         internal void SetDefaultAlphaFunction(AlphaFunction alpha)
721         {
722             NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
723             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724         }
725
726         internal AlphaFunction GetDefaultAlphaFunction()
727         {
728             AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
729             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730             return ret;
731         }
732
733         internal void SetCurrentProgress(float progress)
734         {
735             NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
736             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737         }
738
739         internal float GetCurrentProgress()
740         {
741             float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
742             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
743             return ret;
744         }
745
746         internal void SetSpeedFactor(float factor)
747         {
748             NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
749             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
750         }
751
752         internal float GetSpeedFactor()
753         {
754             float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
755             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756             return ret;
757         }
758
759         internal void SetPlayRange(Vector2 range)
760         {
761             NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
762             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
763         }
764
765         internal Vector2 GetPlayRange()
766         {
767             Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
768             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769             return ret;
770         }
771
772         /// <summary>
773         /// Play the animation.
774         /// </summary>
775         public void Play()
776         {
777             NDalicPINVOKE.Animation_Play(swigCPtr);
778             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779         }
780
781         /// <summary>
782         /// Plays the animation from a given point.
783         /// The progress must be in the 0-1 interval or in the play range interval if defined 
784         /// otherwise, it will be ignored.
785         /// </summary>
786         /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
787         public void PlayFrom(float progress)
788         {
789             NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
790             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791         }
792
793         /// <summary>
794         /// Pauses the animation.
795         /// </summary>
796         public void Pause()
797         {
798             NDalicPINVOKE.Animation_Pause(swigCPtr);
799             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800         }
801
802         internal Animation.States GetState()
803         {
804             Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
805             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806             return ret;
807         }
808
809         /// <summary>
810         /// Stops the animation.
811         /// </summary>
812         public void Stop()
813         {
814             NDalicPINVOKE.Animation_Stop(swigCPtr);
815             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816         }
817
818         /// <summary>
819         /// Clears the animation.
820         /// This disconnects any objects that were being animated, effectively stopping the animation.
821         /// </summary>
822         public void Clear()
823         {
824             NDalicPINVOKE.Animation_Clear(swigCPtr);
825             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826         }
827
828         internal AnimationSignal FinishedSignal()
829         {
830             AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
831             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
832             return ret;
833         }
834
835         internal void AnimateBy(Property target, PropertyValue relativeValue)
836         {
837             NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
838             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
839         }
840
841         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
842         {
843             NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
844             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
845         }
846
847         internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
848         {
849             NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
850             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851         }
852
853         internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
854         {
855             NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
856             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
857         }
858
859         internal void AnimateTo(Property target, PropertyValue destinationValue)
860         {
861             NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
862             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863         }
864
865         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
866         {
867             NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
868             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
869         }
870
871         internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
872         {
873             NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
874             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
875         }
876
877         internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
878         {
879             NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
880             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
881         }
882
883         internal void AnimateBetween(Property target, KeyFrames keyFrames)
884         {
885             NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
886             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
887         }
888
889         internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
890         {
891             NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
892             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
893         }
894
895         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
896         {
897             NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
898             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
899         }
900
901         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
902         {
903             NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
904             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
905         }
906
907         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
908         {
909             NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
910             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911         }
912
913         internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
914         {
915             NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
916             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917         }
918
919         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
920         {
921             NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
922             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
923         }
924
925         internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
926         {
927             NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
928             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
929         }
930
931         internal void Animate(Actor actor, Path path, Vector3 forward)
932         {
933             NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward));
934             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
935         }
936
937         internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha)
938         {
939             NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
940             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
941         }
942
943         internal void Animate(Actor actor, Path path, Vector3 forward, TimePeriod period)
944         {
945             NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
946             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
947         }
948
949         internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
950         {
951             NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
952             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
953         }
954
955         internal void Show(Actor actor, float delaySeconds)
956         {
957             NDalicPINVOKE.Animation_Show(swigCPtr, Actor.getCPtr(actor), delaySeconds);
958             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
959         }
960
961         internal void Hide(Actor actor, float delaySeconds)
962         {
963             NDalicPINVOKE.Animation_Hide(swigCPtr, Actor.getCPtr(actor), delaySeconds);
964             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
965         }
966
967         /// <summary>
968         /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
969         /// Cancel : When the animation ends, the animated property values are saved.
970         /// Discard : When the animation ends, the animated property values are forgotten.
971         /// StopFinal : If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
972         /// </summary>
973         public enum EndActions
974         {
975             Cancel,
976             Discard,
977             StopFinal
978         }
979
980         /// <summary>
981         /// Enumeration for what interpolation method to use on key-frame animations.
982         /// Linear : Values in between key frames are interpolated using a linear polynomial. (Default)
983         /// Cubic : Values in between key frames are interpolated using a cubic polynomial.
984         /// </summary>
985         public enum Interpolation
986         {
987             Linear,
988             Cubic
989         }
990
991         /// <summary>
992         /// Enumeration for what state the animation is in.
993         /// Note: Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.
994         /// </summary>
995         public enum States
996         {
997             Stopped,
998             Playing,
999             Paused
1000         }
1001
1002     }
1003
1004 }