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);
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)
164 Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
165 Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
167 _animationProgressReachedEventCallback = OnProgressReached;
168 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
170 Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
171 Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
175 _animationProgressReachedEventHandler += value;
179 _animationProgressReachedEventHandler -= value;
181 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
184 Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
185 Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
187 ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
189 Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty());
190 Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount());
195 private void OnProgressReached(IntPtr data)
197 if (_animationProgressReachedEventHandler != null)
199 //here we send all data to user event handlers
200 _animationProgressReachedEventHandler(this, null);
204 private float MilliSecondsToSeconds(int millisec)
206 return (float)millisec / 1000.0f;
209 private int SecondsToMilliSeconds(float sec)
211 return (int)(sec * 1000);
216 /// Gets/Sets the duration in milli seconds of the animation.
222 SetDuration(MilliSecondsToSeconds(value));
226 return SecondsToMilliSeconds(GetDuration());
231 /// Gets/Sets the default alpha function for the animation.
233 public AlphaFunction DefaultAlphaFunction
237 SetDefaultAlphaFunction(value);
241 AlphaFunction ret = GetDefaultAlphaFunction();
247 /// Queries the state of the animation.
258 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
259 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
260 /// Setting this parameter does not cause the animation to Play().<br>
261 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
262 /// The loop count is initially 1 for play once.<br>
272 int ret = GetLoopCount();
278 /// Gets/Sets the status of whether the animation will loop.<br>
279 /// This property resets the loop count and should not be used with LoopCount property.<br>
280 /// Setting this parameter does not cause the animation to Play().<br>
290 bool ret = IsLooping();
297 /// Gets/Sets the end action of the animation.<br>
298 /// This action is performed when the animation ends or if it is stopped.<br>
299 /// Default end action is Cancel.<br>
301 public EndActions EndAction
309 return GetEndAction();
315 /// Stops the animation.
317 /// <param name="action">end action can be set</param>
318 public void Stop(EndActions action = EndActions.Cancel)
320 SetEndAction(action);
321 NDalicPINVOKE.Animation_Stop(swigCPtr);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 /// Gets the current loop count.<br>
327 /// A value 0 indicating the current loop count when looping.<br>
329 public int CurrentLoop
333 return GetCurrentLoop();
338 /// Gets/Sets the disconnect action.<br>
339 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
340 /// Default action is to Cancel.<br>
342 public EndActions DisconnectAction
346 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
352 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 /// Gets/Sets the progress of the animation.<br>
360 /// The animation will play(or continue playing) from this point.<br>
361 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
362 /// otherwise, it will be ignored.<br>
364 public float CurrentProgress
368 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
374 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 /// Gets/Sets Specifies a speed factor for the animation.<br>
381 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
382 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
383 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
385 public float SpeedFactor
389 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
390 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 /// Gets/Sets the playing range.<br>
402 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
403 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
405 public RelativeVector2 PlayRange
409 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
423 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
424 /// One notification can be set on each animation
426 public float ProgressNotification
430 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
435 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442 /// Animates a property value by a relative amount.<br>
444 /// <param name="target">The target object to animate</param>
445 /// <param name="property">The target property to animate</param>
446 /// <param name="relativeValue">The property value will change by this amount</param>
447 /// <param name="alphaFunction">The alpha function to apply</param>
448 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
450 string _str1 = property.Substring(0, 1);
451 string _str2 = property.Substring(1);
452 string _str = _str1.ToLower() + _str2;
454 Property _prop = new Property(target, _str);
455 if (_prop.propertyIndex == Property.INVALID_INDEX)
457 throw new System.ArgumentException("second argument string property is invalid parameter!");
460 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
461 if(propertyType.Equals(PropertyType.Float))
463 System.Type type = relativeValue.GetType();
464 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
466 int num = (int)relativeValue;
467 relativeValue = (float)num;
471 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
473 if (alphaFunction != null)
475 AnimateBy(_prop, val, alphaFunction);
479 AnimateBy(_prop, val);
484 /// Animates a property value by a relative amount.<br>
486 /// <param name="target">The target object to animate</param>
487 /// <param name="property">The target property to animate</param>
488 /// <param name="relativeValue">The property value will change by this amount</param>
489 /// <param name="startTime">Start time of animation</param>
490 /// <param name="endTime">End time of animation</param>
491 /// <param name="alphaFunction">The alpha function to apply</param>
492 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
494 string _str1 = property.Substring(0, 1);
495 string _str2 = property.Substring(1);
496 string _str = _str1.ToLower() + _str2;
498 Property _prop = new Property(target, _str);
499 if (_prop.propertyIndex == Property.INVALID_INDEX)
501 throw new System.ArgumentException("second argument string property is invalid parameter!");
504 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
505 if(propertyType.Equals(PropertyType.Float))
507 System.Type type = relativeValue.GetType();
508 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
510 int num = (int)relativeValue;
511 relativeValue = (float)num;
515 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
517 if (alphaFunction != null)
519 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
520 AnimateBy(_prop, val, alphaFunction, time);
524 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
525 AnimateBy(_prop, val, time);
530 /// Animates a property to a destination value.<br>
532 /// <param name="target">The target object to animate</param>
533 /// <param name="property">The target property to animate</param>
534 /// <param name="destinationValue">The destination value</param>
535 /// <param name="alphaFunction">The alpha function to apply</param>
536 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
538 string _str1 = property.Substring(0, 1);
539 string _str2 = property.Substring(1);
540 string _str = _str1.ToLower() + _str2;
542 Property _prop = new Property(target, _str);
543 if (_prop.propertyIndex == Property.INVALID_INDEX)
545 throw new System.ArgumentException("second argument string property is invalid parameter!");
548 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
549 if(propertyType.Equals(PropertyType.Float))
551 System.Type type = destinationValue.GetType();
552 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
554 int num = (int)destinationValue;
555 destinationValue = (float)num;
559 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
561 if (alphaFunction != null)
563 AnimateTo(_prop, val, alphaFunction);
567 AnimateTo(_prop, val);
572 /// Animates a property to a destination value.<br>
574 /// <param name="target">The target object to animate</param>
575 /// <param name="property">The target property to animate</param>
576 /// <param name="destinationValue">The destination value</param>
577 /// <param name="alphaFunction">The alpha function to apply</param>
578 /// <param name="startTime">Start time of animation</param>
579 /// <param name="endTime">End time of animation</param>
580 /// <param name="alphaFunction">The alpha function to apply</param>
581 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
583 string _str1 = property.Substring(0, 1);
584 string _str2 = property.Substring(1);
585 string _str = _str1.ToLower() + _str2;
587 Property _prop = new Property(target, _str);
588 if (_prop.propertyIndex == Property.INVALID_INDEX)
590 throw new System.ArgumentException("second argument string property is invalid parameter!");
593 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
594 if(propertyType.Equals(PropertyType.Float))
596 System.Type type = destinationValue.GetType();
597 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
599 int num = (int)destinationValue;
600 destinationValue = (float)num;
604 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
606 if (alphaFunction != null)
608 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
609 AnimateTo(_prop, val, alphaFunction, time);
613 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
614 AnimateTo(_prop, val, time);
619 /// Animates a property between keyframes.
621 /// <param name="target">The target object to animate</param>
622 /// <param name="property">The target property to animate</param>
623 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
624 /// <param name="interpolation">The method used to interpolate between values</param>
625 /// <param name="alphaFunction">The alpha function to apply</param>
626 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
628 string _str1 = property.Substring(0, 1);
629 string _str2 = property.Substring(1);
630 string _str = _str1.ToLower() + _str2;
632 Property _prop = new Property(target, _str);
633 if (_prop.propertyIndex == Property.INVALID_INDEX)
635 throw new System.ArgumentException("second argument string property is invalid parameter!");
638 if (alphaFunction != null)
640 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
644 AnimateBetween(_prop, keyFrames, interpolation);
650 /// Animates a property between keyframes.
652 /// <param name="target">The target object to animate</param>
653 /// <param name="property">The target property to animate</param>
654 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
655 /// <param name="startTime">Start time of animation in milli seconds</param>
656 /// <param name="endTime">End time of animation in milli seconds</param>
657 /// <param name="interpolation">The method used to interpolate between values</param>
658 /// <param name="alphaFunction">The alpha function to apply</param>
659 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
661 string _str1 = property.Substring(0, 1);
662 string _str2 = property.Substring(1);
663 string _str = _str1.ToLower() + _str2;
665 Property _prop = new Property(target, _str);
666 if (_prop.propertyIndex == Property.INVALID_INDEX)
668 throw new System.ArgumentException("second argument string property is invalid parameter!");
671 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
672 if (alphaFunction != null)
674 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
678 AnimateBetween(_prop, keyFrames, time, interpolation);
683 /// Animates an view's position and orientation through a predefined path.<br>
684 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
685 /// If forward is the zero vector then no rotation will happen.<br>
687 /// <param name="view">The view to animate</param>
688 /// <param name="path">It defines position and orientation</param>
689 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
690 /// <param name="alphaFunction">The alpha function to apply</param>
691 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
693 if (alphaFunction == null)
695 Animate(view, path, forward);
699 Animate(view, path, forward, alphaFunction);
704 /// Animates an view's position and orientation through a predefined path.<br>
705 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
706 /// If forward is the zero vector then no rotation will happen.<br>
708 /// <param name="view">The view to animate</param>
709 /// <param name="path">It defines position and orientation</param>
710 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
711 /// <param name="startTime">Start time of animation</param>
712 /// <param name="endTime">End time of animation</param>
713 /// <param name="alphaFunction">The alpha function to apply</param>
714 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
716 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
717 if (alphaFunction == null)
719 Animate(view, path, forward, time);
723 Animate(view, path, forward, alphaFunction, time);
728 /// Creates an initialized Animation.<br>
729 /// The animation will not loop.<br>
730 /// The default end action is "Cancel".<br>
731 /// The default alpha function is linear.<br>
733 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
735 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
740 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745 /// Downcasts a handle to Animation handle.<br>
746 /// If handle points to an Animation object, the downcast produces valid handle.<br>
747 /// If not, the returned handle is left uninitialized.<br>
749 /// <param name="handle">Handle to an object</param>
750 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
751 public static Animation DownCast(BaseHandle handle)
753 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
754 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
760 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
763 internal Animation Assign(Animation rhs)
765 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770 internal void SetDuration(float seconds)
772 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
773 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
776 internal float GetDuration()
778 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
779 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783 internal void SetLooping(bool looping)
785 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
789 internal void SetLoopCount(int count)
791 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
792 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 internal int GetLoopCount()
797 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 internal int GetCurrentLoop()
804 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal bool IsLooping()
811 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816 internal void SetEndAction(Animation.EndActions action)
818 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
822 internal Animation.EndActions GetEndAction()
824 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
825 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
831 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835 internal Animation.EndActions GetDisconnectAction()
837 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
838 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
842 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
844 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
848 internal AlphaFunction GetDefaultAlphaFunction()
850 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
851 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
855 internal void SetCurrentProgress(float progress)
857 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
858 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
861 internal float GetCurrentProgress()
863 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
864 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
868 internal void SetSpeedFactor(float factor)
870 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
871 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
874 internal float GetSpeedFactor()
876 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
877 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
881 internal void SetPlayRange(Vector2 range)
883 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
884 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
887 internal Vector2 GetPlayRange()
889 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
890 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
895 /// Plays the animation.
899 NDalicPINVOKE.Animation_Play(swigCPtr);
900 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
901 #if DISABLE_ANIMATION
902 Stop(EndActions.StopFinal);
907 /// Plays the animation from a given point.<br>
908 /// The progress must be in the 0-1 interval or in the play range interval if defined,
909 /// otherwise, it will be ignored.<br>
911 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
912 public void PlayFrom(float progress)
914 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
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