209b4b02ec22a17deac33972f307fa5fae646026
[platform/core/uifw/dali-core.git] / dali / devel-api / animation / animation-devel.h
1 #ifndef DALI_ANIMATION_DEVEL_H
2 #define DALI_ANIMATION_DEVEL_H
3
4 /*
5  * Copyright (c) 2017 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/animation.h>
23
24 namespace Dali
25 {
26
27 namespace DevelAnimation
28 {
29
30 /**
31  * @brief Enumeration for what looping mode is in.
32  */
33 enum LoopingMode
34 {
35   RESTART,      ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
36   AUTO_REVERSE  ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
37 };
38
39 /**
40  * @brief Set progress percentage marker to trigger ProgressHasBeenReachedSignal
41  *
42  * @param[in] animation the animation object to perform this operation on
43  * @param[in] progress the progress percentage to trigger the signal at, e.g .3 for 30%.
44  */
45 DALI_IMPORT_API void SetProgressNotification( Animation animation, float progress );
46
47 /**
48  * @brief Get progress percentage marker that has been set to trigger ProgressHasBeenReachedSignal
49  *
50  * @param[in] animation the animation object to perform this operation on
51  * @return the percentage to trigger at eg 0.3 for 30%
52  */
53 DALI_IMPORT_API float GetProgressNotification( Animation animation );
54
55 /**
56  * @brief Connects to this signal to be notified when an Animation's animations have reached set progress.
57  *
58  * @return A signal object to connect with
59  *
60  */
61 DALI_IMPORT_API Animation::AnimationSignalType& ProgressReachedSignal( Animation animation );
62
63 /**
64  * @brief Play the animation after a given delay time.
65  *
66  * The delay time is not included in the looping time.
67  * When the delay time is negative value, it would treat as play immediately.
68  * @param[in] animation The animation object to perform this operation on
69  * @param[in] delaySeconds The delay time
70  */
71 DALI_IMPORT_API void PlayAfter( Animation animation, float delaySeconds );
72
73 /**
74  * @brief Sets the looping mode.
75  *
76  * Animation plays forwards and then restarts from the beginning or runs backwards again.
77  * @param[in] animation The animation object to perform this operation on
78  * @param[in] loopingMode The looping mode is one of RESTART and AUTO_REVERSE
79  */
80 DALI_IMPORT_API void SetLoopingMode( Animation animation, LoopingMode loopingMode );
81
82 /**
83  * @brief Gets one of the current looping mode.
84  *
85  * @param[in] animation The animation object to perform this operation on
86  * @return The current looping mode
87  */
88 DALI_IMPORT_API LoopingMode GetLoopingMode( Animation animation );
89
90 } // namespace DevelAnimation
91
92 } // namespace Dali
93
94 #endif // DALI_ANIMATION_DEVEL_H