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 /// <since_tizen> 3 </since_tizen>
113 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
119 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
120 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
121 private event EventHandler _animationFinishedEventHandler;
123 * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
124 * The finished signal is emitted when an animation's animations have finished.
126 public event EventHandler Finished
130 if (_animationFinishedEventHandler == null)
132 NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
133 _animationFinishedEventCallback = OnFinished;
134 FinishedSignal().Connect(_animationFinishedEventCallback);
135 NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
137 _animationFinishedEventHandler += value;
141 _animationFinishedEventHandler -= value;
143 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
145 NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
146 FinishedSignal().Disconnect(_animationFinishedEventCallback);
147 NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
151 private void OnFinished(IntPtr data)
153 if (_animationFinishedEventHandler != null)
155 //here we send all data to user event handlers
156 _animationFinishedEventHandler(this, null);
160 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
161 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
162 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
163 private event EventHandler _animationProgressReachedEventHandler;
165 * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
166 * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
168 public event EventHandler ProgressReached
172 if (_animationProgressReachedEventHandler == null)
174 NUILog.Debug("[add before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
175 _animationProgressReachedEventCallback = OnProgressReached;
176 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
177 NUILog.Debug("[add after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
180 _animationProgressReachedEventHandler += value;
184 _animationProgressReachedEventHandler -= value;
186 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
188 NUILog.Debug("[remove before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
189 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
190 NUILog.Debug("[remove after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
194 private void OnProgressReached(IntPtr data)
196 if (_animationProgressReachedEventHandler != null)
198 //here we send all data to user event handlers
199 _animationProgressReachedEventHandler(this, null);
203 private float MilliSecondsToSeconds(int millisec)
205 return (float)millisec / 1000.0f;
208 private int SecondsToMilliSeconds(float sec)
210 return (int)(sec * 1000);
215 /// Gets or sets the duration in milliseconds of the animation.
217 /// <since_tizen> 3 </since_tizen>
222 SetDuration(MilliSecondsToSeconds(value));
226 return SecondsToMilliSeconds(GetDuration());
231 /// Gets or sets the default alpha function for the animation.
233 /// <since_tizen> 3 </since_tizen>
234 public AlphaFunction DefaultAlphaFunction
238 SetDefaultAlphaFunction(value);
242 AlphaFunction ret = GetDefaultAlphaFunction();
248 /// Queries the state of the animation.
250 /// <since_tizen> 3 </since_tizen>
260 /// Set: Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e., repeat forever.<br>
261 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
262 /// Setting this parameter does not cause the animation to Play().<br>
263 /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br>
264 /// The loop count is initially 1 for play once.<br>
266 /// <since_tizen> 3 </since_tizen>
275 int ret = GetLoopCount();
281 /// Gets or sets the status of whether the animation will loop.<br>
282 /// This property resets the loop count and should not be used with the LoopCount property.<br>
283 /// Setting this parameter does not cause the animation to Play().<br>
285 /// <since_tizen> 3 </since_tizen>
294 bool ret = IsLooping();
301 /// Gets or sets the end action of the animation.<br>
302 /// This action is performed when the animation ends or if it is stopped.<br>
303 /// The default end action is cancel.<br>
305 /// <since_tizen> 3 </since_tizen>
306 public EndActions EndAction
314 return GetEndAction();
320 /// Stops the animation.
322 /// <param name="action">The end action can be set.</param>
323 /// <since_tizen> 3 </since_tizen>
324 public void Stop(EndActions action = EndActions.Cancel)
326 SetEndAction(action);
327 NDalicPINVOKE.Animation_Stop(swigCPtr);
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 /// Gets the current loop count.<br>
333 /// A value 0 indicating the current loop count when looping.<br>
335 /// <since_tizen> 3 </since_tizen>
336 public int CurrentLoop
340 return GetCurrentLoop();
345 /// Gets or sets the disconnect action.<br>
346 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
347 /// The default action is cancel.<br>
349 /// <since_tizen> 3 </since_tizen>
350 public EndActions DisconnectAction
354 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 /// Gets or sets the progress of the animation.<br>
368 /// The animation will play (or continue playing) from this point.<br>
369 /// The progress must be in the 0-1 interval or in the play range interval if defined<br>
370 /// otherwise, it will be ignored.<br>
372 /// <since_tizen> 3 </since_tizen>
373 public float CurrentProgress
377 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
378 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 /// Gets or sets specificifications of a speed factor for the animation.<br>
390 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
391 /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br>
392 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
394 /// <since_tizen> 3 </since_tizen>
395 public float SpeedFactor
399 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
400 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 /// Gets or sets the playing range.<br>
412 /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
413 /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br>
415 /// <since_tizen> 3 </since_tizen>
416 public RelativeVector2 PlayRange
420 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br>
434 /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br>
435 /// One notification can be set on each animation.
437 /// <since_tizen> 3 </since_tizen>
438 public float ProgressNotification
442 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
447 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
448 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 /// Animates a property value by a relative amount.<br>
456 /// <param name="target">The target object to animate.</param>
457 /// <param name="property">The target property to animate.</param>
458 /// <param name="relativeValue">The property value will change by this amount.</param>
459 /// <param name="alphaFunction">The alpha function to apply.</param>
460 /// <since_tizen> 3 </since_tizen>
461 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
463 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
465 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
466 if(propertyType.Equals(PropertyType.Float))
468 System.Type type = relativeValue.GetType();
469 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
471 int num = (int)relativeValue;
472 relativeValue = (float)num;
476 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
478 if (alphaFunction != null)
480 AnimateBy(_prop, val, alphaFunction);
484 AnimateBy(_prop, val);
489 /// Animates a property value by a relative amount.<br>
491 /// <param name="target">The target object to animate.</param>
492 /// <param name="property">The target property to animate.</param>
493 /// <param name="relativeValue">The property value will change by this amount.</param>
494 /// <param name="startTime">The start time of the animation.</param>
495 /// <param name="endTime">The end time of the animation.</param>
496 /// <param name="alphaFunction">The alpha function to apply.</param>
497 /// <since_tizen> 3 </since_tizen>
498 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
500 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
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 /// <since_tizen> 3 </since_tizen>
535 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
537 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
539 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
540 if(propertyType.Equals(PropertyType.Float))
542 System.Type type = destinationValue.GetType();
543 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
545 int num = (int)destinationValue;
546 destinationValue = (float)num;
550 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
552 if (alphaFunction != null)
554 AnimateTo(_prop, val, alphaFunction);
558 AnimateTo(_prop, val);
563 /// Animates a property to a destination value.<br>
565 /// <param name="target">The target object to animate.</param>
566 /// <param name="property">The target property to animate.</param>
567 /// <param name="destinationValue">The destination value.</param>
568 /// <param name="alphaFunction">The alpha function to apply.</param>
569 /// <param name="startTime">The start time of the animation.</param>
570 /// <param name="endTime">The end time of the animation.</param>
571 /// <param name="alphaFunction">The alpha function to apply.</param>
572 /// <since_tizen> 3 </since_tizen>
573 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
575 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
577 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
578 if(propertyType.Equals(PropertyType.Float))
580 System.Type type = destinationValue.GetType();
581 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
583 int num = (int)destinationValue;
584 destinationValue = (float)num;
588 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
590 if (alphaFunction != null)
592 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
593 AnimateTo(_prop, val, alphaFunction, time);
597 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
598 AnimateTo(_prop, val, time);
603 /// Animates a property between keyframes.
605 /// <param name="target">The target object to animate.</param>
606 /// <param name="property">The target property to animate.</param>
607 /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
608 /// <param name="interpolation">The method used to interpolate between values.</param>
609 /// <param name="alphaFunction">The alpha function to apply.</param>
610 /// <since_tizen> 3 </since_tizen>
611 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
613 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
615 if (_prop.propertyIndex == Property.INVALID_INDEX)
617 throw new System.ArgumentException("second argument string property is invalid parameter!");
620 if (alphaFunction != null)
622 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
626 AnimateBetween(_prop, keyFrames, interpolation);
632 /// Animates a property between keyframes.
634 /// <param name="target">The target object to animate</param>
635 /// <param name="property">The target property to animate</param>
636 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
637 /// <param name="startTime">The start time of animation in milliseconds.</param>
638 /// <param name="endTime">The end time of animation in milliseconds.</param>
639 /// <param name="interpolation">The method used to interpolate between values.</param>
640 /// <param name="alphaFunction">The alpha function to apply.</param>
641 /// <since_tizen> 3 </since_tizen>
642 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
644 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
646 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
647 if (alphaFunction != null)
649 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
653 AnimateBetween(_prop, keyFrames, time, interpolation);
658 /// Animates the view's position and orientation through a predefined path.<br>
659 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
660 /// If forward is the zero vector then no rotation will happen.<br>
662 /// <param name="view">The view to animate.</param>
663 /// <param name="path">It defines position and orientation.</param>
664 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
665 /// <param name="alphaFunction">The alpha function to apply.</param>
666 /// <since_tizen> 3 </since_tizen>
667 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
669 if (alphaFunction == null)
671 Animate(view, path, forward);
675 Animate(view, path, forward, alphaFunction);
680 /// Animates the view's position and orientation through a predefined path.<br>
681 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br>
682 /// If forward is the zero vector then no rotation will happen.<br>
684 /// <param name="view">The view to animate.</param>
685 /// <param name="path">It defines position and orientation.</param>
686 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
687 /// <param name="startTime">The start time of the animation.</param>
688 /// <param name="endTime">The end time of the animation.</param>
689 /// <param name="alphaFunction">The alpha function to apply.</param>
690 /// <since_tizen> 3 </since_tizen>
691 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
693 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
694 if (alphaFunction == null)
696 Animate(view, path, forward, time);
700 Animate(view, path, forward, alphaFunction, time);
705 /// Creates an initialized animation.<br>
706 /// The animation will not loop.<br>
707 /// The default end action is "Cancel".<br>
708 /// The default alpha function is linear.<br>
710 /// <since_tizen> 3 </since_tizen>
711 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
718 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723 /// Downcasts a handle to animation handle.<br>
724 /// If handle points to an animation object, the downcast produces a valid handle.<br>
725 /// If not, the returned handle is left uninitialized.<br>
727 /// <param name="handle">Handle to an object.</param>
728 /// <returns>Handle to an animation object or an uninitialized handle.</returns>
729 /// <since_tizen> 3 </since_tizen>
730 public static Animation DownCast(BaseHandle handle)
732 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
733 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
739 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742 internal Animation Assign(Animation rhs)
744 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
745 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749 internal void SetDuration(float seconds)
751 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
752 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 internal float GetDuration()
757 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
758 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 internal void SetLooping(bool looping)
764 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
768 internal void SetLoopCount(int count)
770 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
771 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 internal int GetLoopCount()
776 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 internal int GetCurrentLoop()
783 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
784 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
788 internal bool IsLooping()
790 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 internal void SetEndAction(Animation.EndActions action)
797 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801 internal Animation.EndActions GetEndAction()
803 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
804 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
808 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
810 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
811 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
814 internal Animation.EndActions GetDisconnectAction()
816 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
817 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
821 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
823 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
824 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
827 internal AlphaFunction GetDefaultAlphaFunction()
829 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
834 internal void SetCurrentProgress(float progress)
836 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
837 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 internal float GetCurrentProgress()
842 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847 internal void SetSpeedFactor(float factor)
849 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
850 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
853 internal float GetSpeedFactor()
855 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860 internal void SetPlayRange(Vector2 range)
862 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
863 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866 internal Vector2 GetPlayRange()
868 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
873 private static bool? disableAnimation = null;
874 private bool DisableAnimation
878 if (disableAnimation.HasValue == false)
880 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
882 disableAnimation = true;
884 disableAnimation = false;
886 return disableAnimation.Value;
891 /// Plays the animation.
893 /// <since_tizen> 3 </since_tizen>
896 NDalicPINVOKE.Animation_Play(swigCPtr);
897 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
899 if (DisableAnimation == true)
900 Stop(EndActions.StopFinal);
904 /// Plays the animation from a given point.<br>
905 /// The progress must be in the 0-1 interval or in the play range interval if defined,
906 /// otherwise, it will be ignored.<br>
908 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
909 /// <since_tizen> 3 </since_tizen>
910 public void PlayFrom(float progress)
912 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917 /// Plays the animation after a given delay time.<br/>
918 /// The delay time is not included in the looping time.<br/>
919 /// When the delay time is a negative value, it would treat as play immediately.<br/>
921 /// <param name="delayMilliseconds">The delay time.</param>
922 /// <since_tizen> 4 </since_tizen>
923 public void PlayAfter(int delayMilliseconds)
925 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
926 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
930 /// Pauses the animation.
932 /// <since_tizen> 3 </since_tizen>
935 NDalicPINVOKE.Animation_Pause(swigCPtr);
936 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
939 internal Animation.States GetState()
941 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
942 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
947 /// Stops the animation.
949 /// <since_tizen> 3 </since_tizen>
952 NDalicPINVOKE.Animation_Stop(swigCPtr);
953 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
957 /// Clears the animation.<br>
958 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
960 /// <since_tizen> 3 </since_tizen>
963 NDalicPINVOKE.Animation_Clear(swigCPtr);
964 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 internal AnimationSignal FinishedSignal()
969 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
970 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
974 internal AnimationSignal ProgressReachedSignal()
976 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
977 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981 internal void AnimateBy(Property target, PropertyValue relativeValue)
983 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
984 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
987 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
989 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
990 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
995 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
999 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1001 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1002 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005 internal void AnimateTo(Property target, PropertyValue destinationValue)
1007 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1008 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1013 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1014 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1017 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1019 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1020 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1023 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1025 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1026 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1029 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1031 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1032 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1035 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1037 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1038 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1041 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1043 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1044 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1047 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1049 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1050 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1055 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1061 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1062 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1065 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1067 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1068 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1071 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1073 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1074 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1077 internal void Animate(View view, Path path, Vector3 forward)
1079 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1080 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1083 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1085 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1086 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1089 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1091 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1092 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1095 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1097 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1098 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1101 internal void Show(View view, float delaySeconds)
1103 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1107 internal void Hide(View view, float delaySeconds)
1109 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1114 /// Enumeration for what to do when the animation ends, stopped, or destroyed.
1116 /// <since_tizen> 3 </since_tizen>
1117 public enum EndActions
1120 /// When the animation ends, the animated property values are saved.
1124 /// When the animation ends, the animated property values are forgotten.
1128 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
1134 /// Enumeration for what interpolation method to use on key-frame animations.
1136 /// <since_tizen> 3 </since_tizen>
1137 public enum Interpolation
1140 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1144 /// Values in between key frames are interpolated using a cubic polynomial.
1150 /// Enumeration for what state the animation is in.
1152 /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
1153 /// <since_tizen> 3 </since_tizen>
1157 /// The animation has stopped.
1161 /// The animation is playing.
1165 /// The animation is paused.