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)
68 if (_animationFinishedEventCallback != null)
70 FinishedSignal().Disconnect(_animationFinishedEventCallback);
73 if (_animationProgressReachedEventCallback != null)
76 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
83 NUILog.Error("Now Animation is playing! Clear and Reset here!");
84 //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable");
87 //Release your own unmanaged resources here.
88 //You should not access any managed member here except static instance.
89 //because the execution order of Finalizes is non-deterministic.
91 if (swigCPtr.Handle != global::System.IntPtr.Zero)
96 NDalicPINVOKE.delete_Animation(swigCPtr);
98 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
105 /// Create an initialized Animation.<br>
106 /// The animation will not loop.<br>
107 /// The default end action is "Cancel".<br>
108 /// The default Alpha function is linear.<br>
110 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
111 /// <param name="durationMilliSeconds">The duration in milli seconds.</param>
112 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
118 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
119 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
120 private event EventHandler _animationFinishedEventHandler;
122 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler.
123 * Finished signal is emitted when an Animation's animations have finished.
125 public event EventHandler Finished
129 if (_animationFinishedEventHandler == null)
131 NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
132 _animationFinishedEventCallback = OnFinished;
133 FinishedSignal().Connect(_animationFinishedEventCallback);
134 NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
136 _animationFinishedEventHandler += value;
140 _animationFinishedEventHandler -= value;
142 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
144 NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
145 FinishedSignal().Disconnect(_animationFinishedEventCallback);
146 NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
150 private void OnFinished(IntPtr data)
152 if (_animationFinishedEventHandler != null)
154 //here we send all data to user event handlers
155 _animationFinishedEventHandler(this, null);
159 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
160 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
161 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
162 private event EventHandler _animationProgressReachedEventHandler;
164 * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler.
165 * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification.
167 public event EventHandler ProgressReached
171 if (_animationProgressReachedEventHandler == null)
173 NUILog.Debug("[add before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
174 _animationProgressReachedEventCallback = OnProgressReached;
175 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
176 NUILog.Debug("[add after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
179 _animationProgressReachedEventHandler += value;
183 _animationProgressReachedEventHandler -= value;
185 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
187 NUILog.Debug("[remove before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
188 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
189 NUILog.Debug("[remove after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
193 private void OnProgressReached(IntPtr data)
195 if (_animationProgressReachedEventHandler != null)
197 //here we send all data to user event handlers
198 _animationProgressReachedEventHandler(this, null);
202 private float MilliSecondsToSeconds(int millisec)
204 return (float)millisec / 1000.0f;
207 private int SecondsToMilliSeconds(float sec)
209 return (int)(sec * 1000);
214 /// Gets/Sets the duration in milli seconds of the animation.
220 SetDuration(MilliSecondsToSeconds(value));
224 return SecondsToMilliSeconds(GetDuration());
229 /// Gets/Sets the default alpha function for the animation.
231 public AlphaFunction DefaultAlphaFunction
235 SetDefaultAlphaFunction(value);
239 AlphaFunction ret = GetDefaultAlphaFunction();
245 /// Queries the state of the animation.
256 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
257 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
258 /// Setting this parameter does not cause the animation to Play().<br>
259 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
260 /// The loop count is initially 1 for play once.<br>
270 int ret = GetLoopCount();
276 /// Gets/Sets the status of whether the animation will loop.<br>
277 /// This property resets the loop count and should not be used with LoopCount property.<br>
278 /// Setting this parameter does not cause the animation to Play().<br>
288 bool ret = IsLooping();
295 /// Gets/Sets the end action of the animation.<br>
296 /// This action is performed when the animation ends or if it is stopped.<br>
297 /// Default end action is Cancel.<br>
299 public EndActions EndAction
307 return GetEndAction();
313 /// Stops the animation.
315 /// <param name="action">end action can be set</param>
316 public void Stop(EndActions action = EndActions.Cancel)
318 SetEndAction(action);
319 NDalicPINVOKE.Animation_Stop(swigCPtr);
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 /// Gets the current loop count.<br>
325 /// A value 0 indicating the current loop count when looping.<br>
327 public int CurrentLoop
331 return GetCurrentLoop();
336 /// Gets/Sets the disconnect action.<br>
337 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
338 /// Default action is to Cancel.<br>
340 public EndActions DisconnectAction
344 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 /// Gets/Sets the progress of the animation.<br>
358 /// The animation will play(or continue playing) from this point.<br>
359 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
360 /// otherwise, it will be ignored.<br>
362 public float CurrentProgress
366 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 /// Gets/Sets Specifies a speed factor for the animation.<br>
379 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
380 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
381 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
383 public float SpeedFactor
387 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
393 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 /// Gets/Sets the playing range.<br>
400 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
401 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
403 public RelativeVector2 PlayRange
407 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
413 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420 /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.<br>
421 /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30% <br>
422 /// One notification can be set on each animation
424 public float ProgressNotification
428 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
429 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440 /// Animates a property value by a relative amount.<br>
442 /// <param name="target">The target object to animate</param>
443 /// <param name="property">The target property to animate</param>
444 /// <param name="relativeValue">The property value will change by this amount</param>
445 /// <param name="alphaFunction">The alpha function to apply</param>
446 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
448 string _str1 = property.Substring(0, 1);
449 string _str2 = property.Substring(1);
450 string _str = _str1.ToLower() + _str2;
452 Property _prop = new Property(target, _str);
453 if (_prop.propertyIndex == Property.INVALID_INDEX)
455 throw new System.ArgumentException("second argument string property is invalid parameter!");
458 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
459 if(propertyType.Equals(PropertyType.Float))
461 System.Type type = relativeValue.GetType();
462 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
464 int num = (int)relativeValue;
465 relativeValue = (float)num;
469 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
471 if (alphaFunction != null)
473 AnimateBy(_prop, val, alphaFunction);
477 AnimateBy(_prop, val);
482 /// Animates a property value by a relative amount.<br>
484 /// <param name="target">The target object to animate</param>
485 /// <param name="property">The target property to animate</param>
486 /// <param name="relativeValue">The property value will change by this amount</param>
487 /// <param name="startTime">Start time of animation</param>
488 /// <param name="endTime">End time of animation</param>
489 /// <param name="alphaFunction">The alpha function to apply</param>
490 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
492 string _str1 = property.Substring(0, 1);
493 string _str2 = property.Substring(1);
494 string _str = _str1.ToLower() + _str2;
496 Property _prop = new Property(target, _str);
497 if (_prop.propertyIndex == Property.INVALID_INDEX)
499 throw new System.ArgumentException("second argument string property is invalid parameter!");
502 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
503 if(propertyType.Equals(PropertyType.Float))
505 System.Type type = relativeValue.GetType();
506 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
508 int num = (int)relativeValue;
509 relativeValue = (float)num;
513 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
515 if (alphaFunction != null)
517 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
518 AnimateBy(_prop, val, alphaFunction, time);
522 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
523 AnimateBy(_prop, val, time);
528 /// Animates a property to a destination value.<br>
530 /// <param name="target">The target object to animate</param>
531 /// <param name="property">The target property to animate</param>
532 /// <param name="destinationValue">The destination value</param>
533 /// <param name="alphaFunction">The alpha function to apply</param>
534 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
536 string _str1 = property.Substring(0, 1);
537 string _str2 = property.Substring(1);
538 string _str = _str1.ToLower() + _str2;
540 Property _prop = new Property(target, _str);
541 if (_prop.propertyIndex == Property.INVALID_INDEX)
543 throw new System.ArgumentException("second argument string property is invalid parameter!");
546 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
547 if(propertyType.Equals(PropertyType.Float))
549 System.Type type = destinationValue.GetType();
550 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
552 int num = (int)destinationValue;
553 destinationValue = (float)num;
557 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
559 if (alphaFunction != null)
561 AnimateTo(_prop, val, alphaFunction);
565 AnimateTo(_prop, val);
570 /// Animates a property to a destination value.<br>
572 /// <param name="target">The target object to animate</param>
573 /// <param name="property">The target property to animate</param>
574 /// <param name="destinationValue">The destination value</param>
575 /// <param name="alphaFunction">The alpha function to apply</param>
576 /// <param name="startTime">Start time of animation</param>
577 /// <param name="endTime">End time of animation</param>
578 /// <param name="alphaFunction">The alpha function to apply</param>
579 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
581 string _str1 = property.Substring(0, 1);
582 string _str2 = property.Substring(1);
583 string _str = _str1.ToLower() + _str2;
585 Property _prop = new Property(target, _str);
586 if (_prop.propertyIndex == Property.INVALID_INDEX)
588 throw new System.ArgumentException("second argument string property is invalid parameter!");
591 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
592 if(propertyType.Equals(PropertyType.Float))
594 System.Type type = destinationValue.GetType();
595 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
597 int num = (int)destinationValue;
598 destinationValue = (float)num;
602 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
604 if (alphaFunction != null)
606 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
607 AnimateTo(_prop, val, alphaFunction, time);
611 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
612 AnimateTo(_prop, val, time);
617 /// Animates a property between keyframes.
619 /// <param name="target">The target object to animate</param>
620 /// <param name="property">The target property to animate</param>
621 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
622 /// <param name="interpolation">The method used to interpolate between values</param>
623 /// <param name="alphaFunction">The alpha function to apply</param>
624 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
626 string _str1 = property.Substring(0, 1);
627 string _str2 = property.Substring(1);
628 string _str = _str1.ToLower() + _str2;
630 Property _prop = new Property(target, _str);
631 if (_prop.propertyIndex == Property.INVALID_INDEX)
633 throw new System.ArgumentException("second argument string property is invalid parameter!");
636 if (alphaFunction != null)
638 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
642 AnimateBetween(_prop, keyFrames, interpolation);
648 /// Animates a property between keyframes.
650 /// <param name="target">The target object to animate</param>
651 /// <param name="property">The target property to animate</param>
652 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
653 /// <param name="startTime">Start time of animation in milli seconds</param>
654 /// <param name="endTime">End time of animation in milli seconds</param>
655 /// <param name="interpolation">The method used to interpolate between values</param>
656 /// <param name="alphaFunction">The alpha function to apply</param>
657 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
659 string _str1 = property.Substring(0, 1);
660 string _str2 = property.Substring(1);
661 string _str = _str1.ToLower() + _str2;
663 Property _prop = new Property(target, _str);
664 if (_prop.propertyIndex == Property.INVALID_INDEX)
666 throw new System.ArgumentException("second argument string property is invalid parameter!");
669 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
670 if (alphaFunction != null)
672 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
676 AnimateBetween(_prop, keyFrames, time, interpolation);
681 /// Animates an view's position and orientation through a predefined path.<br>
682 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
683 /// If forward is the zero vector then no rotation will happen.<br>
685 /// <param name="view">The view to animate</param>
686 /// <param name="path">It defines position and orientation</param>
687 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
688 /// <param name="alphaFunction">The alpha function to apply</param>
689 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
691 if (alphaFunction == null)
693 Animate(view, path, forward);
697 Animate(view, path, forward, alphaFunction);
702 /// Animates an view's position and orientation through a predefined path.<br>
703 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
704 /// If forward is the zero vector then no rotation will happen.<br>
706 /// <param name="view">The view to animate</param>
707 /// <param name="path">It defines position and orientation</param>
708 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
709 /// <param name="startTime">Start time of animation</param>
710 /// <param name="endTime">End time of animation</param>
711 /// <param name="alphaFunction">The alpha function to apply</param>
712 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
714 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
715 if (alphaFunction == null)
717 Animate(view, path, forward, time);
721 Animate(view, path, forward, alphaFunction, time);
726 /// Creates an initialized Animation.<br>
727 /// The animation will not loop.<br>
728 /// The default end action is "Cancel".<br>
729 /// The default alpha function is linear.<br>
731 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
733 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
736 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
738 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
743 /// Downcasts a handle to Animation handle.<br>
744 /// If handle points to an Animation object, the downcast produces valid handle.<br>
745 /// If not, the returned handle is left uninitialized.<br>
747 /// <param name="handle">Handle to an object</param>
748 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
749 public static Animation DownCast(BaseHandle handle)
751 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
752 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
758 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
761 internal Animation Assign(Animation rhs)
763 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
764 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
768 internal void SetDuration(float seconds)
770 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 internal float GetDuration()
776 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 internal void SetLooping(bool looping)
783 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 internal void SetLoopCount(int count)
789 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793 internal int GetLoopCount()
795 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
796 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
800 internal int GetCurrentLoop()
802 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
803 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
807 internal bool IsLooping()
809 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
814 internal void SetEndAction(Animation.EndActions action)
816 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
817 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
820 internal Animation.EndActions GetEndAction()
822 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
823 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
829 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 internal Animation.EndActions GetDisconnectAction()
835 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
842 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846 internal AlphaFunction GetDefaultAlphaFunction()
848 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
849 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
853 internal void SetCurrentProgress(float progress)
855 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal float GetCurrentProgress()
861 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
862 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866 internal void SetSpeedFactor(float factor)
868 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
872 internal float GetSpeedFactor()
874 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
875 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
879 internal void SetPlayRange(Vector2 range)
881 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
882 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885 internal Vector2 GetPlayRange()
887 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
888 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
892 private static bool? disableAnimation = null;
893 private bool DisableAnimation
897 if (disableAnimation.HasValue == false)
899 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
901 disableAnimation = true;
903 disableAnimation = false;
905 return disableAnimation.Value;
910 /// Plays the animation.
914 NDalicPINVOKE.Animation_Play(swigCPtr);
915 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917 if (DisableAnimation == true)
918 Stop(EndActions.StopFinal);
922 /// Plays the animation from a given point.<br>
923 /// The progress must be in the 0-1 interval or in the play range interval if defined,
924 /// otherwise, it will be ignored.<br>
926 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
927 public void PlayFrom(float progress)
929 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
930 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
934 /// Play the animation after a given delay time.<br/>
935 /// The delay time is not included in the looping time.<br/>
936 /// When the delay time is negative value, it would treat as play immediately.<br/>
938 /// <param name="delayMilliseconds">The delay time</param>
939 public void PlayAfter(int delayMilliseconds)
941 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
942 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
946 /// Pauses the animation.
950 NDalicPINVOKE.Animation_Pause(swigCPtr);
951 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
954 internal Animation.States GetState()
956 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
957 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
962 /// Stops the animation.
966 NDalicPINVOKE.Animation_Stop(swigCPtr);
967 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
971 /// Clears the animation.<br>
972 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
976 NDalicPINVOKE.Animation_Clear(swigCPtr);
977 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
980 internal AnimationSignal FinishedSignal()
982 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
983 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
987 internal AnimationSignal ProgressReachedSignal()
989 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
990 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994 internal void AnimateBy(Property target, PropertyValue relativeValue)
996 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
997 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1002 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1003 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1006 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1008 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1009 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1012 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1014 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1015 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018 internal void AnimateTo(Property target, PropertyValue destinationValue)
1020 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1021 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1024 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1026 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1027 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1030 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1032 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1033 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1036 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1038 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1039 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1042 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1044 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1045 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1048 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1050 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1051 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1054 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1056 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1057 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1060 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1062 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1063 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1066 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1068 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1074 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1075 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1080 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1081 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1084 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1086 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1087 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090 internal void Animate(View view, Path path, Vector3 forward)
1092 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1093 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1096 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1098 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1099 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1102 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1104 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1108 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1110 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114 internal void Show(View view, float delaySeconds)
1116 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1120 internal void Hide(View view, float delaySeconds)
1122 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1127 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
1129 public enum EndActions
1132 /// When the animation ends, the animated property values are saved.
1136 /// When the animation ends, the animated property values are forgotten.
1140 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
1146 /// Enumeration for what interpolation method to use on key-frame animations.
1148 public enum Interpolation
1151 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1155 /// Values in between key frames are interpolated using a cubic polynomial.
1161 /// Enumeration for what state the animation is in.
1163 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1167 /// Animation has stopped
1171 /// The animation is playing
1175 /// The animation is paused