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 /// Creates 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 milliseconds.</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 the finished signal which can be used to subscribe or unsubscribe the event handler.
123 * The 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 the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
165 * The 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 or sets the duration in milliseconds of the animation.
220 SetDuration(MilliSecondsToSeconds(value));
224 return SecondsToMilliSeconds(GetDuration());
229 /// Gets or 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; i.e., repeat forever.<br>
260 /// The loop count is initially 1 for play once.<br>
270 int ret = GetLoopCount();
276 /// Gets or sets the status of whether the animation will loop.<br>
277 /// This property resets the loop count and should not be used with the LoopCount property.<br>
278 /// Setting this parameter does not cause the animation to Play().<br>
288 bool ret = IsLooping();
295 /// Gets or sets the end action of the animation.<br>
296 /// This action is performed when the animation ends or if it is stopped.<br>
297 /// The default end action is cancel.<br>
299 public EndActions EndAction
307 return GetEndAction();
313 /// Stops the animation.
315 /// <param name="action">The 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 or 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 /// The default action is 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 or 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 or sets specificifications of 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 or 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 or sets the progress notification marker which triggers the ProgressReachedSignal.<br>
421 /// Percentage of animation progress should be greater than 0 and less than 1, for example, 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 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
450 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
451 if(propertyType.Equals(PropertyType.Float))
453 System.Type type = relativeValue.GetType();
454 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
456 int num = (int)relativeValue;
457 relativeValue = (float)num;
461 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
463 if (alphaFunction != null)
465 AnimateBy(_prop, val, alphaFunction);
469 AnimateBy(_prop, val);
474 /// Animates a property value by a relative amount.<br>
476 /// <param name="target">The target object to animate.</param>
477 /// <param name="property">The target property to animate.</param>
478 /// <param name="relativeValue">The property value will change by this amount.</param>
479 /// <param name="startTime">The start time of the animation.</param>
480 /// <param name="endTime">The end time of the animation.</param>
481 /// <param name="alphaFunction">The alpha function to apply.</param>
482 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
484 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
486 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
487 if(propertyType.Equals(PropertyType.Float))
489 System.Type type = relativeValue.GetType();
490 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
492 int num = (int)relativeValue;
493 relativeValue = (float)num;
497 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
499 if (alphaFunction != null)
501 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
502 AnimateBy(_prop, val, alphaFunction, time);
506 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
507 AnimateBy(_prop, val, time);
512 /// Animates a property to a destination value.<br>
514 /// <param name="target">The target object to animate.</param>
515 /// <param name="property">The target property to animate.</param>
516 /// <param name="destinationValue">The destination value.</param>
517 /// <param name="alphaFunction">The alpha function to apply.</param>
518 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
520 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
522 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
523 if(propertyType.Equals(PropertyType.Float))
525 System.Type type = destinationValue.GetType();
526 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
528 int num = (int)destinationValue;
529 destinationValue = (float)num;
533 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
535 if (alphaFunction != null)
537 AnimateTo(_prop, val, alphaFunction);
541 AnimateTo(_prop, val);
546 /// Animates a property to a destination value.<br>
548 /// <param name="target">The target object to animate.</param>
549 /// <param name="property">The target property to animate.</param>
550 /// <param name="destinationValue">The destination value.</param>
551 /// <param name="alphaFunction">The alpha function to apply.</param>
552 /// <param name="startTime">The start time of the animation.</param>
553 /// <param name="endTime">The end time of the animation.</param>
554 /// <param name="alphaFunction">The alpha function to apply.</param>
555 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
557 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
559 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
560 if(propertyType.Equals(PropertyType.Float))
562 System.Type type = destinationValue.GetType();
563 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
565 int num = (int)destinationValue;
566 destinationValue = (float)num;
570 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
572 if (alphaFunction != null)
574 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
575 AnimateTo(_prop, val, alphaFunction, time);
579 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
580 AnimateTo(_prop, val, time);
585 /// Animates a property between keyframes.
587 /// <param name="target">The target object to animate.</param>
588 /// <param name="property">The target property to animate.</param>
589 /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
590 /// <param name="interpolation">The method used to interpolate between values.</param>
591 /// <param name="alphaFunction">The alpha function to apply.</param>
592 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
594 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
596 if (_prop.propertyIndex == Property.INVALID_INDEX)
598 throw new System.ArgumentException("second argument string property is invalid parameter!");
601 if (alphaFunction != null)
603 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
607 AnimateBetween(_prop, keyFrames, interpolation);
613 /// Animates a property between keyframes.
615 /// <param name="target">The target object to animate</param>
616 /// <param name="property">The target property to animate</param>
617 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
618 /// <param name="startTime">The start time of animation in milliseconds.</param>
619 /// <param name="endTime">The end time of animation in milliseconds.</param>
620 /// <param name="interpolation">The method used to interpolate between values.</param>
621 /// <param name="alphaFunction">The alpha function to apply.</param>
622 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
624 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
626 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
627 if (alphaFunction != null)
629 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
633 AnimateBetween(_prop, keyFrames, time, interpolation);
638 /// Animates the view's position and orientation through a predefined path.<br>
639 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
640 /// If forward is the zero vector then no rotation will happen.<br>
642 /// <param name="view">The view to animate.</param>
643 /// <param name="path">It defines position and orientation.</param>
644 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
645 /// <param name="alphaFunction">The alpha function to apply.</param>
646 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
648 if (alphaFunction == null)
650 Animate(view, path, forward);
654 Animate(view, path, forward, alphaFunction);
659 /// Animates the view's position and orientation through a predefined path.<br>
660 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
661 /// If forward is the zero vector then no rotation will happen.<br>
663 /// <param name="view">The view to animate.</param>
664 /// <param name="path">It defines position and orientation.</param>
665 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
666 /// <param name="startTime">The start time of the animation.</param>
667 /// <param name="endTime">The end time of the animation.</param>
668 /// <param name="alphaFunction">The alpha function to apply.</param>
669 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
671 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
672 if (alphaFunction == null)
674 Animate(view, path, forward, time);
678 Animate(view, path, forward, alphaFunction, time);
683 /// Creates an initialized animation.<br>
684 /// The animation will not loop.<br>
685 /// The default end action is "Cancel".<br>
686 /// The default alpha function is linear.<br>
688 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
695 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
700 /// Downcasts a handle to animation handle.<br>
701 /// If handle points to an animation object, the downcast produces a valid handle.<br>
702 /// If not, the returned handle is left uninitialized.<br>
704 /// <param name="handle">Handle to an object.</param>
705 /// <returns>Handle to an animation object or an uninitialized handle.</returns>
706 public static Animation DownCast(BaseHandle handle)
708 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
709 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
713 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
715 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 internal Animation Assign(Animation rhs)
720 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
721 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
725 internal void SetDuration(float seconds)
727 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
728 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731 internal float GetDuration()
733 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
734 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738 internal void SetLooping(bool looping)
740 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
744 internal void SetLoopCount(int count)
746 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
747 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
750 internal int GetLoopCount()
752 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
757 internal int GetCurrentLoop()
759 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
760 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764 internal bool IsLooping()
766 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
767 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 internal void SetEndAction(Animation.EndActions action)
773 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
774 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777 internal Animation.EndActions GetEndAction()
779 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
780 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
784 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
786 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
787 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790 internal Animation.EndActions GetDisconnectAction()
792 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
793 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
797 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
799 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
800 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
803 internal AlphaFunction GetDefaultAlphaFunction()
805 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810 internal void SetCurrentProgress(float progress)
812 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
813 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
816 internal float GetCurrentProgress()
818 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 internal void SetSpeedFactor(float factor)
825 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829 internal float GetSpeedFactor()
831 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
836 internal void SetPlayRange(Vector2 range)
838 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
842 internal Vector2 GetPlayRange()
844 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
849 private static bool? disableAnimation = null;
850 private bool DisableAnimation
854 if (disableAnimation.HasValue == false)
856 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
858 disableAnimation = true;
860 disableAnimation = false;
862 return disableAnimation.Value;
867 /// Plays the animation.
871 NDalicPINVOKE.Animation_Play(swigCPtr);
872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
874 if (DisableAnimation == true)
875 Stop(EndActions.StopFinal);
879 /// Plays the animation from a given point.<br>
880 /// The progress must be in the 0-1 interval or in the play range interval if defined,
881 /// otherwise, it will be ignored.<br>
883 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
884 public void PlayFrom(float progress)
886 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
887 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891 /// Plays the animation after a given delay time.<br/>
892 /// The delay time is not included in the looping time.<br/>
893 /// When the delay time is a negative value, it would treat as play immediately.<br/>
895 /// <param name="delayMilliseconds">The delay time.</param>
896 public void PlayAfter(int delayMilliseconds)
898 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
903 /// Pauses the animation.
907 NDalicPINVOKE.Animation_Pause(swigCPtr);
908 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911 internal Animation.States GetState()
913 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
914 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
919 /// Stops the animation.
923 NDalicPINVOKE.Animation_Stop(swigCPtr);
924 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
928 /// Clears the animation.<br>
929 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
933 NDalicPINVOKE.Animation_Clear(swigCPtr);
934 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
937 internal AnimationSignal FinishedSignal()
939 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
940 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 internal AnimationSignal ProgressReachedSignal()
946 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
951 internal void AnimateBy(Property target, PropertyValue relativeValue)
953 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
954 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
957 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
959 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
960 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
963 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
965 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
966 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
969 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
971 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
972 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
975 internal void AnimateTo(Property target, PropertyValue destinationValue)
977 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
978 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
983 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
984 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
987 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
989 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
990 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
995 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
999 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1001 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1002 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1007 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1008 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1013 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1014 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1017 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1019 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1020 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1023 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1025 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1026 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1029 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1031 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1032 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1035 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1037 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1038 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1041 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1043 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1044 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1047 internal void Animate(View view, Path path, Vector3 forward)
1049 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1050 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1055 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1061 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1062 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1065 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1067 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1068 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1071 internal void Show(View view, float delaySeconds)
1073 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1074 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1077 internal void Hide(View view, float delaySeconds)
1079 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1080 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1084 /// Enumeration for what to do when the animation ends, stopped, or destroyed.
1086 public enum EndActions
1089 /// When the animation ends, the animated property values are saved.
1093 /// When the animation ends, the animated property values are forgotten.
1097 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
1103 /// Enumeration for what interpolation method to use on key-frame animations.
1105 public enum Interpolation
1108 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1112 /// Values in between key frames are interpolated using a cubic polynomial.
1118 /// Enumeration for what state the animation is in.
1120 /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
1124 /// The animation has stopped.
1128 /// The animation is playing.
1132 /// The animation is paused.