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