Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-core.git] / dali / public-api / animation / animation.h
1 #ifndef __DALI_ANIMATION_H__
2 #define __DALI_ANIMATION_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/animation/alpha-functions.h>
23 #include <dali/public-api/animation/key-frames.h>
24 #include <dali/public-api/animation/path.h>
25 #include <dali/public-api/animation/time-period.h>
26 #include <dali/public-api/object/any.h>
27 #include <dali/public-api/object/handle.h>
28 #include <dali/public-api/object/property.h>
29 #include <dali/public-api/signals/dali-signal-v2.h>
30
31 namespace Dali
32 {
33
34 class Actor;
35 struct Degree;
36 class Quaternion;
37 struct Radian;
38 class ShaderEffect;
39 struct Property;
40 struct Vector2;
41 struct Vector3;
42 struct Vector4;
43
44 namespace Internal DALI_INTERNAL
45 {
46 class Animation;
47 }
48
49 /**
50  * @brief Dali::Animation can be used to animate the properties of any number of objects, typically Actors.
51  *
52  * An example animation setup is shown below:
53  *
54  * @code
55  *
56  * struct MyProgram
57  * {
58  *   Actor mActor; // The object we wish to animate
59  *   Animation mAnimation; // Keep this to control the animation
60  * }
61  *
62  * // ...To play the animation
63  *
64  * mAnimation = Animation::New(3.0f); // duration 3 seconds
65  * mAnimation.MoveTo(mActor, 10.0f, 50.0f, 0.0f);
66  * mAnimation.Play();
67  *
68  * @endcode
69  *
70  * Dali::Animation supports "fire and forget" behaviour i.e. an animation continues to play if the handle is discarded.
71  * Note that in the following example, the "Finish" signal will be emitted:
72  *
73  * @code
74  *
75  * void ExampleCallback( Animation& source )
76  * {
77  *   std::cout << "Animation has finished" << std::endl;
78  * }
79  *
80  * void ExampleAnimation( Actor actor )
81  * {
82  *   Animation animation = Animation::New(2.0f); // duration 2 seconds
83  *   animation.MoveTo(actor, 10.0f, 50.0f, 0.0f);
84  *   animation.FinishedSignal().Connect( ExampleCallback );
85  *   animation.Play();
86  * } // At this point the animation handle has gone out of scope
87  *
88  * Actor actor = Actor::New();
89  * Stage::GetCurrent().Add( actor );
90  *
91  * // Fire animation and forget about it
92  * ExampleAnimation( actor );
93  *
94  * // However the animation will continue, and "Animation has finished" will be printed after 2 seconds.
95  *
96  * @endcode
97  *
98  * If the "Finish" signal is connected to a member function of an object, it must be disconnected before the object is destroyed.
99  * This is typically done in the object destructor, and requires either the Dali::Connection object or Dali::Animation handle to be stored.
100  */
101 class DALI_IMPORT_API Animation : public BaseHandle
102 {
103 public:
104
105   typedef SignalV2< void (Animation&) > AnimationSignalV2; ///< Animation finished signal type
106
107   typedef Any AnyFunction; ///< Interpolation function
108
109   /**
110    * @brief What to do when the animation ends, is stopped or is destroyed
111    */
112   enum EndAction
113   {
114     Bake,     ///< When the animation ends, the animated property values are saved.
115     Discard,  ///< When the animation ends, the animated property values are forgotten.
116     BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake.
117   };
118
119   /**
120    * @brief What interpolation method to use on key-frame animations
121    */
122   enum Interpolation
123   {
124     Linear,   ///< Values in between key frames are interpolated using a linear polynomial. (Default)
125     Cubic     ///< Values in between key frames are interpolated using a cubic polynomial.
126   };
127
128   //Signal Names
129   static const char* const SIGNAL_FINISHED; ///< name "finished"
130
131   //Action Names
132   static const char* const ACTION_PLAY;     ///< name "play"
133   static const char* const ACTION_STOP;     ///< name "stop"
134   static const char* const ACTION_PAUSE;    ///< name "pause"
135
136   /**
137    * @brief Create an uninitialized Animation; this can be initialized with Animation::New().
138    *
139    * Calling member functions with an uninitialized Dali::Object is not allowed.
140    */
141   Animation();
142
143   /**
144    * @brief Create an initialized Animation.
145    *
146    * The animation will not loop.
147    * The default end action is "Bake".
148    * The default alpha function is linear.
149    * @pre durationSeconds must be greater than zero.
150    * @param [in] durationSeconds The duration in seconds.
151    * @return A handle to a newly allocated Dali resource.
152    */
153   static Animation New(float durationSeconds);
154
155   /**
156    * @brief Downcast an Object handle to Animation.
157    *
158    * If handle points to an Animation object the downcast produces
159    * valid handle. If not the returned handle is left uninitialized.
160    *
161    * @param[in] handle to An object
162    * @return handle to a Animation object or an uninitialized handle
163    */
164   static Animation DownCast( BaseHandle handle );
165
166   /**
167    * @brief Destructor
168    *
169    * This is non-virtual since derived Handle types must not contain data or virtual methods.
170    */
171   ~Animation();
172
173   /**
174    * @brief This copy constructor is required for (smart) pointer semantics.
175    *
176    * @param [in] handle A reference to the copied handle
177    */
178   Animation(const Animation& handle);
179
180   /**
181    * @brief This assignment operator is required for (smart) pointer semantics.
182    *
183    * @param [in] rhs  A reference to the copied handle
184    * @return A reference to this
185    */
186   Animation& operator=(const Animation& rhs);
187
188   /**
189    * @brief Set the duration of an animation.
190    *
191    * @pre durationSeconds must be greater than zero.
192    * @param[in] seconds The duration in seconds.
193    */
194   void SetDuration(float seconds);
195
196   /**
197    * @brief Retrieve the duration of an animation.
198    *
199    * @return The duration in seconds.
200    */
201   float GetDuration() const;
202
203   /**
204    * @brief Set whether the animation will loop.
205    *
206    * @param[in] looping True if the animation will loop.
207    */
208   void SetLooping(bool looping);
209
210   /**
211    * @brief Query whether the animation will loop.
212    *
213    * @return True if the animation will loop.
214    */
215   bool IsLooping() const;
216
217   /**
218    * @brief Set the end action of the animation.
219    *
220    * This action is performed when the animation ends or if it is stopped.
221    * Default end action is bake
222    * @param[in] action The end action.
223    */
224   void SetEndAction(EndAction action);
225
226   /**
227    * @brief Returns the end action of the animation.
228    *
229    * @return The end action.
230    */
231   EndAction GetEndAction() const;
232
233   /**
234    * @brief Set the disconnect action.
235    *
236    * If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
237    * Default action is to BakeFinal.
238    * @param[in] disconnectAction The disconnect action.
239    */
240   void SetDisconnectAction( EndAction disconnectAction );
241
242   /**
243    * @brief Returns the disconnect action.
244    *
245    * @return The disconnect action.
246    */
247   EndAction GetDisconnectAction() const;
248
249   /**
250    * @brief Set the default alpha function for an animation.
251    *
252    * This is applied to individual property animations, if no further alpha functions are supplied.
253    * @param[in] alpha The default alpha function.
254    */
255   void SetDefaultAlphaFunction(AlphaFunction alpha);
256
257   /**
258    * @brief Retrieve the default alpha function for an animation.
259    *
260    * @return The default alpha function.
261    */
262   AlphaFunction GetDefaultAlphaFunction() const;
263
264   /*
265    * @brief Sets the progress of the animation.
266    * The animation will play (or continue playing) from this point. The progress
267    * must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
268    * otherwise, it will be ignored.
269    *
270    * @param[in] progress The new progress as a normalized value between [0,1] or between the
271    * play range if specified.
272    */
273   void SetCurrentProgress( float progress );
274
275   /**
276   * @brief Retrieve the current progress of the animation.
277   *
278   * @return The current progress as a normalized value between [0,1].
279   */
280   float GetCurrentProgress();
281
282   /**
283    * @brief Specifies an speed factor for the animation.
284    *
285    * The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will
286    * slow down the animation and values above one will speed up the animation. It is also possible to specify a negative multiplier
287    * to play the animation in reverse.
288    *
289    * @param[in] factor A value which will multiply the velocity.
290    */
291   void SetSpeedFactor( float factor );
292
293   /**
294    * @brief Retrieve the speed factor of the animation
295    *
296    * @return speed factor
297    */
298   float GetSpeedFactor() const;
299
300   /**
301    * @brief Set the playing range.
302    * Animation will play between the values specified. Both values ( range.x and range.y ) should be between 0-1,
303    * otherwise they will be ignored. If the range provided is not in proper order ( minimum,maximum ), it will be reordered.
304    *
305    * @param[in] range Two values between [0,1] to specify minimum and maximum progress. The
306    * animation will play between those values.
307    */
308   void SetPlayRange( const Vector2& range );
309
310   /**
311    * @brief Get the playing range
312    *
313    * @return The play range defined for the animation.
314    */
315   Vector2 GetPlayRange() const;
316
317   /**
318    * @brief Play the animation.
319    */
320   void Play();
321
322   /**
323    * @brief Play the animation from a given point.
324    * The progress must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
325    * otherwise, it will be ignored.
326    *
327    * @param[in] progress A value between [0,1], or between the play range if specified, form where the animation should start playing
328    */
329   void PlayFrom( float progress );
330
331   /**
332    * @brief Pause the animation.
333    */
334   void Pause();
335
336   /**
337    * @brief Stop the animation.
338    */
339   void Stop();
340
341   /**
342    * @brief Clear the animation.
343    *
344    * This disconnects any objects that were being animated, effectively stopping the animation.
345    */
346   void Clear();
347
348   /**
349    * @brief Connect to this signal to be notified when an Animation's animations have finished.
350    *
351    * @return A signal object to Connect() with.
352    */
353   AnimationSignalV2& FinishedSignal();
354
355   /**
356    * @brief Animate a property value by a relative amount.
357    *
358    * The default alpha function will be used.
359    * The effect will start & end when the animation begins & ends.
360    * @param [in] target The target object/property to animate.
361    * @param [in] relativeValue The property value will change by this amount.
362    */
363   void AnimateBy(Property target, Property::Value relativeValue);
364
365   /**
366    * @brief Animate a property value by a relative amount.
367    *
368    * The effect will start & end when the animation begins & ends.
369    * @param [in] target The target object/property to animate.
370    * @param [in] relativeValue The property value will change by this amount.
371    * @param [in] alpha The alpha function to apply.
372    */
373   void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha);
374
375   /**
376    * @brief Animate a property value by a relative amount.
377    *
378    * The default alpha function will be used.
379    * @param [in] target The target object/property to animate.
380    * @param [in] relativeValue The property value will increase/decrease by this amount.
381    * @param [in] period The effect will occur during this time period.
382    */
383   void AnimateBy(Property target, Property::Value relativeValue, TimePeriod period);
384
385   /**
386    * @brief Animate a property value by a relative amount.
387    *
388    * @param [in] target The target object/property to animate.
389    * @param [in] relativeValue The property value will increase/decrease by this amount.
390    * @param [in] alpha The alpha function to apply.
391    * @param [in] period The effect will occur during this time period.
392    */
393   void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period);
394
395   /**
396    * @brief Animate a property to a destination value.
397    *
398    * The default alpha function will be used.
399    * The effect will start & end when the animation begins & ends.
400    * @param [in] target The target object/property to animate.
401    * @param [in] destinationValue The destination value.
402    */
403   void AnimateTo(Property target, Property::Value destinationValue);
404
405   /**
406    * @brief Animate a property to a destination value.
407    *
408    * The effect will start & end when the animation begins & ends.
409    * @param [in] target The target object/property to animate.
410    * @param [in] destinationValue The destination value.
411    * @param [in] alpha The alpha function to apply.
412    */
413   void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha);
414
415   /**
416    * @brief Animate a property to a destination value.
417    *
418    * The default alpha function will be used.
419    * @param [in] target The target object/property to animate.
420    * @param [in] destinationValue The destination value.
421    * @param [in] period The effect will occur during this time period.
422    */
423   void AnimateTo(Property target, Property::Value destinationValue, TimePeriod period);
424
425   /**
426    * @brief Animate a property to a destination value.
427    *
428    * @param [in] target The target object/property to animate.
429    * @param [in] destinationValue The destination value.
430    * @param [in] alpha The alpha function to apply.
431    * @param [in] period The effect will occur during this time period.
432    */
433   void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
434
435    /**
436    * @brief Animate a property between keyframes.
437    *
438    * @param [in] target The target object/property to animate.
439    * @param [in] keyFrames The key frames
440    */
441   void AnimateBetween(Property target, KeyFrames& keyFrames);
442
443   /**
444    * @brief Animate a property between keyframes.
445    *
446    * @param [in] target The target object + property to animate
447    * @param [in] keyFrames The set of time / value pairs between which to animate.
448    * @param [in] interpolation The method used to interpolate between values.
449    */
450   void AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation);
451
452   /**
453    * @brief Animate a property between keyframes.
454    *
455    * @param [in] target The target object/property to animate.
456    * @param [in] keyFrames The key frames
457    * @param [in] alpha The alpha function to apply.
458    */
459   void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha);
460
461   /**
462    * @brief Animate a property between keyframes.
463    *
464    * @param [in] target The target object + property to animate
465    * @param [in] keyFrames The set of time / value pairs between which to animate.
466    * @param [in] alpha The alpha function to apply.
467    * @param [in] interpolation The method used to interpolate between values.
468    */
469   void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation);
470
471   /**
472    * @brief Animate a property between keyframes.
473    *
474    * @param [in] target The target object/property to animate.
475    * @param [in] keyFrames The key frames
476    * @param [in] period The effect will occur during this time period.
477    */
478   void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period);
479
480   /**
481    * @brief Animate a property between keyframes.
482    *
483    * @param [in] target The target object + property to animate
484    * @param [in] keyFrames The set of time / value pairs between which to animate.
485    * @param [in] period The effect will occur duing this time period.
486    * @param [in] interpolation The method used to interpolate between values.
487    */
488   void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
489
490   /**
491    * @brief Animate a property between keyframes.
492    *
493    * @param [in] target The target object/property to animate.
494    * @param [in] keyFrames The key frames
495    * @param [in] alpha The alpha function to apply.
496    * @param [in] period The effect will occur during this time period.
497    */
498   void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
499
500   /**
501    * @brief Animate a property between keyframes.
502    *
503    * @param [in] target The target object + property to animate
504    * @param [in] keyFrames The set of time / value pairs between which to animate.
505    * @param [in] alpha The alpha function to apply to the overall progress.
506    * @param [in] period The effect will occur duing this time period.
507    * @param [in] interpolation The method used to interpolate between values.
508    */
509   void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
510
511
512   // Actor-specific convenience methods
513
514   /**
515    * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
516    * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
517    *
518    * @param[in] actor The actor to animate
519    * @param[in] path The path. It defines position and orientation
520    * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
521    */
522   void Animate( Actor actor, Path path, const Vector3& forward );
523
524   /**
525    * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
526    * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
527    *
528    * @param[in] actor The actor to animate
529    * @param[in] path The path. It defines position and orientation
530    * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
531    * @param [in] alpha The alpha function to apply.
532    */
533   void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha );
534
535   /**
536    * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
537    * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
538    *
539    * @param[in] actor The actor to animate
540    * @param[in] path The path. It defines position and orientation
541    * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
542    * @param [in] period The effect will occur during this time period.
543    */
544   void Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period );
545
546   /**
547    * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
548    * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
549    *
550    * @param[in] actor The actor to animate
551    * @param[in] path The path. It defines position and orientation
552    * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
553    * @param [in] alpha The alpha function to apply.
554    * @param [in] period The effect will occur during this time period.
555    */
556   void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period);
557
558   /**
559    * @brief Move an actor relative to its position.
560    *
561    * The default alpha function will be used.
562    * The move will start & end when the animation begins & ends.
563    * @param [in] actor The actor to animate.
564    * @param [in] x axis displacement.
565    * @param [in] y axis displacement.
566    * @param [in] z axis displacement.
567    */
568   void MoveBy(Actor actor, float x, float y, float z);
569
570   /**
571    * @brief Move an actor relative to its position.
572    *
573    * This overload allows the alpha function to be customized.
574    * The move will start & end when the animation begins & ends.
575    * @param [in] actor The actor to animate.
576    * @param [in] displacement relative to current position.
577    * @param [in] alpha The alpha function to apply.
578    */
579   void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha);
580
581   /**
582    * @brief Move an actor relative to its position.
583    *
584    * This overload allows the translation start & end time to be customized.
585    * @pre delaySeconds must be zero or greater.
586    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
587    * @param [in] actor The actor to animate.
588    * @param [in] displacement relative to current position.
589    * @param [in] alpha The alpha function to apply.
590    * @param [in] delaySeconds The initial delay from the start of the animation.
591    * @param [in] durationSeconds The duration of the translation.
592    */
593   void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds);
594
595   /**
596    * @brief Move an actor to a target position.
597    *
598    * The default alpha function will be used.
599    * The move will start & end when the animation begins & ends.
600    * @param [in] actor The actor to animate.
601    * @param [in] x axis position.
602    * @param [in] y axis position.
603    * @param [in] z axis position.
604    */
605   void MoveTo(Actor actor, float x, float y, float z);
606
607   /**
608    * @brief Move an actor to a target position.
609    *
610    * This overload allows the alpha function to be customized.
611    * The move will start & end when the animation begins & ends.
612    * @param [in] actor The actor to animate.
613    * @param [in] position to move to
614    * @param [in] alpha The alpha function to apply.
615    */
616   void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha);
617
618   /**
619    * @brief Move an actor to a target position.
620    *
621    * This overload allows the translation start & end time to be customized.
622    * @pre delaySeconds must be zero or greater.
623    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
624    * @param [in] actor The actor to animate.
625    * @param [in] position to move to
626    * @param [in] alpha The alpha function to apply.
627    * @param [in] delaySeconds The initial delay from the start of the animation.
628    * @param [in] durationSeconds The duration of the translation.
629    */
630   void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds);
631
632   /**
633    * @brief Rotate an actor around an arbitrary axis.
634    *
635    * The default alpha function will be used.
636    * The rotation will start & end when the animation begins & ends.
637    * @param [in] actor The actor to animate.
638    * @param [in] angle The angle in degrees.
639    * @param [in] axis The axis to rotate around
640    */
641   void RotateBy(Actor actor, Degree angle, Vector3 axis);
642
643   /**
644    * @brief Rotate an actor around an arbitrary axis.
645    *
646    * The default alpha function will be used.
647    * The rotation will start & end when the animation begins & ends.
648    * @param [in] actor The actor to animate.
649    * @param [in] angle The angle in radians.
650    * @param [in] axis The axis to rotate around
651    */
652   void RotateBy(Actor actor, Radian angle, Vector3 axis);
653
654   /**
655    * @brief Rotate an actor around an arbitrary axis.
656    *
657    * This overload allows the alpha function to be customized.
658    * The rotation will start & end when the animation begins & ends.
659    * @param [in] actor The actor to animate.
660    * @param [in] angle The angle in radians.
661    * @param [in] axis The axis to rotate around.
662    * @param [in] alpha The alpha function to apply.
663    */
664   void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
665
666   /**
667    * @brief Rotate an actor around an arbitrary axis.
668    *
669    * This overload allows the alpha function to be customized.
670    * The rotation will start & end when the animation begins & ends.
671    * @param [in] actor The actor to animate.
672    * @param [in] angle The angle in radians.
673    * @param [in] axis The axis to rotate around.
674    * @param [in] alpha The alpha function to apply.
675    */
676   void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
677
678   /**
679    * @brief Rotate an actor around an arbitrary axis.
680    *
681    * This overload allows the rotation start & end time to be customized.
682    * @pre delaySeconds must be zero or greater.
683    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
684    * @param [in] actor The actor to animate.
685    * @param [in] angle The angle in degrees.
686    * @param [in] axis The axis to rotate around
687    * @param [in] alpha The alpha function to apply.
688    * @param [in] delaySeconds The initial delay from the start of the animation.
689    * @param [in] durationSeconds The duration of the rotation.
690    */
691   void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
692
693   /**
694    * @brief Rotate an actor around an arbitrary axis.
695    *
696    * This overload allows the rotation start & end time to be customized.
697    * @pre delaySeconds must be zero or greater.
698    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
699    * @param [in] actor The actor to animate.
700    * @param [in] angle The angle in radians.
701    * @param [in] axis The axis to rotate around
702    * @param [in] alpha The alpha function to apply.
703    * @param [in] delaySeconds The initial delay from the start of the animation.
704    * @param [in] durationSeconds The duration of the rotation.
705    */
706   void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
707
708   /**
709    * @brief Rotate an actor to a target orientation.
710    *
711    * The default alpha function will be used.
712    * The rotation will start & end when the animation begins & ends.
713    * @param [in] actor The actor to animate.
714    * @param [in] angle The target rotation angle in degrees.
715    * @param [in] axis The target axis of rotation.
716    */
717   void RotateTo(Actor actor, Degree angle, Vector3 axis);
718
719   /**
720    * @brief Rotate an actor to a target orientation.
721    *
722    * The default alpha function will be used.
723    * The rotation will start & end when the animation begins & ends.
724    * @param [in] actor The actor to animate.
725    * @param [in] angle The target rotation angle in radians.
726    * @param [in] axis The target axis of rotation.
727    */
728   void RotateTo(Actor actor, Radian angle, Vector3 axis);
729
730   /**
731    * @brief Rotate an actor to a target orientation.
732    *
733    * The default alpha function will be used.
734    * The rotation will start & end when the animation begins & ends.
735    * @param [in] actor The actor to animate.
736    * @param [in] orientation The target orientation.
737    */
738   void RotateTo(Actor actor, Quaternion orientation);
739
740   /**
741    * @brief Rotate an actor to a target orientation.
742    *
743    * This overload allows the alpha function to be customized.
744    * The rotation will start & end when the animation begins & ends.
745    * @param [in] actor The actor to animate.
746    * @param [in] angle The target rotation angle in degrees.
747    * @param [in] axis The target axis of rotation.
748    * @param [in] alpha The alpha function to apply.
749    */
750   void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
751
752   /**
753    * @brief Rotate an actor to a target orientation.
754    *
755    * This overload allows the alpha function to be customized.
756    * The rotation will start & end when the animation begins & ends.
757    * @param [in] actor The actor to animate.
758    * @param [in] angle The target rotation angle in radians.
759    * @param [in] axis The target axis of rotation.
760    * @param [in] alpha The alpha function to apply.
761    */
762   void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
763
764   /**
765    * @brief Rotate an actor to a target orientation.
766    *
767    * This overload allows the alpha function to be customized.
768    * The rotation will start & end when the animation begins & ends.
769    * @param [in] actor The actor to animate.
770    * @param [in] orientation The target orientation.
771    * @param [in] alpha The alpha function to apply.
772    */
773   void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha);
774
775   /**
776    * @brief Rotate an actor to a target orientation.
777    *
778    * This overload allows the rotation start & end time to be customized.
779    * @pre delaySeconds must be zero or greater.
780    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
781    * @param [in] actor The actor to animate.
782    * @param [in] angle The target rotation angle in degrees.
783    * @param [in] axis The target axis of rotation.
784    * @param [in] alpha The alpha function to apply.
785    * @param [in] delaySeconds The initial delay from the start of the animation.
786    * @param [in] durationSeconds The duration of the rotation.
787    */
788   void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
789
790   /**
791    * @brief Rotate an actor to a target orientation.
792    *
793    * This overload allows the rotation start & end time to be customized.
794    * @pre delaySeconds must be zero or greater.
795    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
796    * @param [in] actor The actor to animate.
797    * @param [in] angle The target rotation angle in radians.
798    * @param [in] axis The target axis of rotation.
799    * @param [in] alpha The alpha function to apply.
800    * @param [in] delaySeconds The initial delay from the start of the animation.
801    * @param [in] durationSeconds The duration of the rotation.
802    */
803   void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
804
805   /**
806    * @brief Rotate an actor to a target orientation.
807    *
808    * This overload allows the rotation start & end time to be customized.
809    * @pre delaySeconds must be zero or greater.
810    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
811    * @param [in] actor The actor to animate.
812    * @param [in] orientation The target orientation.
813    * @param [in] alpha The alpha function to apply.
814    * @param [in] delaySeconds The initial delay from the start of the animation.
815    * @param [in] durationSeconds The duration of the rotation.
816    */
817   void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
818
819   /**
820    * @brief Scale an actor.
821    *
822    * The default alpha function will be used.
823    * The scaling will start & end when the animation begins & ends.
824    * @param [in] actor The actor to animate.
825    * @param [in] x Scale factor in the X-direction.
826    * @param [in] y Scale factor in the Y-direction.
827    * @param [in] z Scale factor in the Z-direction.
828    */
829   void ScaleBy(Actor actor, float x, float y, float z);
830
831   /**
832    * @brief Scale an actor.
833    *
834    * This overload allows the alpha function to be customized.
835    * The scaling will start & end when the animation begins & ends.
836    * @param [in] actor The actor to animate.
837    * @param [in] scale The scale factor.
838    * @param [in] alpha The alpha function to apply.
839    */
840   void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha);
841
842   /**
843    * @brief Scale an actor.
844    *
845    * This overload allows the scaling start & end time to be customized.
846    * @pre delaySeconds must be zero or greater.
847    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
848    * @param [in] actor The actor to animate.
849    * @param [in] scale The scale factor.
850    * @param [in] alpha The alpha function to apply.
851    * @param [in] delaySeconds The initial delay from the start of the animation.
852    * @param [in] durationSeconds The duration of the scaling.
853    */
854   void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
855
856   /**
857    * @brief Scale an actor to a target scale factor.
858    *
859    * The default alpha function will be used.
860    * The scaling will start & end when the animation begins & ends.
861    * @param [in] actor The actor to animate.
862    * @param [in] x Target scale-factor in the X-direction.
863    * @param [in] y Target scale-factor in the Y-direction.
864    * @param [in] z Target scale-factor in the Z-direction.
865    */
866   void ScaleTo(Actor actor, float x, float y, float z);
867
868   /**
869    * @brief Scale an actor to a target scale factor.
870    *
871    * This overload allows the alpha function to be customized.
872    * The scaling will start & end when the animation begins & ends.
873    * @param [in] actor The actor to animate.
874    * @param [in] scale The target scale factor.
875    * @param [in] alpha The alpha function to apply.
876    */
877   void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha);
878
879   /**
880    * @brief Scale an actor to a target scale factor.
881    *
882    * This overload allows the scaling start & end time to be customized.
883    * @pre delaySeconds must be zero or greater.
884    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
885    * @param [in] actor The actor to animate.
886    * @param [in] scale The target scale factor.
887    * @param [in] alpha The alpha function to apply.
888    * @param [in] delaySeconds The initial delay from the start of the animation.
889    * @param [in] durationSeconds The duration of the scaling.
890    */
891   void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
892
893   /**
894    * @brief Show an actor during the animation.
895    *
896    * @param [in] actor The actor to animate.
897    * @param [in] delaySeconds The initial delay from the start of the animation.
898    */
899   void Show(Actor actor, float delaySeconds);
900
901   /**
902    * @brief Hide an actor during the animation.
903    *
904    * @param [in] actor The actor to animate.
905    * @param [in] delaySeconds The initial delay from the start of the animation.
906    */
907   void Hide(Actor actor, float delaySeconds);
908
909   /**
910    * @brief Animate the opacity of an actor.
911    *
912    * The default alpha function will be used.
913    * The effect will start & end when the animation begins & ends.
914    * @param [in] actor The actor to animate.
915    * @param [in] opacity The relative change in opacity.
916    */
917   void OpacityBy(Actor actor, float opacity);
918
919   /**
920    * @brief Animate the opacity of an actor.
921    *
922    * This overload allows the alpha function to be customized.
923    * The effect will start & end when the animation begins & ends.
924    * @param [in] actor The actor to animate.
925    * @param [in] opacity The relative change in opacity.
926    * @param [in] alpha The alpha function to apply.
927    */
928   void OpacityBy(Actor actor, float opacity, AlphaFunction alpha);
929
930   /**
931    * @brief Animate the opacity of an actor.
932    *
933    * This overload allows the animation start & end time to be customized.
934    * @pre delaySeconds must be zero or greater.
935    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
936    * @param [in] actor The actor to animate.
937    * @param [in] opacity The relative change in opacity.
938    * @param [in] alpha The alpha function to apply.
939    * @param [in] delaySeconds The initial delay from the start of the animation.
940    * @param [in] durationSeconds The duration of the opacity animation.
941    */
942   void OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
943
944   /**
945    * @brief Animate an actor to a target opacity.
946    *
947    * The default alpha function will be used.
948    * The effect will start & end when the animation begins & ends.
949    * @param [in] actor The actor to animate.
950    * @param [in] opacity The target opacity.
951    */
952   void OpacityTo(Actor actor, float opacity);
953
954   /**
955    * @brief Animate an actor to a target opacity.
956    *
957    * This overload allows the alpha function to be customized.
958    * The effect will start & end when the animation begins & ends.
959    * @param [in] actor The actor to animate.
960    * @param [in] opacity The target opacity.
961    * @param [in] alpha The alpha function to apply.
962    */
963   void OpacityTo(Actor actor, float opacity, AlphaFunction alpha);
964
965   /**
966    * @brief Animate an actor to a target opacity.
967    *
968    * This overload allows the animation start & end time to be customized.
969    * @pre delaySeconds must be zero or greater.
970    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
971    * @param [in] actor The actor to animate.
972    * @param [in] opacity The target opacity.
973    * @param [in] alpha The alpha function to apply.
974    * @param [in] delaySeconds The initial delay from the start of the animation.
975    * @param [in] durationSeconds The duration of the opacity animation.
976    */
977   void OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
978
979   /**
980    * @brief Animate the color of an actor.
981    *
982    * The default alpha function will be used.
983    * The effect will start & end when the animation begins & ends.
984    * @param [in] actor The actor to animate.
985    * @param [in] color The relative change in color.
986    */
987   void ColorBy(Actor actor, Vector4 color);
988
989   /**
990    * @brief Animate the color of an actor.
991    *
992    * This overload allows the alpha function to be customized.
993    * The effect will start & end when the animation begins & ends.
994    * @param [in] actor The actor to animate.
995    * @param [in] color The relative change in color.
996    * @param [in] alpha The alpha function to apply.
997    */
998   void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha);
999
1000   /**
1001    * @brief Animate the color of an actor.
1002    *
1003    * This overload allows the animation start & end time to be customized.
1004    * @pre delaySeconds must be zero or greater.
1005    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1006    * @param [in] actor The actor to animate.
1007    * @param [in] color The relative change in color.
1008    * @param [in] alpha The alpha function to apply.
1009    * @param [in] delaySeconds The initial delay from the start of the animation.
1010    * @param [in] durationSeconds The duration of the color animation.
1011    */
1012   void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1013
1014   /**
1015    * @brief Animate an actor to a target color.
1016    *
1017    * The default alpha function will be used.
1018    * The effect will start & end when the animation begins & ends.
1019    * @param [in] actor The actor to animate.
1020    * @param [in] color The target color.
1021    */
1022   void ColorTo(Actor actor, Vector4 color);
1023
1024   /**
1025    * @brief Animate an actor to a target color.
1026    *
1027    * This overload allows the alpha function to be customized.
1028    * The effect will start & end when the animation begins & ends.
1029    * @param [in] actor The actor to animate.
1030    * @param [in] color The target color.
1031    * @param [in] alpha The alpha function to apply.
1032    */
1033   void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha);
1034
1035   /**
1036    * @brief Animate an actor to a target color.
1037    *
1038    * This overload allows the animation start & end time to be customized.
1039    * @pre delaySeconds must be zero or greater.
1040    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1041    * @param [in] actor The actor to animate.
1042    * @param [in] color The target color.
1043    * @param [in] alpha The alpha function to apply.
1044    * @param [in] delaySeconds The initial delay from the start of the animation.
1045    * @param [in] durationSeconds The duration of the color animation.
1046    */
1047   void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1048
1049   /**
1050    * @brief Resize an actor.
1051    *
1052    * The default alpha function will be used.
1053    * The resizing will start & end when the animation begins & ends.
1054    * The depth defaults to the minimum of width & height.
1055    * @param [in] actor The actor to animate.
1056    * @param [in] width The target width.
1057    * @param [in] height The target height.
1058    */
1059   void Resize(Actor actor, float width, float height);
1060
1061   /**
1062    * @brief Resize an actor.
1063    *
1064    * This overload allows the alpha function to be customized.
1065    * The resizing will start & end when the animation begins & ends.
1066    * The depth defaults to the minimum of width & height.
1067    * @param [in] actor The actor to animate.
1068    * @param [in] width The target width.
1069    * @param [in] height The target height.
1070    * @param [in] alpha The alpha function to apply.
1071    */
1072   void Resize(Actor actor, float width, float height, AlphaFunction alpha);
1073
1074   /**
1075    * @brief Resize an actor.
1076    *
1077    * This overload allows the resizing start & end time to be customized.
1078    * The depth defaults to the minimum of width & height.
1079    * @pre delaySeconds must be zero or greater.
1080    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1081    * @param [in] actor The actor to animate.
1082    * @param [in] width The target width.
1083    * @param [in] height The target height.
1084    * @param [in] alpha The alpha function to apply.
1085    * @param [in] delaySeconds The initial delay from the start of the animation.
1086    * @param [in] durationSeconds The duration of the resizing.
1087    */
1088   void Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1089
1090   /**
1091    * @brief Resize an actor.
1092    *
1093    * The default alpha function will be used.
1094    * The resizing will start & end when the animation begins & ends.
1095    * @param [in] actor The actor to animate.
1096    * @param [in] size The target size.
1097    */
1098   void Resize(Actor actor, Vector3 size);
1099
1100   /**
1101    * @brief Resize an actor.
1102    *
1103    * This overload allows the alpha function to be customized.
1104    * The resizing will start & end when the animation begins & ends.
1105    * @param [in] actor The actor to animate.
1106    * @param [in] size The target size.
1107    * @param [in] alpha The alpha function to apply.
1108    */
1109   void Resize(Actor actor, Vector3 size, AlphaFunction alpha);
1110
1111   /**
1112    * @brief Resize an actor.
1113    *
1114    * This overload allows the resizing start & end time to be customized.
1115    * @pre delaySeconds must be zero or greater.
1116    * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1117    * @param [in] actor The actor to animate.
1118    * @param [in] size The target size.
1119    * @param [in] alpha The alpha function to apply.
1120    * @param [in] delaySeconds The initial delay from the start of the animation.
1121    * @param [in] durationSeconds The duration of the resizing.
1122    */
1123   void Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1124
1125 public: // Not intended for use by Application developers
1126
1127   /**
1128    * @brief This constructor is used by Dali New() methods
1129    * @param [in] animation A pointer to a newly allocated Dali resource
1130    */
1131   explicit DALI_INTERNAL Animation(Internal::Animation* animation);
1132
1133 };
1134
1135 } // namespace Dali
1136
1137 #endif // __DALI_ANIMATION_H__