1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
23 using System.Runtime.InteropServices;
24 using Tizen.NUI.BaseComponents;
27 /// Animation can be used to animate the properties of any number of objects, typically View.<br>
28 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br>
29 /// This is typically done in the object destructor, and requires either the Animation handle to be stored.<br>
30 /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br>
31 /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.<br>
33 public class Animation : BaseHandle
35 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 /// To make Animation instance be disposed.
50 protected override void Dispose(DisposeTypes type)
56 if(type == DisposeTypes.Explicit)
59 //Release your own managed resources here.
60 //You should release all of your own disposable objects here.
61 NUILog.Debug("Animation.Dispose(Explicit)! GetState=" + this.GetState());
62 if(this.GetState() != States.Stopped)
66 NUILog.Error("Now Animation is playing! Clear and Reset here!");
69 else if(type == DisposeTypes.Implicit)
71 NUILog.Debug("Animation.Dispose(Implicit)! GetState=" + this.GetState());
72 if(this.GetState() != States.Stopped)
76 NUILog.Error("Now Animation is playing! Clear and Reset here!");
77 //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable");
81 if (_animationFinishedEventCallback != null)
83 FinishedSignal().Disconnect(_animationFinishedEventCallback);
86 if (_animationProgressReachedEventCallback != null)
89 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
92 //Release your own unmanaged resources here.
93 //You should not access any managed member here except static instance.
94 //because the execution order of Finalizes is non-deterministic.
96 if (swigCPtr.Handle != global::System.IntPtr.Zero)
101 NDalicPINVOKE.delete_Animation(swigCPtr);
103 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
110 /// Create an initialized Animation.<br>
111 /// The animation will not loop.<br>
112 /// The default end action is "Cancel".<br>
113 /// The default Alpha function is linear.<br>
115 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
116 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
117 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
123 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
125 private event EventHandler _animationFinishedEventHandler;
127 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
128 * Finished signal is emitted when an Animation's animations have finished.
130 public event EventHandler Finished
134 if (_animationFinishedEventHandler == null)
137 Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
138 Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
140 _animationFinishedEventCallback = OnFinished;
141 FinishedSignal().Connect(_animationFinishedEventCallback);
143 Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
144 Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
148 _animationFinishedEventHandler += value;
152 _animationFinishedEventHandler -= value;
154 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
157 Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
158 Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
160 FinishedSignal().Disconnect(_animationFinishedEventCallback);
162 Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
163 Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
168 private void OnFinished(IntPtr data)
170 if (_animationFinishedEventHandler != null)
172 //here we send all data to user event handlers
173 _animationFinishedEventHandler(this, null);
177 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
178 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
179 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
180 private event EventHandler _animationProgressReachedEventHandler;
182 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
183 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
185 public event EventHandler ProgressReached
189 if (_animationProgressReachedEventHandler == null)
192 Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
193 Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
195 _animationProgressReachedEventCallback = OnProgressReached;
196 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
198 Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
199 Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
203 _animationProgressReachedEventHandler += value;
207 _animationProgressReachedEventHandler -= value;
209 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
212 Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
213 Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
215 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
217 Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
218 Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
223 private void OnProgressReached(IntPtr data)
225 if (_animationProgressReachedEventHandler != null)
227 //here we send all data to user event handlers
228 _animationProgressReachedEventHandler(this, null);
232 private float MilliSecondsToSeconds(int millisec)
234 return (float)millisec / 1000.0f;
237 private int SecondsToMilliSeconds(float sec)
239 return (int)(sec * 1000);
244 /// Gets/Sets the duration in milli seconds of the animation.
250 SetDuration(MilliSecondsToSeconds(value));
254 return SecondsToMilliSeconds(GetDuration());
259 /// Gets/Sets the default alpha function for the animation.
261 public AlphaFunction DefaultAlphaFunction
265 SetDefaultAlphaFunction(value);
269 AlphaFunction ret = GetDefaultAlphaFunction();
275 /// Queries the state of the animation.
286 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
287 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
288 /// Setting this parameter does not cause the animation to Play().<br>
289 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
290 /// The loop count is initially 1 for play once.<br>
300 int ret = GetLoopCount();
306 /// Gets/Sets the status of whether the animation will loop.<br>
307 /// This property resets the loop count and should not be used with LoopCount property.<br>
308 /// Setting this parameter does not cause the animation to Play().<br>
318 bool ret = IsLooping();
325 /// Gets/Sets the end action of the animation.<br>
326 /// This action is performed when the animation ends or if it is stopped.<br>
327 /// Default end action is Cancel.<br>
329 public EndActions EndAction
337 return GetEndAction();
343 /// Stops the animation.
345 /// <param name="action">end action can be set</param>
346 public void Stop(EndActions action = EndActions.Cancel)
348 SetEndAction(action);
349 NDalicPINVOKE.Animation_Stop(swigCPtr);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 /// Gets the current loop count.<br>
355 /// A value 0 indicating the current loop count when looping.<br>
357 public int CurrentLoop
361 return GetCurrentLoop();
366 /// Gets/Sets the disconnect action.<br>
367 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
368 /// Default action is to Cancel.<br>
370 public EndActions DisconnectAction
374 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387 /// Gets/Sets the progress of the animation.<br>
388 /// The animation will play(or continue playing) from this point.<br>
389 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
390 /// otherwise, it will be ignored.<br>
392 public float CurrentProgress
396 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
397 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 /// Gets/Sets Specifies a speed factor for the animation.<br>
409 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
410 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
411 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
413 public float SpeedFactor
417 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
418 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// Gets/Sets the playing range.<br>
430 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
431 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
433 public RelativeVector2 PlayRange
437 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
438 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
451 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
452 /// One notification can be set on each animation
454 public float ProgressNotification
458 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 /// Animates a property value by a relative amount.<br>
472 /// <param name="target">The target object to animate</param>
473 /// <param name="property">The target property to animate</param>
474 /// <param name="relativeValue">The property value will change by this amount</param>
475 /// <param name="alphaFunction">The alpha function to apply</param>
476 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
478 string _str1 = property.Substring(0, 1);
479 string _str2 = property.Substring(1);
480 string _str = _str1.ToLower() + _str2;
482 Property _prop = new Property(target, _str);
483 if (_prop.propertyIndex == Property.INVALID_INDEX)
485 throw new System.ArgumentException("second argument string property is invalid parameter!");
488 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
489 if(propertyType.Equals(PropertyType.Float))
491 System.Type type = relativeValue.GetType();
492 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
494 int num = (int)relativeValue;
495 relativeValue = (float)num;
499 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
501 if (alphaFunction != null)
503 AnimateBy(_prop, val, alphaFunction);
507 AnimateBy(_prop, val);
512 /// Animates a property value by a relative amount.<br>
514 /// <param name="target">The target object to animate</param>
515 /// <param name="property">The target property to animate</param>
516 /// <param name="relativeValue">The property value will change by this amount</param>
517 /// <param name="startTime">Start time of animation</param>
518 /// <param name="endTime">End time of animation</param>
519 /// <param name="alphaFunction">The alpha function to apply</param>
520 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
522 string _str1 = property.Substring(0, 1);
523 string _str2 = property.Substring(1);
524 string _str = _str1.ToLower() + _str2;
526 Property _prop = new Property(target, _str);
527 if (_prop.propertyIndex == Property.INVALID_INDEX)
529 throw new System.ArgumentException("second argument string property is invalid parameter!");
532 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
533 if(propertyType.Equals(PropertyType.Float))
535 System.Type type = relativeValue.GetType();
536 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
538 int num = (int)relativeValue;
539 relativeValue = (float)num;
543 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
545 if (alphaFunction != null)
547 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
548 AnimateBy(_prop, val, alphaFunction, time);
552 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
553 AnimateBy(_prop, val, time);
558 /// Animates a property to a destination value.<br>
560 /// <param name="target">The target object to animate</param>
561 /// <param name="property">The target property to animate</param>
562 /// <param name="destinationValue">The destination value</param>
563 /// <param name="alphaFunction">The alpha function to apply</param>
564 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
566 string _str1 = property.Substring(0, 1);
567 string _str2 = property.Substring(1);
568 string _str = _str1.ToLower() + _str2;
570 Property _prop = new Property(target, _str);
571 if (_prop.propertyIndex == Property.INVALID_INDEX)
573 throw new System.ArgumentException("second argument string property is invalid parameter!");
576 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
577 if(propertyType.Equals(PropertyType.Float))
579 System.Type type = destinationValue.GetType();
580 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
582 int num = (int)destinationValue;
583 destinationValue = (float)num;
587 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
589 if (alphaFunction != null)
591 AnimateTo(_prop, val, alphaFunction);
595 AnimateTo(_prop, val);
600 /// Animates a property to a destination value.<br>
602 /// <param name="target">The target object to animate</param>
603 /// <param name="property">The target property to animate</param>
604 /// <param name="destinationValue">The destination value</param>
605 /// <param name="alphaFunction">The alpha function to apply</param>
606 /// <param name="startTime">Start time of animation</param>
607 /// <param name="endTime">End time of animation</param>
608 /// <param name="alphaFunction">The alpha function to apply</param>
609 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
611 string _str1 = property.Substring(0, 1);
612 string _str2 = property.Substring(1);
613 string _str = _str1.ToLower() + _str2;
615 Property _prop = new Property(target, _str);
616 if (_prop.propertyIndex == Property.INVALID_INDEX)
618 throw new System.ArgumentException("second argument string property is invalid parameter!");
621 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
622 if(propertyType.Equals(PropertyType.Float))
624 System.Type type = destinationValue.GetType();
625 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
627 int num = (int)destinationValue;
628 destinationValue = (float)num;
632 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
634 if (alphaFunction != null)
636 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
637 AnimateTo(_prop, val, alphaFunction, time);
641 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
642 AnimateTo(_prop, val, time);
647 /// Animates a property between keyframes.
649 /// <param name="target">The target object to animate</param>
650 /// <param name="property">The target property to animate</param>
651 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
652 /// <param name="interpolation">The method used to interpolate between values</param>
653 /// <param name="alphaFunction">The alpha function to apply</param>
654 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
656 string _str1 = property.Substring(0, 1);
657 string _str2 = property.Substring(1);
658 string _str = _str1.ToLower() + _str2;
660 Property _prop = new Property(target, _str);
661 if (_prop.propertyIndex == Property.INVALID_INDEX)
663 throw new System.ArgumentException("second argument string property is invalid parameter!");
666 if (alphaFunction != null)
668 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
672 AnimateBetween(_prop, keyFrames, interpolation);
678 /// Animates a property between keyframes.
680 /// <param name="target">The target object to animate</param>
681 /// <param name="property">The target property to animate</param>
682 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
683 /// <param name="startTime">Start time of animation in milli seconds</param>
684 /// <param name="endTime">End time of animation in milli seconds</param>
685 /// <param name="interpolation">The method used to interpolate between values</param>
686 /// <param name="alphaFunction">The alpha function to apply</param>
687 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
689 string _str1 = property.Substring(0, 1);
690 string _str2 = property.Substring(1);
691 string _str = _str1.ToLower() + _str2;
693 Property _prop = new Property(target, _str);
694 if (_prop.propertyIndex == Property.INVALID_INDEX)
696 throw new System.ArgumentException("second argument string property is invalid parameter!");
699 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
700 if (alphaFunction != null)
702 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
706 AnimateBetween(_prop, keyFrames, time, interpolation);
711 /// Animates an view's position and orientation through a predefined path.<br>
712 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
713 /// If forward is the zero vector then no rotation will happen.<br>
715 /// <param name="view">The view to animate</param>
716 /// <param name="path">It defines position and orientation</param>
717 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
718 /// <param name="alphaFunction">The alpha function to apply</param>
719 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
721 if (alphaFunction == null)
723 Animate(view, path, forward);
727 Animate(view, path, forward, alphaFunction);
732 /// Animates an view's position and orientation through a predefined path.<br>
733 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
734 /// If forward is the zero vector then no rotation will happen.<br>
736 /// <param name="view">The view to animate</param>
737 /// <param name="path">It defines position and orientation</param>
738 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
739 /// <param name="startTime">Start time of animation</param>
740 /// <param name="endTime">End time of animation</param>
741 /// <param name="alphaFunction">The alpha function to apply</param>
742 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
744 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
745 if (alphaFunction == null)
747 Animate(view, path, forward, time);
751 Animate(view, path, forward, alphaFunction, time);
756 /// Creates an initialized Animation.<br>
757 /// The animation will not loop.<br>
758 /// The default end action is "Cancel".<br>
759 /// The default alpha function is linear.<br>
761 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
763 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
773 /// Downcasts a handle to Animation handle.<br>
774 /// If handle points to an Animation object, the downcast produces valid handle.<br>
775 /// If not, the returned handle is left uninitialized.<br>
777 /// <param name="handle">Handle to an object</param>
778 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
779 public static Animation DownCast(BaseHandle handle)
781 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
782 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
786 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791 internal Animation Assign(Animation rhs)
793 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
794 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
798 internal void SetDuration(float seconds)
800 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
801 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 internal float GetDuration()
806 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811 internal void SetLooping(bool looping)
813 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
814 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
817 internal void SetLoopCount(int count)
819 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
820 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 internal int GetLoopCount()
825 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
830 internal int GetCurrentLoop()
832 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
833 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
837 internal bool IsLooping()
839 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
840 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
844 internal void SetEndAction(Animation.EndActions action)
846 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
847 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
850 internal Animation.EndActions GetEndAction()
852 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
853 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
857 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
859 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863 internal Animation.EndActions GetDisconnectAction()
865 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
870 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
872 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
873 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876 internal AlphaFunction GetDefaultAlphaFunction()
878 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 internal void SetCurrentProgress(float progress)
885 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
886 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
889 internal float GetCurrentProgress()
891 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
892 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
896 internal void SetSpeedFactor(float factor)
898 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
902 internal float GetSpeedFactor()
904 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
905 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
909 internal void SetPlayRange(Vector2 range)
911 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
912 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915 internal Vector2 GetPlayRange()
917 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
918 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
923 /// Plays the animation.
927 NDalicPINVOKE.Animation_Play(swigCPtr);
928 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
929 #if DISABLE_ANIMATION
930 Stop(EndActions.StopFinal);
935 /// Plays the animation from a given point.<br>
936 /// The progress must be in the 0-1 interval or in the play range interval if defined,
937 /// otherwise, it will be ignored.<br>
939 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
940 public void PlayFrom(float progress)
942 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
943 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
947 /// Play the animation after a given delay time.<br/>
948 /// The delay time is not included in the looping time.<br/>
949 /// When the delay time is negative value, it would treat as play immediately.<br/>
951 /// <param name="delayMilliseconds">The delay time</param>
952 public void PlayAfter(int delayMilliseconds)
954 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
955 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
959 /// Pauses the animation.
963 NDalicPINVOKE.Animation_Pause(swigCPtr);
964 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 internal Animation.States GetState()
969 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
970 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
975 /// Stops the animation.
979 NDalicPINVOKE.Animation_Stop(swigCPtr);
980 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
984 /// Clears the animation.<br>
985 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
989 NDalicPINVOKE.Animation_Clear(swigCPtr);
990 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993 internal AnimationSignal FinishedSignal()
995 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000 internal AnimationSignal ProgressReachedSignal()
1002 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
1003 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1007 internal void AnimateBy(Property target, PropertyValue relativeValue)
1009 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1010 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1013 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1015 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1016 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1021 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1022 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1025 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1027 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1028 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1031 internal void AnimateTo(Property target, PropertyValue destinationValue)
1033 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1034 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1037 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1039 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1040 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1043 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1045 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1046 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1049 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1051 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1052 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1055 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1057 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1058 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1061 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1063 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1064 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1069 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1070 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1073 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1075 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1076 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1081 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1082 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1085 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1087 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1088 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1091 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1093 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1094 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1097 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1099 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1103 internal void Animate(View view, Path path, Vector3 forward)
1105 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1111 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1115 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1117 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1121 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1123 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1127 internal void Show(View view, float delaySeconds)
1129 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1133 internal void Hide(View view, float delaySeconds)
1135 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1142 public enum EndActions
1145 /// When the animation ends, the animated property values are saved.
1149 /// When the animation ends, the animated property values are forgotten.
1153 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1159 /// Enumeration for what interpolation method to use on key-frame animations.
1161 public enum Interpolation
1164 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1168 /// Values in between key frames are interpolated using a cubic polynomial.
1174 /// Enumeration for what state the animation is in.
1176 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1180 /// Animation has stopped
1184 /// The animation is playing
1188 /// The animation is paused