1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
23 using System.Runtime.InteropServices;
24 using Tizen.NUI.BaseComponents;
27 /// Animation can be used to animate the properties of any number of objects, typically View.<br>
28 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br>
29 /// This is typically done in the object destructor, and requires either the Animation handle to be stored.<br>
30 /// 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>
31 /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.<br>
33 public class Animation : BaseHandle
35 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 /// To make Animation instance be disposed.
50 protected override void Dispose(DisposeTypes type)
57 if(type == DisposeTypes.Explicit)
60 //Release your own managed resources here.
61 //You should release all of your own disposable objects here.
64 //Release your own unmanaged resources here.
65 //You should not access any managed member here except static instance.
66 //because the execution order of Finalizes is non-deterministic.
68 if (swigCPtr.Handle != global::System.IntPtr.Zero)
73 NDalicPINVOKE.delete_Animation(swigCPtr);
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
82 /// Create an initialized Animation.<br>
83 /// The animation will not loop.<br>
84 /// The default end action is "Cancel".<br>
85 /// The default Alpha function is linear.<br>
87 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
88 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
89 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
91 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
95 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
96 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
97 private event EventHandler _animationFinishedEventHandler;
99 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
100 * Finished signal is emitted when an Animation's animations have finished.
102 public event EventHandler Finished
106 if (_animationFinishedEventHandler == null)
109 Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
110 Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
112 _animationFinishedEventCallback = OnFinished;
113 FinishedSignal().Connect(_animationFinishedEventCallback);
115 Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
116 Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
120 _animationFinishedEventHandler += value;
124 _animationFinishedEventHandler -= value;
126 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
129 Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
130 Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
132 FinishedSignal().Disconnect(_animationFinishedEventCallback);
134 Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
135 Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
140 private void OnFinished(IntPtr data)
142 if (_animationFinishedEventHandler != null)
144 //here we send all data to user event handlers
145 _animationFinishedEventHandler(this, null);
149 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
150 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
151 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
152 private event EventHandler _animationProgressReachedEventHandler;
154 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
155 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
157 public event EventHandler ProgressReached
161 if (_animationProgressReachedEventHandler == null)
164 Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
165 Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
167 _animationProgressReachedEventCallback = OnProgressReached;
168 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
170 Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
171 Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
175 _animationProgressReachedEventHandler += value;
179 _animationProgressReachedEventHandler -= value;
181 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
184 Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
185 Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
187 ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
189 Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
190 Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
195 private void OnProgressReached(IntPtr data)
197 if (_animationProgressReachedEventHandler != null)
199 //here we send all data to user event handlers
200 _animationProgressReachedEventHandler(this, null);
204 internal static Animation GetAnimationFromPtr(global::System.IntPtr cPtr)
206 Animation ret = new Animation(cPtr, false);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 private float MilliSecondsToSeconds(int millisec)
213 return (float)millisec / 1000.0f;
216 private int SecondsToMilliSeconds(float sec)
218 return (int)(sec * 1000);
223 /// Gets/Sets the duration in milli seconds of the animation.
229 SetDuration(MilliSecondsToSeconds(value));
233 return SecondsToMilliSeconds(GetDuration());
238 /// Gets/Sets the default alpha function for the animation.
240 public AlphaFunction DefaultAlphaFunction
244 SetDefaultAlphaFunction(value);
248 AlphaFunction ret = GetDefaultAlphaFunction();
254 /// Queries the state of the animation.
265 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
266 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
267 /// Setting this parameter does not cause the animation to Play().<br>
268 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
269 /// The loop count is initially 1 for play once.<br>
279 int ret = GetLoopCount();
285 /// Gets/Sets the status of whether the animation will loop.<br>
286 /// This property resets the loop count and should not be used with LoopCount property.<br>
287 /// Setting this parameter does not cause the animation to Play().<br>
297 bool ret = IsLooping();
304 /// Gets/Sets the end action of the animation.<br>
305 /// This action is performed when the animation ends or if it is stopped.<br>
306 /// Default end action is Cancel.<br>
308 public EndActions EndAction
316 return GetEndAction();
322 /// Stops the animation.
324 /// <param name="action">end action can be set</param>
325 public void Stop(EndActions action = EndActions.Cancel)
327 SetEndAction(action);
328 NDalicPINVOKE.Animation_Stop(swigCPtr);
329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 /// Gets the current loop count.<br>
334 /// A value 0 indicating the current loop count when looping.<br>
336 public int CurrentLoop
340 return GetCurrentLoop();
345 /// Gets/Sets the disconnect action.<br>
346 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
347 /// Default action is to Cancel.<br>
349 public EndActions DisconnectAction
353 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 /// Gets/Sets the progress of the animation.<br>
367 /// The animation will play(or continue playing) from this point.<br>
368 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
369 /// otherwise, it will be ignored.<br>
371 public float CurrentProgress
375 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387 /// Gets/Sets Specifies a speed factor for the animation.<br>
388 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
389 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
390 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
392 public float SpeedFactor
396 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
397 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 /// Gets/Sets the playing range.<br>
409 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
410 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
412 public RelativeVector2 PlayRange
416 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
430 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
431 /// One notification can be set on each animation
433 public float ProgressNotification
437 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
438 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449 /// Animates a property value by a relative amount.<br>
451 /// <param name="target">The target object to animate</param>
452 /// <param name="property">The target property to animate</param>
453 /// <param name="relativeValue">The property value will change by this amount</param>
454 /// <param name="alphaFunction">The alpha function to apply</param>
455 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
457 string _str1 = property.Substring(0, 1);
458 string _str2 = property.Substring(1);
459 string _str = _str1.ToLower() + _str2;
461 Property _prop = new Property(target, _str);
462 if (_prop.propertyIndex == Property.INVALID_INDEX)
464 throw new System.ArgumentException("second argument string property is invalid parameter!");
467 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
468 if(propertyType.Equals(PropertyType.Float))
470 System.Type type = relativeValue.GetType();
471 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
473 int num = (int)relativeValue;
474 relativeValue = (float)num;
478 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
480 if (alphaFunction != null)
482 AnimateBy(_prop, val, alphaFunction);
486 AnimateBy(_prop, val);
491 /// Animates a property value by a relative amount.<br>
493 /// <param name="target">The target object to animate</param>
494 /// <param name="property">The target property to animate</param>
495 /// <param name="relativeValue">The property value will change by this amount</param>
496 /// <param name="startTime">Start time of animation</param>
497 /// <param name="endTime">End time of animation</param>
498 /// <param name="alphaFunction">The alpha function to apply</param>
499 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
501 string _str1 = property.Substring(0, 1);
502 string _str2 = property.Substring(1);
503 string _str = _str1.ToLower() + _str2;
505 Property _prop = new Property(target, _str);
506 if (_prop.propertyIndex == Property.INVALID_INDEX)
508 throw new System.ArgumentException("second argument string property is invalid parameter!");
511 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
512 if(propertyType.Equals(PropertyType.Float))
514 System.Type type = relativeValue.GetType();
515 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
517 int num = (int)relativeValue;
518 relativeValue = (float)num;
522 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
524 if (alphaFunction != null)
526 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
527 AnimateBy(_prop, val, alphaFunction, time);
531 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
532 AnimateBy(_prop, val, time);
537 /// Animates a property to a destination value.<br>
539 /// <param name="target">The target object to animate</param>
540 /// <param name="property">The target property to animate</param>
541 /// <param name="destinationValue">The destination value</param>
542 /// <param name="alphaFunction">The alpha function to apply</param>
543 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
545 string _str1 = property.Substring(0, 1);
546 string _str2 = property.Substring(1);
547 string _str = _str1.ToLower() + _str2;
549 Property _prop = new Property(target, _str);
550 if (_prop.propertyIndex == Property.INVALID_INDEX)
552 throw new System.ArgumentException("second argument string property is invalid parameter!");
555 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
556 if(propertyType.Equals(PropertyType.Float))
558 System.Type type = destinationValue.GetType();
559 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
561 int num = (int)destinationValue;
562 destinationValue = (float)num;
566 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
568 if (alphaFunction != null)
570 AnimateTo(_prop, val, alphaFunction);
574 AnimateTo(_prop, val);
579 /// Animates a property to a destination value.<br>
581 /// <param name="target">The target object to animate</param>
582 /// <param name="property">The target property to animate</param>
583 /// <param name="destinationValue">The destination value</param>
584 /// <param name="alphaFunction">The alpha function to apply</param>
585 /// <param name="startTime">Start time of animation</param>
586 /// <param name="endTime">End time of animation</param>
587 /// <param name="alphaFunction">The alpha function to apply</param>
588 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
590 string _str1 = property.Substring(0, 1);
591 string _str2 = property.Substring(1);
592 string _str = _str1.ToLower() + _str2;
594 Property _prop = new Property(target, _str);
595 if (_prop.propertyIndex == Property.INVALID_INDEX)
597 throw new System.ArgumentException("second argument string property is invalid parameter!");
600 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
601 if(propertyType.Equals(PropertyType.Float))
603 System.Type type = destinationValue.GetType();
604 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
606 int num = (int)destinationValue;
607 destinationValue = (float)num;
611 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
613 if (alphaFunction != null)
615 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
616 AnimateTo(_prop, val, alphaFunction, time);
620 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
621 AnimateTo(_prop, val, time);
626 /// Animates a property between keyframes.
628 /// <param name="target">The target object to animate</param>
629 /// <param name="property">The target property to animate</param>
630 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
631 /// <param name="interpolation">The method used to interpolate between values</param>
632 /// <param name="alphaFunction">The alpha function to apply</param>
633 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
635 string _str1 = property.Substring(0, 1);
636 string _str2 = property.Substring(1);
637 string _str = _str1.ToLower() + _str2;
639 Property _prop = new Property(target, _str);
640 if (_prop.propertyIndex == Property.INVALID_INDEX)
642 throw new System.ArgumentException("second argument string property is invalid parameter!");
645 if (alphaFunction != null)
647 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
651 AnimateBetween(_prop, keyFrames, interpolation);
657 /// Animates a property between keyframes.
659 /// <param name="target">The target object to animate</param>
660 /// <param name="property">The target property to animate</param>
661 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
662 /// <param name="startTime">Start time of animation in milli seconds</param>
663 /// <param name="endTime">End time of animation in milli seconds</param>
664 /// <param name="interpolation">The method used to interpolate between values</param>
665 /// <param name="alphaFunction">The alpha function to apply</param>
666 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
668 string _str1 = property.Substring(0, 1);
669 string _str2 = property.Substring(1);
670 string _str = _str1.ToLower() + _str2;
672 Property _prop = new Property(target, _str);
673 if (_prop.propertyIndex == Property.INVALID_INDEX)
675 throw new System.ArgumentException("second argument string property is invalid parameter!");
678 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
679 if (alphaFunction != null)
681 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
685 AnimateBetween(_prop, keyFrames, time, interpolation);
690 /// Animates an view's position and orientation through a predefined path.<br>
691 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
692 /// If forward is the zero vector then no rotation will happen.<br>
694 /// <param name="view">The view to animate</param>
695 /// <param name="path">It defines position and orientation</param>
696 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
697 /// <param name="alphaFunction">The alpha function to apply</param>
698 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
700 if (alphaFunction == null)
702 Animate(view, path, forward);
706 Animate(view, path, forward, alphaFunction);
711 /// Animates an view's position and orientation through a predefined path.<br>
712 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
713 /// If forward is the zero vector then no rotation will happen.<br>
715 /// <param name="view">The view to animate</param>
716 /// <param name="path">It defines position and orientation</param>
717 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
718 /// <param name="startTime">Start time of animation</param>
719 /// <param name="endTime">End time of animation</param>
720 /// <param name="alphaFunction">The alpha function to apply</param>
721 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
723 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
724 if (alphaFunction == null)
726 Animate(view, path, forward, time);
730 Animate(view, path, forward, alphaFunction, time);
735 /// Creates an initialized Animation.<br>
736 /// The animation will not loop.<br>
737 /// The default end action is "Cancel".<br>
738 /// The default alpha function is linear.<br>
740 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
747 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752 /// Downcasts a handle to Animation handle.<br>
753 /// If handle points to an Animation object, the downcast produces valid handle.<br>
754 /// If not, the returned handle is left uninitialized.<br>
756 /// <param name="handle">Handle to an object</param>
757 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
758 public static Animation DownCast(BaseHandle handle)
760 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
761 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
765 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770 internal Animation Assign(Animation rhs)
772 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
773 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777 internal void SetDuration(float seconds)
779 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
780 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783 internal float GetDuration()
785 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790 internal void SetLooping(bool looping)
792 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
796 internal void SetLoopCount(int count)
798 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 internal int GetLoopCount()
804 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal int GetCurrentLoop()
811 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816 internal bool IsLooping()
818 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 internal void SetEndAction(Animation.EndActions action)
825 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829 internal Animation.EndActions GetEndAction()
831 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
836 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
838 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
842 internal Animation.EndActions GetDisconnectAction()
844 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
849 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
851 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
855 internal AlphaFunction GetDefaultAlphaFunction()
857 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
858 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
862 internal void SetCurrentProgress(float progress)
864 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
865 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
868 internal float GetCurrentProgress()
870 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
871 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
875 internal void SetSpeedFactor(float factor)
877 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
881 internal float GetSpeedFactor()
883 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
884 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
888 internal void SetPlayRange(Vector2 range)
890 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
891 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
894 internal Vector2 GetPlayRange()
896 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
897 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
902 /// Plays the animation.
906 NDalicPINVOKE.Animation_Play(swigCPtr);
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
908 #if DISABLE_ANIMATION
909 Stop(EndActions.StopFinal);
914 /// Plays the animation from a given point.<br>
915 /// The progress must be in the 0-1 interval or in the play range interval if defined,
916 /// otherwise, it will be ignored.<br>
918 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
919 public void PlayFrom(float progress)
921 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
922 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926 /// Pauses the animation.
930 NDalicPINVOKE.Animation_Pause(swigCPtr);
931 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
934 internal Animation.States GetState()
936 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
937 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
942 /// Stops the animation.
946 NDalicPINVOKE.Animation_Stop(swigCPtr);
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
951 /// Clears the animation.<br>
952 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
956 NDalicPINVOKE.Animation_Clear(swigCPtr);
957 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
960 internal AnimationSignal FinishedSignal()
962 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
963 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 internal AnimationSignal ProgressReachedSignal()
969 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
970 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
974 internal void AnimateBy(Property target, PropertyValue relativeValue)
976 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
977 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
980 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
982 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
983 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
986 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
988 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
989 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
992 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
994 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
995 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
998 internal void AnimateTo(Property target, PropertyValue destinationValue)
1000 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1001 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1004 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1006 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1007 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1010 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1012 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1013 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1016 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1018 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1019 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1022 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1024 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1025 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1028 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1030 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1031 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1034 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1036 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1037 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1040 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1042 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1043 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1046 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1048 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1049 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1052 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1054 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1055 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1058 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1060 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1061 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1064 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1066 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1067 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070 internal void Animate(View view, Path path, Vector3 forward)
1072 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1073 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1078 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1079 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1082 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1084 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1085 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1090 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1091 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094 internal void Show(View view, float delaySeconds)
1096 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1097 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100 internal void Hide(View view, float delaySeconds)
1102 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1107 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1109 public enum EndActions
1112 /// When the animation ends, the animated property values are saved.
1116 /// When the animation ends, the animated property values are forgotten.
1120 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1126 /// Enumeration for what interpolation method to use on key-frame animations.
1128 public enum Interpolation
1131 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1135 /// Values in between key frames are interpolated using a cubic polynomial.
1141 /// Enumeration for what state the animation is in.
1143 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1147 /// Animation has stopped
1151 /// The animation is playing
1155 /// The animation is paused