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 if (_animationFinishedEventCallback != null)
66 FinishedSignal().Disconnect(_animationFinishedEventCallback);
69 if (_animationProgressReachedEventCallback != null)
72 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
75 //Release your own unmanaged resources here.
76 //You should not access any managed member here except static instance.
77 //because the execution order of Finalizes is non-deterministic.
79 if (swigCPtr.Handle != global::System.IntPtr.Zero)
84 NDalicPINVOKE.delete_Animation(swigCPtr);
86 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
93 /// Create an initialized Animation.<br>
94 /// The animation will not loop.<br>
95 /// The default end action is "Cancel".<br>
96 /// The default Alpha function is linear.<br>
98 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
99 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
100 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
106 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
107 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
108 private event EventHandler _animationFinishedEventHandler;
110 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
111 * Finished signal is emitted when an Animation's animations have finished.
113 public event EventHandler Finished
117 if (_animationFinishedEventHandler == null)
120 Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
121 Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
123 _animationFinishedEventCallback = OnFinished;
124 FinishedSignal().Connect(_animationFinishedEventCallback);
126 Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
127 Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
131 _animationFinishedEventHandler += value;
135 _animationFinishedEventHandler -= value;
137 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
140 Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
141 Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
143 FinishedSignal().Disconnect(_animationFinishedEventCallback);
145 Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
146 Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
151 private void OnFinished(IntPtr data)
153 if (_animationFinishedEventHandler != null)
155 //here we send all data to user event handlers
156 _animationFinishedEventHandler(this, null);
160 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
161 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
162 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
163 private event EventHandler _animationProgressReachedEventHandler;
165 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
166 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
168 public event EventHandler ProgressReached
172 if (_animationProgressReachedEventHandler == null)
175 Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
176 Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
178 _animationProgressReachedEventCallback = OnProgressReached;
179 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
181 Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
182 Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
186 _animationProgressReachedEventHandler += value;
190 _animationProgressReachedEventHandler -= value;
192 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
195 Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
196 Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
198 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
200 Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
201 Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
206 private void OnProgressReached(IntPtr data)
208 if (_animationProgressReachedEventHandler != null)
210 //here we send all data to user event handlers
211 _animationProgressReachedEventHandler(this, null);
215 private float MilliSecondsToSeconds(int millisec)
217 return (float)millisec / 1000.0f;
220 private int SecondsToMilliSeconds(float sec)
222 return (int)(sec * 1000);
227 /// Gets/Sets the duration in milli seconds of the animation.
233 SetDuration(MilliSecondsToSeconds(value));
237 return SecondsToMilliSeconds(GetDuration());
242 /// Gets/Sets the default alpha function for the animation.
244 public AlphaFunction DefaultAlphaFunction
248 SetDefaultAlphaFunction(value);
252 AlphaFunction ret = GetDefaultAlphaFunction();
258 /// Queries the state of the animation.
269 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
270 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
271 /// Setting this parameter does not cause the animation to Play().<br>
272 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
273 /// The loop count is initially 1 for play once.<br>
283 int ret = GetLoopCount();
289 /// Gets/Sets the status of whether the animation will loop.<br>
290 /// This property resets the loop count and should not be used with LoopCount property.<br>
291 /// Setting this parameter does not cause the animation to Play().<br>
301 bool ret = IsLooping();
308 /// Gets/Sets the end action of the animation.<br>
309 /// This action is performed when the animation ends or if it is stopped.<br>
310 /// Default end action is Cancel.<br>
312 public EndActions EndAction
320 return GetEndAction();
326 /// Stops the animation.
328 /// <param name="action">end action can be set</param>
329 public void Stop(EndActions action = EndActions.Cancel)
331 SetEndAction(action);
332 NDalicPINVOKE.Animation_Stop(swigCPtr);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 /// Gets the current loop count.<br>
338 /// A value 0 indicating the current loop count when looping.<br>
340 public int CurrentLoop
344 return GetCurrentLoop();
349 /// Gets/Sets the disconnect action.<br>
350 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
351 /// Default action is to Cancel.<br>
353 public EndActions DisconnectAction
357 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// Gets/Sets the progress of the animation.<br>
371 /// The animation will play(or continue playing) from this point.<br>
372 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
373 /// otherwise, it will be ignored.<br>
375 public float CurrentProgress
379 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 /// Gets/Sets Specifies a speed factor for the animation.<br>
392 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
393 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
394 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
396 public float SpeedFactor
400 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412 /// Gets/Sets the playing range.<br>
413 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
414 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
416 public RelativeVector2 PlayRange
420 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
434 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
435 /// One notification can be set on each animation
437 public float ProgressNotification
441 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
447 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 /// Animates a property value by a relative amount.<br>
455 /// <param name="target">The target object to animate</param>
456 /// <param name="property">The target property to animate</param>
457 /// <param name="relativeValue">The property value will change by this amount</param>
458 /// <param name="alphaFunction">The alpha function to apply</param>
459 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
461 string _str1 = property.Substring(0, 1);
462 string _str2 = property.Substring(1);
463 string _str = _str1.ToLower() + _str2;
465 Property _prop = new Property(target, _str);
466 if (_prop.propertyIndex == Property.INVALID_INDEX)
468 throw new System.ArgumentException("second argument string property is invalid parameter!");
471 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
472 if(propertyType.Equals(PropertyType.Float))
474 System.Type type = relativeValue.GetType();
475 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
477 int num = (int)relativeValue;
478 relativeValue = (float)num;
482 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
484 if (alphaFunction != null)
486 AnimateBy(_prop, val, alphaFunction);
490 AnimateBy(_prop, val);
495 /// Animates a property value by a relative amount.<br>
497 /// <param name="target">The target object to animate</param>
498 /// <param name="property">The target property to animate</param>
499 /// <param name="relativeValue">The property value will change by this amount</param>
500 /// <param name="startTime">Start time of animation</param>
501 /// <param name="endTime">End time of animation</param>
502 /// <param name="alphaFunction">The alpha function to apply</param>
503 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
505 string _str1 = property.Substring(0, 1);
506 string _str2 = property.Substring(1);
507 string _str = _str1.ToLower() + _str2;
509 Property _prop = new Property(target, _str);
510 if (_prop.propertyIndex == Property.INVALID_INDEX)
512 throw new System.ArgumentException("second argument string property is invalid parameter!");
515 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
516 if(propertyType.Equals(PropertyType.Float))
518 System.Type type = relativeValue.GetType();
519 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
521 int num = (int)relativeValue;
522 relativeValue = (float)num;
526 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
528 if (alphaFunction != null)
530 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
531 AnimateBy(_prop, val, alphaFunction, time);
535 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
536 AnimateBy(_prop, val, time);
541 /// Animates a property to a destination value.<br>
543 /// <param name="target">The target object to animate</param>
544 /// <param name="property">The target property to animate</param>
545 /// <param name="destinationValue">The destination value</param>
546 /// <param name="alphaFunction">The alpha function to apply</param>
547 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
549 string _str1 = property.Substring(0, 1);
550 string _str2 = property.Substring(1);
551 string _str = _str1.ToLower() + _str2;
553 Property _prop = new Property(target, _str);
554 if (_prop.propertyIndex == Property.INVALID_INDEX)
556 throw new System.ArgumentException("second argument string property is invalid parameter!");
559 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
560 if(propertyType.Equals(PropertyType.Float))
562 System.Type type = destinationValue.GetType();
563 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
565 int num = (int)destinationValue;
566 destinationValue = (float)num;
570 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
572 if (alphaFunction != null)
574 AnimateTo(_prop, val, alphaFunction);
578 AnimateTo(_prop, val);
583 /// Animates a property to a destination value.<br>
585 /// <param name="target">The target object to animate</param>
586 /// <param name="property">The target property to animate</param>
587 /// <param name="destinationValue">The destination value</param>
588 /// <param name="alphaFunction">The alpha function to apply</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 AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
594 string _str1 = property.Substring(0, 1);
595 string _str2 = property.Substring(1);
596 string _str = _str1.ToLower() + _str2;
598 Property _prop = new Property(target, _str);
599 if (_prop.propertyIndex == Property.INVALID_INDEX)
601 throw new System.ArgumentException("second argument string property is invalid parameter!");
604 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
605 if(propertyType.Equals(PropertyType.Float))
607 System.Type type = destinationValue.GetType();
608 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
610 int num = (int)destinationValue;
611 destinationValue = (float)num;
615 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
617 if (alphaFunction != null)
619 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
620 AnimateTo(_prop, val, alphaFunction, time);
624 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
625 AnimateTo(_prop, val, time);
630 /// Animates a property between keyframes.
632 /// <param name="target">The target object to animate</param>
633 /// <param name="property">The target property to animate</param>
634 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
635 /// <param name="interpolation">The method used to interpolate between values</param>
636 /// <param name="alphaFunction">The alpha function to apply</param>
637 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
639 string _str1 = property.Substring(0, 1);
640 string _str2 = property.Substring(1);
641 string _str = _str1.ToLower() + _str2;
643 Property _prop = new Property(target, _str);
644 if (_prop.propertyIndex == Property.INVALID_INDEX)
646 throw new System.ArgumentException("second argument string property is invalid parameter!");
649 if (alphaFunction != null)
651 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
655 AnimateBetween(_prop, keyFrames, interpolation);
661 /// Animates a property between keyframes.
663 /// <param name="target">The target object to animate</param>
664 /// <param name="property">The target property to animate</param>
665 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
666 /// <param name="startTime">Start time of animation in milli seconds</param>
667 /// <param name="endTime">End time of animation in milli seconds</param>
668 /// <param name="interpolation">The method used to interpolate between values</param>
669 /// <param name="alphaFunction">The alpha function to apply</param>
670 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
672 string _str1 = property.Substring(0, 1);
673 string _str2 = property.Substring(1);
674 string _str = _str1.ToLower() + _str2;
676 Property _prop = new Property(target, _str);
677 if (_prop.propertyIndex == Property.INVALID_INDEX)
679 throw new System.ArgumentException("second argument string property is invalid parameter!");
682 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
683 if (alphaFunction != null)
685 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
689 AnimateBetween(_prop, keyFrames, time, interpolation);
694 /// Animates an view's position and orientation through a predefined path.<br>
695 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
696 /// If forward is the zero vector then no rotation will happen.<br>
698 /// <param name="view">The view to animate</param>
699 /// <param name="path">It defines position and orientation</param>
700 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
701 /// <param name="alphaFunction">The alpha function to apply</param>
702 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
704 if (alphaFunction == null)
706 Animate(view, path, forward);
710 Animate(view, path, forward, alphaFunction);
715 /// Animates an view's position and orientation through a predefined path.<br>
716 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
717 /// If forward is the zero vector then no rotation will happen.<br>
719 /// <param name="view">The view to animate</param>
720 /// <param name="path">It defines position and orientation</param>
721 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
722 /// <param name="startTime">Start time of animation</param>
723 /// <param name="endTime">End time of animation</param>
724 /// <param name="alphaFunction">The alpha function to apply</param>
725 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
727 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
728 if (alphaFunction == null)
730 Animate(view, path, forward, time);
734 Animate(view, path, forward, alphaFunction, time);
739 /// Creates an initialized Animation.<br>
740 /// The animation will not loop.<br>
741 /// The default end action is "Cancel".<br>
742 /// The default alpha function is linear.<br>
744 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756 /// Downcasts a handle to Animation handle.<br>
757 /// If handle points to an Animation object, the downcast produces valid handle.<br>
758 /// If not, the returned handle is left uninitialized.<br>
760 /// <param name="handle">Handle to an object</param>
761 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
762 public static Animation DownCast(BaseHandle handle)
764 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 internal Animation Assign(Animation rhs)
776 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 internal void SetDuration(float seconds)
783 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 internal float GetDuration()
789 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794 internal void SetLooping(bool looping)
796 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
797 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800 internal void SetLoopCount(int count)
802 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806 internal int GetLoopCount()
808 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
813 internal int GetCurrentLoop()
815 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
820 internal bool IsLooping()
822 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
823 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 internal void SetEndAction(Animation.EndActions action)
829 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 internal Animation.EndActions GetEndAction()
835 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
842 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846 internal Animation.EndActions GetDisconnectAction()
848 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
849 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
853 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
855 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal AlphaFunction GetDefaultAlphaFunction()
861 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
862 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866 internal void SetCurrentProgress(float progress)
868 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
872 internal float GetCurrentProgress()
874 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
875 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
879 internal void SetSpeedFactor(float factor)
881 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
882 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885 internal float GetSpeedFactor()
887 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
892 internal void SetPlayRange(Vector2 range)
894 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
895 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 internal Vector2 GetPlayRange()
900 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
906 /// Plays the animation.
910 NDalicPINVOKE.Animation_Play(swigCPtr);
911 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
912 #if DISABLE_ANIMATION
913 Stop(EndActions.StopFinal);
918 /// Plays the animation from a given point.<br>
919 /// The progress must be in the 0-1 interval or in the play range interval if defined,
920 /// otherwise, it will be ignored.<br>
922 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
923 public void PlayFrom(float progress)
925 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
926 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
930 /// Play the animation after a given delay time.<br/>
931 /// The delay time is not included in the looping time.<br/>
932 /// When the delay time is negative value, it would treat as play immediately.<br/>
934 /// <param name="delayMilliseconds">The delay time</param>
935 public void PlayAfter(int delayMilliseconds)
937 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
938 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
942 /// Pauses the animation.
946 NDalicPINVOKE.Animation_Pause(swigCPtr);
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950 internal Animation.States GetState()
952 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
953 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
958 /// Stops the animation.
962 NDalicPINVOKE.Animation_Stop(swigCPtr);
963 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 /// Clears the animation.<br>
968 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
972 NDalicPINVOKE.Animation_Clear(swigCPtr);
973 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
976 internal AnimationSignal FinishedSignal()
978 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
979 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
983 internal AnimationSignal ProgressReachedSignal()
985 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
986 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
990 internal void AnimateBy(Property target, PropertyValue relativeValue)
992 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
993 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
996 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
998 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
999 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1002 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1004 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1005 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1008 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1010 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1011 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1014 internal void AnimateTo(Property target, PropertyValue destinationValue)
1016 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1017 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1022 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1023 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1028 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1029 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1034 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1035 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1040 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1041 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1046 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1047 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1050 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1052 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1053 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1058 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1059 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1064 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1065 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1070 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1071 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1074 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1076 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1080 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1082 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1083 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1086 internal void Animate(View view, Path path, Vector3 forward)
1088 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1089 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1092 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1094 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1100 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1104 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1106 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1110 internal void Show(View view, float delaySeconds)
1112 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1116 internal void Hide(View view, float delaySeconds)
1118 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1123 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1125 public enum EndActions
1128 /// When the animation ends, the animated property values are saved.
1132 /// When the animation ends, the animated property values are forgotten.
1136 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1142 /// Enumeration for what interpolation method to use on key-frame animations.
1144 public enum Interpolation
1147 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1151 /// Values in between key frames are interpolated using a cubic polynomial.
1157 /// Enumeration for what state the animation is in.
1159 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1163 /// Animation has stopped
1167 /// The animation is playing
1171 /// The animation is paused