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)
56 if(type == DisposeTypes.Explicit)
59 //Release your own managed resources here.
60 //You should release all of your own disposable objects here.
61 NUILog.Debug("Animation.Dispose(Explicit)! GetState=" + this.GetState());
62 if(this.GetState() != States.Stopped)
66 NUILog.Error("Now Animation is playing! Clear and Reset here!");
69 else if(type == DisposeTypes.Implicit)
71 NUILog.Debug("Animation.Dispose(Implicit)! GetState=" + this.GetState());
72 if(this.GetState() != States.Stopped)
76 NUILog.Error("Now Animation is playing! Clear and Reset here!");
77 //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable");
81 //Release your own unmanaged resources here.
82 //You should not access any managed member here except static instance.
83 //because the execution order of Finalizes is non-deterministic.
85 if (swigCPtr.Handle != global::System.IntPtr.Zero)
90 NDalicPINVOKE.delete_Animation(swigCPtr);
92 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
99 /// Create an initialized Animation.<br>
100 /// The animation will not loop.<br>
101 /// The default end action is "Cancel".<br>
102 /// The default Alpha function is linear.<br>
104 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
105 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
106 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
112 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
113 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
114 private event EventHandler _animationFinishedEventHandler;
116 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
117 * Finished signal is emitted when an Animation's animations have finished.
119 public event EventHandler Finished
123 if (_animationFinishedEventHandler == null)
126 Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
127 Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
129 _animationFinishedEventCallback = OnFinished;
130 FinishedSignal().Connect(_animationFinishedEventCallback);
132 Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
133 Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
137 _animationFinishedEventHandler += value;
141 _animationFinishedEventHandler -= value;
143 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
146 Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
147 Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
149 FinishedSignal().Disconnect(_animationFinishedEventCallback);
151 Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
152 Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
157 private void OnFinished(IntPtr data)
159 if (_animationFinishedEventHandler != null)
161 //here we send all data to user event handlers
162 _animationFinishedEventHandler(this, null);
166 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
167 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
168 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
169 private event EventHandler _animationProgressReachedEventHandler;
171 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
172 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
174 public event EventHandler ProgressReached
178 if (_animationProgressReachedEventHandler == null)
181 Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
182 Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
184 _animationProgressReachedEventCallback = OnProgressReached;
185 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
187 Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
188 Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
192 _animationProgressReachedEventHandler += value;
196 _animationProgressReachedEventHandler -= value;
198 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
201 Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
202 Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
204 ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
206 Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
207 Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
212 private void OnProgressReached(IntPtr data)
214 if (_animationProgressReachedEventHandler != null)
216 //here we send all data to user event handlers
217 _animationProgressReachedEventHandler(this, null);
221 private float MilliSecondsToSeconds(int millisec)
223 return (float)millisec / 1000.0f;
226 private int SecondsToMilliSeconds(float sec)
228 return (int)(sec * 1000);
233 /// Gets/Sets the duration in milli seconds of the animation.
239 SetDuration(MilliSecondsToSeconds(value));
243 return SecondsToMilliSeconds(GetDuration());
248 /// Gets/Sets the default alpha function for the animation.
250 public AlphaFunction DefaultAlphaFunction
254 SetDefaultAlphaFunction(value);
258 AlphaFunction ret = GetDefaultAlphaFunction();
264 /// Queries the state of the animation.
275 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
276 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
277 /// Setting this parameter does not cause the animation to Play().<br>
278 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
279 /// The loop count is initially 1 for play once.<br>
289 int ret = GetLoopCount();
295 /// Gets/Sets the status of whether the animation will loop.<br>
296 /// This property resets the loop count and should not be used with LoopCount property.<br>
297 /// Setting this parameter does not cause the animation to Play().<br>
307 bool ret = IsLooping();
314 /// Gets/Sets the end action of the animation.<br>
315 /// This action is performed when the animation ends or if it is stopped.<br>
316 /// Default end action is Cancel.<br>
318 public EndActions EndAction
326 return GetEndAction();
332 /// Stops the animation.
334 /// <param name="action">end action can be set</param>
335 public void Stop(EndActions action = EndActions.Cancel)
337 SetEndAction(action);
338 NDalicPINVOKE.Animation_Stop(swigCPtr);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 /// Gets the current loop count.<br>
344 /// A value 0 indicating the current loop count when looping.<br>
346 public int CurrentLoop
350 return GetCurrentLoop();
355 /// Gets/Sets the disconnect action.<br>
356 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
357 /// Default action is to Cancel.<br>
359 public EndActions DisconnectAction
363 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 /// Gets/Sets the progress of the animation.<br>
377 /// The animation will play(or continue playing) from this point.<br>
378 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
379 /// otherwise, it will be ignored.<br>
381 public float CurrentProgress
385 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
397 /// Gets/Sets Specifies a speed factor for the animation.<br>
398 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
399 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
400 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
402 public float SpeedFactor
406 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
412 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418 /// Gets/Sets the playing range.<br>
419 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
420 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
422 public RelativeVector2 PlayRange
426 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
440 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
441 /// One notification can be set on each animation
443 public float ProgressNotification
447 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
448 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 /// Animates a property value by a relative amount.<br>
461 /// <param name="target">The target object to animate</param>
462 /// <param name="property">The target property to animate</param>
463 /// <param name="relativeValue">The property value will change by this amount</param>
464 /// <param name="alphaFunction">The alpha function to apply</param>
465 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
467 string _str1 = property.Substring(0, 1);
468 string _str2 = property.Substring(1);
469 string _str = _str1.ToLower() + _str2;
471 Property _prop = new Property(target, _str);
472 if (_prop.propertyIndex == Property.INVALID_INDEX)
474 throw new System.ArgumentException("second argument string property is invalid parameter!");
477 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
478 if(propertyType.Equals(PropertyType.Float))
480 System.Type type = relativeValue.GetType();
481 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
483 int num = (int)relativeValue;
484 relativeValue = (float)num;
488 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
490 if (alphaFunction != null)
492 AnimateBy(_prop, val, alphaFunction);
496 AnimateBy(_prop, val);
501 /// Animates a property value by a relative amount.<br>
503 /// <param name="target">The target object to animate</param>
504 /// <param name="property">The target property to animate</param>
505 /// <param name="relativeValue">The property value will change by this amount</param>
506 /// <param name="startTime">Start time of animation</param>
507 /// <param name="endTime">End time of animation</param>
508 /// <param name="alphaFunction">The alpha function to apply</param>
509 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
511 string _str1 = property.Substring(0, 1);
512 string _str2 = property.Substring(1);
513 string _str = _str1.ToLower() + _str2;
515 Property _prop = new Property(target, _str);
516 if (_prop.propertyIndex == Property.INVALID_INDEX)
518 throw new System.ArgumentException("second argument string property is invalid parameter!");
521 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
522 if(propertyType.Equals(PropertyType.Float))
524 System.Type type = relativeValue.GetType();
525 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
527 int num = (int)relativeValue;
528 relativeValue = (float)num;
532 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
534 if (alphaFunction != null)
536 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
537 AnimateBy(_prop, val, alphaFunction, time);
541 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
542 AnimateBy(_prop, val, time);
547 /// Animates a property to a destination value.<br>
549 /// <param name="target">The target object to animate</param>
550 /// <param name="property">The target property to animate</param>
551 /// <param name="destinationValue">The destination value</param>
552 /// <param name="alphaFunction">The alpha function to apply</param>
553 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
555 string _str1 = property.Substring(0, 1);
556 string _str2 = property.Substring(1);
557 string _str = _str1.ToLower() + _str2;
559 Property _prop = new Property(target, _str);
560 if (_prop.propertyIndex == Property.INVALID_INDEX)
562 throw new System.ArgumentException("second argument string property is invalid parameter!");
565 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
566 if(propertyType.Equals(PropertyType.Float))
568 System.Type type = destinationValue.GetType();
569 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
571 int num = (int)destinationValue;
572 destinationValue = (float)num;
576 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
578 if (alphaFunction != null)
580 AnimateTo(_prop, val, alphaFunction);
584 AnimateTo(_prop, val);
589 /// Animates a property to a destination value.<br>
591 /// <param name="target">The target object to animate</param>
592 /// <param name="property">The target property to animate</param>
593 /// <param name="destinationValue">The destination value</param>
594 /// <param name="alphaFunction">The alpha function to apply</param>
595 /// <param name="startTime">Start time of animation</param>
596 /// <param name="endTime">End time of animation</param>
597 /// <param name="alphaFunction">The alpha function to apply</param>
598 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
600 string _str1 = property.Substring(0, 1);
601 string _str2 = property.Substring(1);
602 string _str = _str1.ToLower() + _str2;
604 Property _prop = new Property(target, _str);
605 if (_prop.propertyIndex == Property.INVALID_INDEX)
607 throw new System.ArgumentException("second argument string property is invalid parameter!");
610 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
611 if(propertyType.Equals(PropertyType.Float))
613 System.Type type = destinationValue.GetType();
614 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
616 int num = (int)destinationValue;
617 destinationValue = (float)num;
621 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
623 if (alphaFunction != null)
625 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
626 AnimateTo(_prop, val, alphaFunction, time);
630 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
631 AnimateTo(_prop, val, time);
636 /// Animates a property between keyframes.
638 /// <param name="target">The target object to animate</param>
639 /// <param name="property">The target property to animate</param>
640 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
641 /// <param name="interpolation">The method used to interpolate between values</param>
642 /// <param name="alphaFunction">The alpha function to apply</param>
643 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
645 string _str1 = property.Substring(0, 1);
646 string _str2 = property.Substring(1);
647 string _str = _str1.ToLower() + _str2;
649 Property _prop = new Property(target, _str);
650 if (_prop.propertyIndex == Property.INVALID_INDEX)
652 throw new System.ArgumentException("second argument string property is invalid parameter!");
655 if (alphaFunction != null)
657 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
661 AnimateBetween(_prop, keyFrames, interpolation);
667 /// Animates a property between keyframes.
669 /// <param name="target">The target object to animate</param>
670 /// <param name="property">The target property to animate</param>
671 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
672 /// <param name="startTime">Start time of animation in milli seconds</param>
673 /// <param name="endTime">End time of animation in milli seconds</param>
674 /// <param name="interpolation">The method used to interpolate between values</param>
675 /// <param name="alphaFunction">The alpha function to apply</param>
676 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
678 string _str1 = property.Substring(0, 1);
679 string _str2 = property.Substring(1);
680 string _str = _str1.ToLower() + _str2;
682 Property _prop = new Property(target, _str);
683 if (_prop.propertyIndex == Property.INVALID_INDEX)
685 throw new System.ArgumentException("second argument string property is invalid parameter!");
688 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
689 if (alphaFunction != null)
691 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
695 AnimateBetween(_prop, keyFrames, time, interpolation);
700 /// Animates an view's position and orientation through a predefined path.<br>
701 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
702 /// If forward is the zero vector then no rotation will happen.<br>
704 /// <param name="view">The view to animate</param>
705 /// <param name="path">It defines position and orientation</param>
706 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
707 /// <param name="alphaFunction">The alpha function to apply</param>
708 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
710 if (alphaFunction == null)
712 Animate(view, path, forward);
716 Animate(view, path, forward, alphaFunction);
721 /// Animates an view's position and orientation through a predefined path.<br>
722 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
723 /// If forward is the zero vector then no rotation will happen.<br>
725 /// <param name="view">The view to animate</param>
726 /// <param name="path">It defines position and orientation</param>
727 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
728 /// <param name="startTime">Start time of animation</param>
729 /// <param name="endTime">End time of animation</param>
730 /// <param name="alphaFunction">The alpha function to apply</param>
731 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
733 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
734 if (alphaFunction == null)
736 Animate(view, path, forward, time);
740 Animate(view, path, forward, alphaFunction, time);
745 /// Creates an initialized Animation.<br>
746 /// The animation will not loop.<br>
747 /// The default end action is "Cancel".<br>
748 /// The default alpha function is linear.<br>
750 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
752 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
757 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 /// Downcasts a handle to Animation handle.<br>
763 /// If handle points to an Animation object, the downcast produces valid handle.<br>
764 /// If not, the returned handle is left uninitialized.<br>
766 /// <param name="handle">Handle to an object</param>
767 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
768 public static Animation DownCast(BaseHandle handle)
770 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780 internal Animation Assign(Animation rhs)
782 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
783 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 internal void SetDuration(float seconds)
789 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793 internal float GetDuration()
795 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800 internal void SetLooping(bool looping)
802 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806 internal void SetLoopCount(int count)
808 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
812 internal int GetLoopCount()
814 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
815 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819 internal int GetCurrentLoop()
821 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826 internal bool IsLooping()
828 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
829 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 internal void SetEndAction(Animation.EndActions action)
835 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
839 internal Animation.EndActions GetEndAction()
841 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
842 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
848 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
849 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
852 internal Animation.EndActions GetDisconnectAction()
854 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
855 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
861 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
862 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
865 internal AlphaFunction GetDefaultAlphaFunction()
867 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
868 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
872 internal void SetCurrentProgress(float progress)
874 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
875 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
878 internal float GetCurrentProgress()
880 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
881 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885 internal void SetSpeedFactor(float factor)
887 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891 internal float GetSpeedFactor()
893 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
894 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 internal void SetPlayRange(Vector2 range)
900 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
904 internal Vector2 GetPlayRange()
906 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
912 /// Plays the animation.
916 NDalicPINVOKE.Animation_Play(swigCPtr);
917 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918 #if DISABLE_ANIMATION
919 Stop(EndActions.StopFinal);
924 /// Plays the animation from a given point.<br>
925 /// The progress must be in the 0-1 interval or in the play range interval if defined,
926 /// otherwise, it will be ignored.<br>
928 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
929 public void PlayFrom(float progress)
931 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
932 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
936 /// Pauses the animation.
940 NDalicPINVOKE.Animation_Pause(swigCPtr);
941 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 internal Animation.States GetState()
946 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 /// Stops the animation.
956 NDalicPINVOKE.Animation_Stop(swigCPtr);
957 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
961 /// Clears the animation.<br>
962 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
966 NDalicPINVOKE.Animation_Clear(swigCPtr);
967 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
970 internal AnimationSignal FinishedSignal()
972 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
973 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
977 internal AnimationSignal ProgressReachedSignal()
979 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
980 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
984 internal void AnimateBy(Property target, PropertyValue relativeValue)
986 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
987 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
990 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
992 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
993 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
996 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
998 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
999 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1002 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1004 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1005 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008 internal void AnimateTo(Property target, PropertyValue destinationValue)
1010 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1011 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1014 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1016 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1017 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1022 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1023 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1028 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1029 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1034 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1035 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1040 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1041 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1046 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1047 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1050 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1052 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1053 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1058 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1059 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1064 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1065 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1070 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1071 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1074 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1076 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1080 internal void Animate(View view, Path path, Vector3 forward)
1082 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1083 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1086 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1088 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1089 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1092 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1094 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1100 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1104 internal void Show(View view, float delaySeconds)
1106 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1110 internal void Hide(View view, float delaySeconds)
1112 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1117 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1119 public enum EndActions
1122 /// When the animation ends, the animated property values are saved.
1126 /// When the animation ends, the animated property values are forgotten.
1130 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1136 /// Enumeration for what interpolation method to use on key-frame animations.
1138 public enum Interpolation
1141 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1145 /// Values in between key frames are interpolated using a cubic polynomial.
1151 /// Enumeration for what state the animation is in.
1153 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1157 /// Animation has stopped
1161 /// The animation is playing
1165 /// The animation is paused