1 /** Copyright (c) 2016 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 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
32 public class Animation : BaseHandle {
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn) {
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj) {
40 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 public override void Dispose() {
49 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
52 NDalicPINVOKE.delete_Animation(swigCPtr);
54 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56 global::System.GC.SuppressFinalize(this);
63 * @brief Event arguments that passed via Finished signal
66 public class FinishedEventArgs : EventArgs
68 private Animation _animation;
71 * @brief Animation - is the Animation which has finished with the animation.
74 public Animation Animation
87 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
88 private delegate void FinishedEventCallbackDelegate(IntPtr Animation);
89 private DaliEventHandler<object,FinishedEventArgs> _animationFinishedEventHandler;
90 private FinishedEventCallbackDelegate _animationFinishedEventCallbackDelegate;
93 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
94 * (in the type of FinishedEventHandler - DaliEventHandler<object,FinishedEventArgs>) provided by the user.
95 * Finished signal is emitted when an Animation's animations have finished.
97 public event DaliEventHandler<object,FinishedEventArgs> Finished
103 // Restricted to only one listener
104 if (_animationFinishedEventHandler == null)
106 _animationFinishedEventHandler += value;
108 _animationFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
109 this.FinishedSignal().Connect(_animationFinishedEventCallbackDelegate);
118 if (_animationFinishedEventHandler != null)
120 this.FinishedSignal().Disconnect(_animationFinishedEventCallbackDelegate);
123 _animationFinishedEventHandler -= value;
128 // Callback for Animation FinishedSignal
129 private void OnFinished(IntPtr data)
131 FinishedEventArgs e = new FinishedEventArgs();
133 // Populate all members of "e" (FinishedEventArgs) with real data
134 e.Animation = Animation.GetAnimationFromPtr(data);
136 if (_animationFinishedEventHandler != null)
138 //here we send all data to user event handlers
139 _animationFinishedEventHandler(this, e);
144 public static Animation GetAnimationFromPtr(global::System.IntPtr cPtr) {
145 Animation ret = new Animation(cPtr, false);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 public float Duration
159 float ret = GetDuration();
164 public AlphaFunction DefaultAlphaFunction
168 SetDefaultAlphaFunction(value);
172 AlphaFunction ret = GetDefaultAlphaFunction();
177 public Animation.State Status
181 Animation.State ret = GetState();
187 public Animation (float durationSeconds) : this (NDalicPINVOKE.Animation_New(durationSeconds), true) {
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public static Animation DownCast(BaseHandle handle) {
192 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true) {
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 public Animation Assign(Animation rhs) {
202 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public void SetDuration(float seconds) {
208 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 public float GetDuration() {
213 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 public void SetLooping(bool looping) {
219 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public void SetLoopCount(int count) {
224 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public int GetLoopCount() {
229 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 public int GetCurrentLoop() {
235 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 public bool IsLooping() {
241 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 public void SetEndAction(Animation.EndAction action) {
247 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 public Animation.EndAction GetEndAction() {
252 Animation.EndAction ret = (Animation.EndAction)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257 public void SetDisconnectAction(Animation.EndAction disconnectAction) {
258 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 public Animation.EndAction GetDisconnectAction() {
263 Animation.EndAction ret = (Animation.EndAction)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 public void SetDefaultAlphaFunction(AlphaFunction alpha) {
269 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 public AlphaFunction GetDefaultAlphaFunction() {
274 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 public void SetCurrentProgress(float progress) {
280 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284 public float GetCurrentProgress() {
285 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 public void SetSpeedFactor(float factor) {
291 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
292 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 public float GetSpeedFactor() {
296 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 public void SetPlayRange(Vector2 range) {
302 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 public Vector2 GetPlayRange() {
307 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 NDalicPINVOKE.Animation_Play(swigCPtr);
314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
317 public void PlayFrom(float progress) {
318 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322 public void Pause() {
323 NDalicPINVOKE.Animation_Pause(swigCPtr);
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 public Animation.State GetState() {
328 Animation.State ret = (Animation.State)NDalicPINVOKE.Animation_GetState(swigCPtr);
329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 NDalicPINVOKE.Animation_Stop(swigCPtr);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 public void Clear() {
339 NDalicPINVOKE.Animation_Clear(swigCPtr);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 public AnimationSignal FinishedSignal() {
344 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 public void AnimateBy(Property target, Property.Value relativeValue) {
350 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue));
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 public void AnimateBy(Property target, Property.Value relativeValue, AlphaFunction alpha) {
355 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 public void AnimateBy(Property target, Property.Value relativeValue, TimePeriod period) {
360 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), TimePeriod.getCPtr(period));
361 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 public void AnimateBy(Property target, Property.Value relativeValue, AlphaFunction alpha, TimePeriod period) {
365 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 public void AnimateTo(Property target, Property.Value destinationValue) {
370 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue));
371 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
374 public void AnimateTo(Property target, Property.Value destinationValue, AlphaFunction alpha) {
375 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 public void AnimateTo(Property target, Property.Value destinationValue, TimePeriod period) {
380 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), TimePeriod.getCPtr(period));
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384 public void AnimateTo(Property target, Property.Value destinationValue, AlphaFunction alpha, TimePeriod period) {
385 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), Property.Value.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 public void AnimateBetween(Property target, KeyFrames keyFrames) {
390 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 public void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation) {
395 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha) {
400 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation) {
405 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
409 public void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period) {
410 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 public void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation) {
415 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419 public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period) {
420 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424 public void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation) {
425 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 public void Animate(Actor actor, Path path, Vector3 forward) {
430 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward));
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 public void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha) {
435 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439 public void Animate(Actor actor, Path path, Vector3 forward, TimePeriod period) {
440 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
441 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 public void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period) {
445 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
446 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449 public void Show(Actor actor, float delaySeconds) {
450 NDalicPINVOKE.Animation_Show(swigCPtr, Actor.getCPtr(actor), delaySeconds);
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 public void Hide(Actor actor, float delaySeconds) {
455 NDalicPINVOKE.Animation_Hide(swigCPtr, Actor.getCPtr(actor), delaySeconds);
456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 public enum EndAction {
465 public enum Interpolation {