/** Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts //------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.9 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace Dali { using System; using System.Runtime.InteropServices; public class Animation : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Animation() { Dispose(); } public override void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Animation(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); base.Dispose(); } } /** * @brief Event arguments that passed via Finished signal * */ public class FinishedEventArgs : EventArgs { private Animation _animation; /** * @brief Animation - is the Animation which has finished with the animation. * */ public Animation Animation { get { return _animation; } set { _animation = value; } } } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void FinishedEventCallbackDelegate(IntPtr Animation); private DaliEventHandler _animationFinishedEventHandler; private FinishedEventCallbackDelegate _animationFinishedEventCallbackDelegate; /** * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler * (in the type of FinishedEventHandler - DaliEventHandler) provided by the user. * Finished signal is emitted when an Animation's animations have finished. */ public event DaliEventHandler Finished { add { lock(this) { // Restricted to only one listener if (_animationFinishedEventHandler == null) { _animationFinishedEventHandler += value; _animationFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished); this.FinishedSignal().Connect(_animationFinishedEventCallbackDelegate); } } } remove { lock(this) { if (_animationFinishedEventHandler != null) { this.FinishedSignal().Disconnect(_animationFinishedEventCallbackDelegate); } _animationFinishedEventHandler -= value; } } } // Callback for Animation FinishedSignal private void OnFinished(IntPtr data) { FinishedEventArgs e = new FinishedEventArgs(); // Populate all members of "e" (FinishedEventArgs) with real data e.Animation = Animation.GetAnimationFromPtr(data); if (_animationFinishedEventHandler != null) { //here we send all data to user event handlers _animationFinishedEventHandler(this, e); } } public static Animation GetAnimationFromPtr(global::System.IntPtr cPtr) { Animation ret = new Animation(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public float Duration { set { SetDuration(value); } get { float ret = GetDuration(); return ret; } } public AlphaFunction DefaultAlphaFunction { set { SetDefaultAlphaFunction(value); } get { AlphaFunction ret = GetDefaultAlphaFunction(); return ret; } } public Animation.State Status { get { Animation.State ret = GetState(); return ret; } } public Animation (float durationSeconds) : this (NDalicPINVOKE.Animation_New(durationSeconds), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public static Animation DownCast(BaseHandle handle) { Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Animation Assign(Animation rhs) { Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetDuration(float seconds) { NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public float GetDuration() { float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetLooping(bool looping) { NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void SetLoopCount(int count) { NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public int GetLoopCount() { int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public int GetCurrentLoop() { int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public bool IsLooping() { bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetEndAction(Animation.EndAction action) { NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Animation.EndAction GetEndAction() { Animation.EndAction ret = (Animation.EndAction)NDalicPINVOKE.Animation_GetEndAction(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetDisconnectAction(Animation.EndAction disconnectAction) { NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Animation.EndAction GetDisconnectAction() { Animation.EndAction ret = (Animation.EndAction)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetDefaultAlphaFunction(AlphaFunction alpha) { NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public AlphaFunction GetDefaultAlphaFunction() { AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetCurrentProgress(float progress) { NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public float GetCurrentProgress() { float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetSpeedFactor(float factor) { NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public float GetSpeedFactor() { float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetPlayRange(Vector2 range) { NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Vector2 GetPlayRange() { Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void Play() { NDalicPINVOKE.Animation_Play(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void PlayFrom(float progress) { NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Pause() { NDalicPINVOKE.Animation_Pause(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Animation.State GetState() { Animation.State ret = (Animation.State)NDalicPINVOKE.Animation_GetState(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void Stop() { NDalicPINVOKE.Animation_Stop(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Clear() { NDalicPINVOKE.Animation_Clear(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public AnimationSignal FinishedSignal() { AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void AnimateBy(Property target, Property.Value relativeValue) { NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBy(Property target, Property.Value relativeValue, AlphaFunction alpha) { NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBy(Property target, Property.Value relativeValue, TimePeriod period) { NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBy(Property target, Property.Value relativeValue, AlphaFunction alpha, TimePeriod period) { NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateTo(Property target, Property.Value destinationValue) { NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateTo(Property target, Property.Value destinationValue, AlphaFunction alpha) { NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateTo(Property target, Property.Value destinationValue, TimePeriod period) { NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateTo(Property target, Property.Value destinationValue, AlphaFunction alpha, TimePeriod period) { NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation) { NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Animate(Actor actor, Path path, Vector3 forward) { NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha) { NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Animate(Actor actor, Path path, Vector3 forward, TimePeriod period) { NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period) { NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Show(Actor actor, float delaySeconds) { NDalicPINVOKE.Animation_Show(swigCPtr, Actor.getCPtr(actor), delaySeconds); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Hide(Actor actor, float delaySeconds) { NDalicPINVOKE.Animation_Hide(swigCPtr, Actor.getCPtr(actor), delaySeconds); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public enum EndAction { Bake, Discard, BakeFinal } public enum Interpolation { Linear, Cubic } public enum State { STOPPED, PLAYING, PAUSED } } }