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.
63 else if(type == DisposeTypes.Implicit)
72 NUILog.Error("Now Animation is playing! Clear and Reset here!");
73 //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable");
77 //Release your own unmanaged resources here.
78 //You should not access any managed member here except static instance.
79 //because the execution order of Finalizes is non-deterministic.
81 if (swigCPtr.Handle != global::System.IntPtr.Zero)
86 NDalicPINVOKE.delete_Animation(swigCPtr);
88 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
95 /// Create an initialized Animation.<br>
96 /// The animation will not loop.<br>
97 /// The default end action is "Cancel".<br>
98 /// The default Alpha function is linear.<br>
100 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
101 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
102 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
108 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
110 private event EventHandler _animationFinishedEventHandler;
112 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
113 * Finished signal is emitted when an Animation's animations have finished.
115 public event EventHandler Finished
119 if (_animationFinishedEventHandler == null)
121 NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
122 _animationFinishedEventCallback = OnFinished;
123 FinishedSignal().Connect(_animationFinishedEventCallback);
124 NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
126 _animationFinishedEventHandler += value;
130 _animationFinishedEventHandler -= value;
132 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
134 NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
135 FinishedSignal().Disconnect(_animationFinishedEventCallback);
136 NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
140 private void OnFinished(IntPtr data)
142 if (_animationFinishedEventHandler != null)
144 //here we send all data to user event handlers
145 _animationFinishedEventHandler(this, null);
149 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
150 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
151 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
152 private event EventHandler _animationProgressReachedEventHandler;
154 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
155 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
157 public event EventHandler ProgressReached
161 if (_animationProgressReachedEventHandler == null)
163 NUILog.Debug("[add before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
164 _animationProgressReachedEventCallback = OnProgressReached;
165 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
166 NUILog.Debug("[add after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
169 _animationProgressReachedEventHandler += value;
173 _animationProgressReachedEventHandler -= value;
175 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
177 NUILog.Debug("[remove before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
178 ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
179 NUILog.Debug("[remove after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
183 private void OnProgressReached(IntPtr data)
185 if (_animationProgressReachedEventHandler != null)
187 //here we send all data to user event handlers
188 _animationProgressReachedEventHandler(this, null);
192 private float MilliSecondsToSeconds(int millisec)
194 return (float)millisec / 1000.0f;
197 private int SecondsToMilliSeconds(float sec)
199 return (int)(sec * 1000);
204 /// Gets/Sets the duration in milli seconds of the animation.
210 SetDuration(MilliSecondsToSeconds(value));
214 return SecondsToMilliSeconds(GetDuration());
219 /// Gets/Sets the default alpha function for the animation.
221 public AlphaFunction DefaultAlphaFunction
225 SetDefaultAlphaFunction(value);
229 AlphaFunction ret = GetDefaultAlphaFunction();
235 /// Queries the state of the animation.
246 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
247 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
248 /// Setting this parameter does not cause the animation to Play().<br>
249 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
250 /// The loop count is initially 1 for play once.<br>
260 int ret = GetLoopCount();
266 /// Gets/Sets the status of whether the animation will loop.<br>
267 /// This property resets the loop count and should not be used with LoopCount property.<br>
268 /// Setting this parameter does not cause the animation to Play().<br>
278 bool ret = IsLooping();
285 /// Gets/Sets the end action of the animation.<br>
286 /// This action is performed when the animation ends or if it is stopped.<br>
287 /// Default end action is Cancel.<br>
289 public EndActions EndAction
297 return GetEndAction();
303 /// Stops the animation.
305 /// <param name="action">end action can be set</param>
306 public void Stop(EndActions action = EndActions.Cancel)
308 SetEndAction(action);
309 NDalicPINVOKE.Animation_Stop(swigCPtr);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// Gets the current loop count.<br>
315 /// A value 0 indicating the current loop count when looping.<br>
317 public int CurrentLoop
321 return GetCurrentLoop();
326 /// Gets/Sets the disconnect action.<br>
327 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
328 /// Default action is to Cancel.<br>
330 public EndActions DisconnectAction
334 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 /// Gets/Sets the progress of the animation.<br>
348 /// The animation will play(or continue playing) from this point.<br>
349 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
350 /// otherwise, it will be ignored.<br>
352 public float CurrentProgress
356 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 /// Gets/Sets Specifies a speed factor for the animation.<br>
369 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
370 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
371 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
373 public float SpeedFactor
377 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
378 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 /// Gets/Sets the playing range.<br>
390 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
391 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
393 public RelativeVector2 PlayRange
397 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
402 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
411 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
412 /// One notification can be set on each animation
414 public float ProgressNotification
418 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
419 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
423 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430 /// Animates a property value by a relative amount.<br>
432 /// <param name="target">The target object to animate</param>
433 /// <param name="property">The target property to animate</param>
434 /// <param name="relativeValue">The property value will change by this amount</param>
435 /// <param name="alphaFunction">The alpha function to apply</param>
436 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
438 string _str1 = property.Substring(0, 1);
439 string _str2 = property.Substring(1);
440 string _str = _str1.ToLower() + _str2;
442 Property _prop = new Property(target, _str);
443 if (_prop.propertyIndex == Property.INVALID_INDEX)
445 throw new System.ArgumentException("second argument string property is invalid parameter!");
448 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
449 if(propertyType.Equals(PropertyType.Float))
451 System.Type type = relativeValue.GetType();
452 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
454 int num = (int)relativeValue;
455 relativeValue = (float)num;
459 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
461 if (alphaFunction != null)
463 AnimateBy(_prop, val, alphaFunction);
467 AnimateBy(_prop, val);
472 /// Animates a property value by a relative amount.<br>
474 /// <param name="target">The target object to animate</param>
475 /// <param name="property">The target property to animate</param>
476 /// <param name="relativeValue">The property value will change by this amount</param>
477 /// <param name="startTime">Start time of animation</param>
478 /// <param name="endTime">End time of animation</param>
479 /// <param name="alphaFunction">The alpha function to apply</param>
480 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
482 string _str1 = property.Substring(0, 1);
483 string _str2 = property.Substring(1);
484 string _str = _str1.ToLower() + _str2;
486 Property _prop = new Property(target, _str);
487 if (_prop.propertyIndex == Property.INVALID_INDEX)
489 throw new System.ArgumentException("second argument string property is invalid parameter!");
492 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
493 if(propertyType.Equals(PropertyType.Float))
495 System.Type type = relativeValue.GetType();
496 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
498 int num = (int)relativeValue;
499 relativeValue = (float)num;
503 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
505 if (alphaFunction != null)
507 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
508 AnimateBy(_prop, val, alphaFunction, time);
512 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
513 AnimateBy(_prop, val, time);
518 /// Animates a property to a destination value.<br>
520 /// <param name="target">The target object to animate</param>
521 /// <param name="property">The target property to animate</param>
522 /// <param name="destinationValue">The destination value</param>
523 /// <param name="alphaFunction">The alpha function to apply</param>
524 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
526 string _str1 = property.Substring(0, 1);
527 string _str2 = property.Substring(1);
528 string _str = _str1.ToLower() + _str2;
530 Property _prop = new Property(target, _str);
531 if (_prop.propertyIndex == Property.INVALID_INDEX)
533 throw new System.ArgumentException("second argument string property is invalid parameter!");
536 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
537 if(propertyType.Equals(PropertyType.Float))
539 System.Type type = destinationValue.GetType();
540 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
542 int num = (int)destinationValue;
543 destinationValue = (float)num;
547 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
549 if (alphaFunction != null)
551 AnimateTo(_prop, val, alphaFunction);
555 AnimateTo(_prop, val);
560 /// Animates a property to a destination value.<br>
562 /// <param name="target">The target object to animate</param>
563 /// <param name="property">The target property to animate</param>
564 /// <param name="destinationValue">The destination value</param>
565 /// <param name="alphaFunction">The alpha function to apply</param>
566 /// <param name="startTime">Start time of animation</param>
567 /// <param name="endTime">End time of animation</param>
568 /// <param name="alphaFunction">The alpha function to apply</param>
569 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
571 string _str1 = property.Substring(0, 1);
572 string _str2 = property.Substring(1);
573 string _str = _str1.ToLower() + _str2;
575 Property _prop = new Property(target, _str);
576 if (_prop.propertyIndex == Property.INVALID_INDEX)
578 throw new System.ArgumentException("second argument string property is invalid parameter!");
581 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
582 if(propertyType.Equals(PropertyType.Float))
584 System.Type type = destinationValue.GetType();
585 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
587 int num = (int)destinationValue;
588 destinationValue = (float)num;
592 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
594 if (alphaFunction != null)
596 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
597 AnimateTo(_prop, val, alphaFunction, time);
601 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
602 AnimateTo(_prop, val, time);
607 /// Animates a property between keyframes.
609 /// <param name="target">The target object to animate</param>
610 /// <param name="property">The target property to animate</param>
611 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
612 /// <param name="interpolation">The method used to interpolate between values</param>
613 /// <param name="alphaFunction">The alpha function to apply</param>
614 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
616 string _str1 = property.Substring(0, 1);
617 string _str2 = property.Substring(1);
618 string _str = _str1.ToLower() + _str2;
620 Property _prop = new Property(target, _str);
621 if (_prop.propertyIndex == Property.INVALID_INDEX)
623 throw new System.ArgumentException("second argument string property is invalid parameter!");
626 if (alphaFunction != null)
628 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
632 AnimateBetween(_prop, keyFrames, interpolation);
638 /// Animates a property between keyframes.
640 /// <param name="target">The target object to animate</param>
641 /// <param name="property">The target property to animate</param>
642 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
643 /// <param name="startTime">Start time of animation in milli seconds</param>
644 /// <param name="endTime">End time of animation in milli seconds</param>
645 /// <param name="interpolation">The method used to interpolate between values</param>
646 /// <param name="alphaFunction">The alpha function to apply</param>
647 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
649 string _str1 = property.Substring(0, 1);
650 string _str2 = property.Substring(1);
651 string _str = _str1.ToLower() + _str2;
653 Property _prop = new Property(target, _str);
654 if (_prop.propertyIndex == Property.INVALID_INDEX)
656 throw new System.ArgumentException("second argument string property is invalid parameter!");
659 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
660 if (alphaFunction != null)
662 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
666 AnimateBetween(_prop, keyFrames, time, interpolation);
671 /// Animates an view's position and orientation through a predefined path.<br>
672 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
673 /// If forward is the zero vector then no rotation will happen.<br>
675 /// <param name="view">The view to animate</param>
676 /// <param name="path">It defines position and orientation</param>
677 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
678 /// <param name="alphaFunction">The alpha function to apply</param>
679 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
681 if (alphaFunction == null)
683 Animate(view, path, forward);
687 Animate(view, path, forward, alphaFunction);
692 /// Animates an view's position and orientation through a predefined path.<br>
693 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
694 /// If forward is the zero vector then no rotation will happen.<br>
696 /// <param name="view">The view to animate</param>
697 /// <param name="path">It defines position and orientation</param>
698 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
699 /// <param name="startTime">Start time of animation</param>
700 /// <param name="endTime">End time of animation</param>
701 /// <param name="alphaFunction">The alpha function to apply</param>
702 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
704 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
705 if (alphaFunction == null)
707 Animate(view, path, forward, time);
711 Animate(view, path, forward, alphaFunction, time);
716 /// Creates an initialized Animation.<br>
717 /// The animation will not loop.<br>
718 /// The default end action is "Cancel".<br>
719 /// The default alpha function is linear.<br>
721 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
723 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
726 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
728 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 /// Downcasts a handle to Animation handle.<br>
734 /// If handle points to an Animation object, the downcast produces valid handle.<br>
735 /// If not, the returned handle is left uninitialized.<br>
737 /// <param name="handle">Handle to an object</param>
738 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
739 public static Animation DownCast(BaseHandle handle)
741 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
748 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
751 internal Animation Assign(Animation rhs)
753 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758 internal void SetDuration(float seconds)
760 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
761 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764 internal float GetDuration()
766 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 internal void SetLooping(bool looping)
773 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777 internal void SetLoopCount(int count)
779 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
780 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783 internal int GetLoopCount()
785 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790 internal int GetCurrentLoop()
792 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797 internal bool IsLooping()
799 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
800 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 internal void SetEndAction(Animation.EndActions action)
806 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810 internal Animation.EndActions GetEndAction()
812 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
813 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
817 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
819 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
820 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 internal Animation.EndActions GetDisconnectAction()
825 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
830 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
832 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
833 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
836 internal AlphaFunction GetDefaultAlphaFunction()
838 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
843 internal void SetCurrentProgress(float progress)
845 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
846 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
849 internal float GetCurrentProgress()
851 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
852 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
856 internal void SetSpeedFactor(float factor)
858 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
859 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
862 internal float GetSpeedFactor()
864 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
865 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
869 internal void SetPlayRange(Vector2 range)
871 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
875 internal Vector2 GetPlayRange()
877 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
878 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 /// Plays the animation.
887 NDalicPINVOKE.Animation_Play(swigCPtr);
888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
889 #if DISABLE_ANIMATION
890 Stop(EndActions.StopFinal);
895 /// Plays the animation from a given point.<br>
896 /// The progress must be in the 0-1 interval or in the play range interval if defined,
897 /// otherwise, it will be ignored.<br>
899 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
900 public void PlayFrom(float progress)
902 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
903 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 /// Play the animation after a given delay time.<br/>
908 /// The delay time is not included in the looping time.<br/>
909 /// When the delay time is negative value, it would treat as play immediately.<br/>
911 /// <param name="delayMiliSeconds">The delay time</param>
912 public void PlayAfter(int delayMiliSeconds)
914 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMiliSeconds));
915 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
919 /// Pauses the animation.
923 NDalicPINVOKE.Animation_Pause(swigCPtr);
924 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
927 internal Animation.States GetState()
929 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
930 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
935 /// Stops the animation.
939 NDalicPINVOKE.Animation_Stop(swigCPtr);
940 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 /// Clears the animation.<br>
945 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
949 NDalicPINVOKE.Animation_Clear(swigCPtr);
950 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
953 internal AnimationSignal FinishedSignal()
955 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
956 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
960 internal AnimationSignal ProgressReachedSignal()
962 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
963 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 internal void AnimateBy(Property target, PropertyValue relativeValue)
969 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
970 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
973 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
975 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
976 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
979 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
981 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
982 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
985 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
987 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
988 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
991 internal void AnimateTo(Property target, PropertyValue destinationValue)
993 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
994 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
997 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
999 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1000 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1003 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1005 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1006 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1009 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1011 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1012 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1015 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1017 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1018 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1021 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1023 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1024 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1027 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1029 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1030 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1033 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1035 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1036 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1039 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1041 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1042 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1045 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1047 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1048 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1051 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1053 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1054 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1057 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1059 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1060 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1063 internal void Animate(View view, Path path, Vector3 forward)
1065 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1066 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1069 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1071 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1075 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1077 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1078 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1081 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1083 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1084 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1087 internal void Show(View view, float delaySeconds)
1089 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1090 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1093 internal void Hide(View view, float delaySeconds)
1095 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1096 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1102 public enum EndActions
1105 /// When the animation ends, the animated property values are saved.
1109 /// When the animation ends, the animated property values are forgotten.
1113 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1119 /// Enumeration for what interpolation method to use on key-frame animations.
1121 public enum Interpolation
1124 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1128 /// Values in between key frames are interpolated using a cubic polynomial.
1134 /// Enumeration for what state the animation is in.
1136 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1140 /// Animation has stopped
1144 /// The animation is playing
1148 /// The animation is paused