Merge "Added PixelBuffer for image loading and operations." into devel/master
[platform/core/uifw/dali-adaptor.git] / adaptors / emscripten / wrappers / animation-wrapper.h
1 #ifndef __DALI_ANIMATION_WRAPPER_H__
2 #define __DALI_ANIMATION_WRAPPER_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22 #include <dali/public-api/dali-core.h>
23 #include "emscripten/emscripten.h"
24 #include "emscripten/bind.h"
25
26 // INTERNAL INCLUDES
27 #include "handle-wrapper.h"
28
29 namespace Dali
30 {
31 namespace Internal
32 {
33 namespace Emscripten
34 {
35
36 /**
37  * Keyframe animation helper functions for Emscripten.
38  *
39  * Allows a string alphaFunction
40  *
41  * @param[in] keyFrames The dali keyframes
42  * @param[in] progress The keyframe progress
43  * @param[in] value The property value
44  * @param[in] alphaFunction The alpha function by name
45  *
46  */
47 void KeyFramesAddWithAlpha(Dali::KeyFrames& keyFrames, float progress, Property::Value& value,
48                            const std::string& alphaFunction);
49
50
51 /**
52  * Animation helper functions for Emscripten.
53  *
54  * Allows string property names without function overloading which is unavailable with Javascript
55  *
56  * @param[in] self The animation
57  * @param[in] handle The handle to animate
58  * @param[in] property The property name to animate
59  * @param[in] alphaFunction The alpha function
60  * @param[in] delay The animation delay
61  * @param[in] duration The animation duration
62  *
63  */
64 void AnimateTo(Dali::Animation& self,
65                Dali::Handle& handle,
66                const std::string& property,
67                const Dali::Property::Value& destinationValue,
68                const Dali::AlphaFunction::BuiltinFunction& alphaFunction,
69                const float delay,
70                const float duration);
71
72 /**
73  * AnimateBy helper
74  *
75  * Allows string property names without function overloading which is unavailable with Javascript
76  *
77  * @param[in] self The animation
78  * @param[in] handle The handle to animate
79  * @param[in] property The property name to animate
80  * @param[in] alphaFunction The alpha function
81  * @param[in] delay The animation delay
82  * @param[in] duration The animation duration
83  */
84 void AnimateBy(Dali::Animation& self,
85                Dali::Handle& handle,
86                const std::string& property,
87                const Dali::Property::Value& destinationValue,
88                const Dali::AlphaFunction::BuiltinFunction& alphaFunction,
89                const float delay,
90                const float duration);
91
92 /**
93  * AnimateBetween helper
94  *
95  * Allows string property names without function overloading which is unavailable with Javascript
96  *
97  * @param[in] self The animation
98  * @param[in] handle The handle to animate
99  * @param[in] property The property name to animate
100  * @param[in] alphaFunction The alpha function
101  * @param[in] delay The animation delay
102  * @param[in] duration The animation duration
103  */
104 void AnimateBetween(Dali::Animation& self,
105                     Dali::Handle& handle,
106                     const std::string& property,
107                     Dali::KeyFrames& keyFrames,
108                     const Dali::AlphaFunction::BuiltinFunction& alphaFunction,
109                     const float delay,
110                     const float duration,
111                     const Dali::Animation::Interpolation& interpolation);
112
113 /**
114  * AnimatePath helper (see AnimateTo docs above)
115  *
116  * Allows string property names without function overloading which is unavailable with Javascript
117  *
118  * @param[in] self The animation
119  * @param[in] target The handle to animate
120  * @param[in] path The dali Path
121  * @param[in] forward The path animation forward vector
122  * @param[in] delay The animation delay
123  * @param[in] duration The animation duration
124  */
125 void AnimatePath(Dali::Animation& self,
126                  Dali::Handle& target,
127                  const Dali::Path& path,
128                  const Dali::Vector3& forward,
129                  const Dali::AlphaFunction::BuiltinFunction& alphaFunction,
130                  const float delay,
131                  const float duration);
132
133 }; // namespace Emscripten
134 }; // namespace Internal
135 }; // namespace Dali
136
137 #endif // header