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);
150 internal static Animation GetAnimationFromPtr(global::System.IntPtr cPtr)
152 Animation ret = new Animation(cPtr, false);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 private float MilliSecondsToSeconds(int millisec)
159 return (float)millisec / 1000.0f;
162 private int SecondsToMilliSeconds(float sec)
164 return (int)(sec * 1000);
169 /// Gets/Sets the duration in milli seconds of the animation.
175 SetDuration(MilliSecondsToSeconds(value));
179 return SecondsToMilliSeconds(GetDuration());
184 /// Gets/Sets the default alpha function for the animation.
186 public AlphaFunction DefaultAlphaFunction
190 SetDefaultAlphaFunction(value);
194 AlphaFunction ret = GetDefaultAlphaFunction();
200 /// Queries the state of the animation.
211 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
212 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
213 /// Setting this parameter does not cause the animation to Play().<br>
214 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
215 /// The loop count is initially 1 for play once.<br>
225 int ret = GetLoopCount();
231 /// Gets/Sets the status of whether the animation will loop.<br>
232 /// This property resets the loop count and should not be used with LoopCount property.<br>
233 /// Setting this parameter does not cause the animation to Play().<br>
243 bool ret = IsLooping();
250 /// Gets/Sets the end action of the animation.<br>
251 /// This action is performed when the animation ends or if it is stopped.<br>
252 /// Default end action is Cancel.<br>
254 public EndActions EndAction
262 return GetEndAction();
268 /// Stops the animation.
270 /// <param name="action">end action can be set</param>
271 public void Stop(EndActions action = EndActions.Cancel)
273 SetEndAction(action);
274 NDalicPINVOKE.Animation_Stop(swigCPtr);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 /// Gets the current loop count.<br>
280 /// A value 0 indicating the current loop count when looping.<br>
282 public int CurrentLoop
286 return GetCurrentLoop();
291 /// Gets/Sets the disconnect action.<br>
292 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
293 /// Default action is to Cancel.<br>
295 public EndActions DisconnectAction
299 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312 /// Gets/Sets the progress of the animation.<br>
313 /// The animation will play(or continue playing) from this point.<br>
314 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
315 /// otherwise, it will be ignored.<br>
317 public float CurrentProgress
321 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 /// Gets/Sets Specifies a speed factor for the animation.<br>
334 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
335 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
336 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
338 public float SpeedFactor
342 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 /// Gets/Sets the playing range.<br>
355 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
356 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
358 public RelativeVector2 PlayRange
362 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
368 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
374 /// Animates a property value by a relative amount.<br>
376 /// <param name="target">The target object to animate</param>
377 /// <param name="property">The target property to animate</param>
378 /// <param name="relativeValue">The property value will change by this amount</param>
379 /// <param name="alphaFunction">The alpha function to apply</param>
380 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
382 string _str1 = property.Substring(0, 1);
383 string _str2 = property.Substring(1);
384 string _str = _str1.ToLower() + _str2;
386 Property _prop = new Property(target, _str);
387 if (_prop.propertyIndex == Property.INVALID_INDEX)
389 throw new System.ArgumentException("second argument string property is invalid parameter!");
392 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
393 if(propertyType.Equals(PropertyType.Float))
395 System.Type type = relativeValue.GetType();
396 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
398 int num = (int)relativeValue;
399 relativeValue = (float)num;
403 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
405 if (alphaFunction != null)
407 AnimateBy(_prop, val, alphaFunction);
411 AnimateBy(_prop, val);
416 /// Animates a property value by a relative amount.<br>
418 /// <param name="target">The target object to animate</param>
419 /// <param name="property">The target property to animate</param>
420 /// <param name="relativeValue">The property value will change by this amount</param>
421 /// <param name="startTime">Start time of animation</param>
422 /// <param name="endTime">End time of animation</param>
423 /// <param name="alphaFunction">The alpha function to apply</param>
424 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
426 string _str1 = property.Substring(0, 1);
427 string _str2 = property.Substring(1);
428 string _str = _str1.ToLower() + _str2;
430 Property _prop = new Property(target, _str);
431 if (_prop.propertyIndex == Property.INVALID_INDEX)
433 throw new System.ArgumentException("second argument string property is invalid parameter!");
436 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
437 if(propertyType.Equals(PropertyType.Float))
439 System.Type type = relativeValue.GetType();
440 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
442 int num = (int)relativeValue;
443 relativeValue = (float)num;
447 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
449 if (alphaFunction != null)
451 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
452 AnimateBy(_prop, val, alphaFunction, time);
456 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
457 AnimateBy(_prop, val, time);
462 /// Animates a property to a destination value.<br>
464 /// <param name="target">The target object to animate</param>
465 /// <param name="property">The target property to animate</param>
466 /// <param name="destinationValue">The destination value</param>
467 /// <param name="alphaFunction">The alpha function to apply</param>
468 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
470 string _str1 = property.Substring(0, 1);
471 string _str2 = property.Substring(1);
472 string _str = _str1.ToLower() + _str2;
474 Property _prop = new Property(target, _str);
475 if (_prop.propertyIndex == Property.INVALID_INDEX)
477 throw new System.ArgumentException("second argument string property is invalid parameter!");
480 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
481 if(propertyType.Equals(PropertyType.Float))
483 System.Type type = destinationValue.GetType();
484 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
486 int num = (int)destinationValue;
487 destinationValue = (float)num;
491 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
493 if (alphaFunction != null)
495 AnimateTo(_prop, val, alphaFunction);
499 AnimateTo(_prop, val);
504 /// Animates a property to a destination value.<br>
506 /// <param name="target">The target object to animate</param>
507 /// <param name="property">The target property to animate</param>
508 /// <param name="destinationValue">The destination value</param>
509 /// <param name="alphaFunction">The alpha function to apply</param>
510 /// <param name="startTime">Start time of animation</param>
511 /// <param name="endTime">End time of animation</param>
512 /// <param name="alphaFunction">The alpha function to apply</param>
513 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
515 string _str1 = property.Substring(0, 1);
516 string _str2 = property.Substring(1);
517 string _str = _str1.ToLower() + _str2;
519 Property _prop = new Property(target, _str);
520 if (_prop.propertyIndex == Property.INVALID_INDEX)
522 throw new System.ArgumentException("second argument string property is invalid parameter!");
525 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
526 if(propertyType.Equals(PropertyType.Float))
528 System.Type type = destinationValue.GetType();
529 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
531 int num = (int)destinationValue;
532 destinationValue = (float)num;
536 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
538 if (alphaFunction != null)
540 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
541 AnimateTo(_prop, val, alphaFunction, time);
545 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
546 AnimateTo(_prop, val, time);
551 /// Animates a property between keyframes.
553 /// <param name="target">The target object to animate</param>
554 /// <param name="property">The target property to animate</param>
555 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
556 /// <param name="interpolation">The method used to interpolate between values</param>
557 /// <param name="alphaFunction">The alpha function to apply</param>
558 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
560 string _str1 = property.Substring(0, 1);
561 string _str2 = property.Substring(1);
562 string _str = _str1.ToLower() + _str2;
564 Property _prop = new Property(target, _str);
565 if (_prop.propertyIndex == Property.INVALID_INDEX)
567 throw new System.ArgumentException("second argument string property is invalid parameter!");
570 if (alphaFunction != null)
572 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
576 AnimateBetween(_prop, keyFrames, interpolation);
582 /// Animates a property between keyframes.
584 /// <param name="target">The target object to animate</param>
585 /// <param name="property">The target property to animate</param>
586 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
587 /// <param name="startTime">Start time of animation in milli seconds</param>
588 /// <param name="endTime">End time of animation in milli seconds</param>
589 /// <param name="interpolation">The method used to interpolate between values</param>
590 /// <param name="alphaFunction">The alpha function to apply</param>
591 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
593 string _str1 = property.Substring(0, 1);
594 string _str2 = property.Substring(1);
595 string _str = _str1.ToLower() + _str2;
597 Property _prop = new Property(target, _str);
598 if (_prop.propertyIndex == Property.INVALID_INDEX)
600 throw new System.ArgumentException("second argument string property is invalid parameter!");
603 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
604 if (alphaFunction != null)
606 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
610 AnimateBetween(_prop, keyFrames, time, interpolation);
615 /// Animates an view's position and orientation through a predefined path.<br>
616 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
617 /// If forward is the zero vector then no rotation will happen.<br>
619 /// <param name="view">The view to animate</param>
620 /// <param name="path">It defines position and orientation</param>
621 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
622 /// <param name="alphaFunction">The alpha function to apply</param>
623 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
625 if (alphaFunction == null)
627 Animate(view, path, forward);
631 Animate(view, path, forward, alphaFunction);
636 /// Animates an view's position and orientation through a predefined path.<br>
637 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
638 /// If forward is the zero vector then no rotation will happen.<br>
640 /// <param name="view">The view to animate</param>
641 /// <param name="path">It defines position and orientation</param>
642 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
643 /// <param name="startTime">Start time of animation</param>
644 /// <param name="endTime">End time of animation</param>
645 /// <param name="alphaFunction">The alpha function to apply</param>
646 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
648 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
649 if (alphaFunction == null)
651 Animate(view, path, forward, time);
655 Animate(view, path, forward, alphaFunction, time);
660 /// Creates an initialized Animation.<br>
661 /// The animation will not loop.<br>
662 /// The default end action is "Cancel".<br>
663 /// The default alpha function is linear.<br>
665 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
670 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677 /// Downcasts a handle to Animation handle.<br>
678 /// If handle points to an Animation object, the downcast produces valid handle.<br>
679 /// If not, the returned handle is left uninitialized.<br>
681 /// <param name="handle">Handle to an object</param>
682 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
683 public static Animation DownCast(BaseHandle handle)
685 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
692 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695 internal Animation Assign(Animation rhs)
697 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702 internal void SetDuration(float seconds)
704 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708 internal float GetDuration()
710 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
711 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715 internal void SetLooping(bool looping)
717 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721 internal void SetLoopCount(int count)
723 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
724 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727 internal int GetLoopCount()
729 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
734 internal int GetCurrentLoop()
736 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
737 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
741 internal bool IsLooping()
743 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
744 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
748 internal void SetEndAction(Animation.EndActions action)
750 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
754 internal Animation.EndActions GetEndAction()
756 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
757 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
761 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
763 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
764 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
767 internal Animation.EndActions GetDisconnectAction()
769 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
770 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
776 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780 internal AlphaFunction GetDefaultAlphaFunction()
782 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
783 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 internal void SetCurrentProgress(float progress)
789 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793 internal float GetCurrentProgress()
795 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800 internal void SetSpeedFactor(float factor)
802 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806 internal float GetSpeedFactor()
808 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
813 internal void SetPlayRange(Vector2 range)
815 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
816 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819 internal Vector2 GetPlayRange()
821 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 /// Plays the animation.
831 NDalicPINVOKE.Animation_Play(swigCPtr);
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 #if DISABLE_ANIMATION
834 Stop(EndActions.StopFinal);
839 /// Plays the animation from a given point.<br>
840 /// The progress must be in the 0-1 interval or in the play range interval if defined,
841 /// otherwise, it will be ignored.<br>
843 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
844 public void PlayFrom(float progress)
846 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
847 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851 /// Pauses the animation.
855 NDalicPINVOKE.Animation_Pause(swigCPtr);
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal Animation.States GetState()
861 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
862 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
867 /// Stops the animation.
871 NDalicPINVOKE.Animation_Stop(swigCPtr);
872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876 /// Clears the animation.<br>
877 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
881 NDalicPINVOKE.Animation_Clear(swigCPtr);
882 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885 internal AnimationSignal FinishedSignal()
887 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
892 internal void AnimateBy(Property target, PropertyValue relativeValue)
894 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
895 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
898 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
900 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
901 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
904 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
906 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
910 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
912 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
916 internal void AnimateTo(Property target, PropertyValue destinationValue)
918 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
919 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
922 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
924 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
925 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
930 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
931 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
934 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
936 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
937 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
940 internal void AnimateBetween(Property target, KeyFrames keyFrames)
942 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
943 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
946 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
948 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
949 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
954 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
955 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
958 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
960 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
961 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
964 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
966 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
967 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
970 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
972 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
973 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
976 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
978 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
979 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
982 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
984 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
985 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988 internal void Animate(View view, Path path, Vector3 forward)
990 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
991 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
996 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
997 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1002 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1003 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1006 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1008 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1009 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1012 internal void Show(View view, float delaySeconds)
1014 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1015 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018 internal void Hide(View view, float delaySeconds)
1020 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1021 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1025 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1027 public enum EndActions
1030 /// When the animation ends, the animated property values are saved.
1034 /// When the animation ends, the animated property values are forgotten.
1038 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1044 /// Enumeration for what interpolation method to use on key-frame animations.
1046 public enum Interpolation
1049 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1053 /// Values in between key frames are interpolated using a cubic polynomial.
1059 /// Enumeration for what state the animation is in.
1061 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1065 /// Animation has stopped
1069 /// The animation is playing
1073 /// The animation is paused