Merge "Prevent API generate warning log" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / animation / animation.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/animation/animation.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/animation/alpha-function.h>
23 #include <dali/public-api/animation/time-period.h>
24 #include <dali/internal/event/actors/actor-impl.h>
25 #include <dali/internal/event/animation/animation-impl.h>
26
27 namespace Dali
28 {
29
30 Animation::Animation()
31 {
32 }
33
34 Animation::Animation(Internal::Animation* animation)
35 : BaseHandle(animation)
36 {
37 }
38
39 Animation Animation::New(float durationSeconds)
40 {
41   Internal::AnimationPtr internal = Dali::Internal::Animation::New(durationSeconds);
42
43   return Animation(internal.Get());
44 }
45
46 Animation Animation::DownCast( BaseHandle handle )
47 {
48   return Animation( dynamic_cast<Dali::Internal::Animation*>(handle.GetObjectPtr()) );
49 }
50
51 Animation::~Animation()
52 {
53 }
54
55 Animation::Animation(const Animation& handle)
56 : BaseHandle(handle)
57 {
58 }
59
60 Animation& Animation::operator=(const Animation& rhs)
61 {
62   BaseHandle::operator=(rhs);
63   return *this;
64 }
65
66 void Animation::SetDuration(float durationSeconds)
67 {
68   GetImplementation(*this).SetDuration(durationSeconds);
69 }
70
71 float Animation::GetDuration() const
72 {
73   return GetImplementation(*this).GetDuration();
74 }
75
76 void Animation::SetLooping(bool looping)
77 {
78   GetImplementation(*this).SetLooping(looping);
79 }
80
81 void Animation::SetLoopCount(int count)
82 {
83   GetImplementation(*this).SetLoopCount(count);
84 }
85
86 int Animation::GetLoopCount()
87 {
88   return GetImplementation(*this).GetLoopCount();
89 }
90
91 int Animation::GetCurrentLoop()
92 {
93   return GetImplementation(*this).GetCurrentLoop();
94 }
95
96 bool Animation::IsLooping() const
97 {
98   return GetImplementation(*this).IsLooping();
99 }
100
101 void Animation::SetEndAction(Dali::Animation::EndAction endAction)
102 {
103   GetImplementation(*this).SetEndAction(endAction);
104 }
105
106 Dali::Animation::EndAction Animation::GetEndAction() const
107 {
108   return GetImplementation(*this).GetEndAction();
109 }
110
111 void Animation::SetDisconnectAction( Animation::EndAction disconnectAction )
112 {
113   GetImplementation(*this).SetDisconnectAction( disconnectAction );
114 }
115
116 Animation::EndAction Animation::GetDisconnectAction() const
117 {
118   return GetImplementation(*this).GetDisconnectAction();
119 }
120
121 void Animation::SetDefaultAlphaFunction(AlphaFunction alpha)
122 {
123   GetImplementation(*this).SetDefaultAlphaFunction(alpha);
124 }
125
126 AlphaFunction Animation::GetDefaultAlphaFunction() const
127 {
128   return GetImplementation(*this).GetDefaultAlphaFunction();
129 }
130
131 void Animation::Play()
132 {
133   GetImplementation(*this).Play();
134 }
135
136 void Animation::PlayFrom(float progress)
137 {
138   GetImplementation(*this).PlayFrom(progress);
139 }
140
141
142 void Animation::Pause()
143 {
144   GetImplementation(*this).Pause();
145 }
146
147 Dali::Animation::State Animation::GetState() const
148 {
149   return GetImplementation(*this).GetState();
150 }
151
152 void Animation::Stop()
153 {
154   GetImplementation(*this).Stop();
155 }
156
157 void Animation::Clear()
158 {
159   GetImplementation(*this).Clear();
160 }
161
162 Animation::AnimationSignalType& Animation::FinishedSignal()
163 {
164   return GetImplementation(*this).FinishedSignal();
165 }
166
167 void Animation::AnimateBy(Property target, Property::Value relativeValue)
168 {
169   GetImplementation(*this).AnimateBy(target, relativeValue);
170 }
171
172 void Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha)
173 {
174   GetImplementation(*this).AnimateBy(target, relativeValue, alpha);
175 }
176
177 void Animation::AnimateBy(Property target, Property::Value relativeValue, TimePeriod period)
178 {
179   GetImplementation(*this).AnimateBy(target, relativeValue, period);
180 }
181
182 void Animation::AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period)
183 {
184   GetImplementation(*this).AnimateBy(target, relativeValue, alpha, period);
185 }
186
187 void Animation::AnimateTo(Property target, Property::Value destinationValue)
188 {
189   GetImplementation(*this).AnimateTo(target, destinationValue);
190 }
191
192 void Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha)
193 {
194   GetImplementation(*this).AnimateTo(target, destinationValue, alpha);
195 }
196
197 void Animation::AnimateTo(Property target, Property::Value destinationValue, TimePeriod period)
198 {
199   GetImplementation(*this).AnimateTo(target, destinationValue, period);
200 }
201
202 void Animation::AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period)
203 {
204   GetImplementation(*this).AnimateTo(target, destinationValue, alpha, period);
205 }
206
207 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames )
208 {
209   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames) );
210 }
211
212 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation)
213 {
214   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), interpolation );
215 }
216
217 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period)
218 {
219   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period);
220 }
221
222 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
223 {
224   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period, interpolation );
225 }
226
227 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha)
228 {
229   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha);
230 }
231
232 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
233 {
234   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, interpolation);
235 }
236
237
238 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
239 {
240   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period);
241 }
242
243 void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
244 {
245   GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period, interpolation);
246 }
247
248
249 // Actor specific animations
250
251 void Animation::Animate( Actor actor, Path path, const Vector3& forward )
252 {
253   GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward );
254 }
255
256 void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha )
257 {
258   GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha );
259 }
260
261 void Animation::Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period )
262 {
263   GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, period);
264 }
265
266 void Animation::Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period)
267 {
268   GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha, period );
269 }
270
271 void Animation::Show(Actor actor, float delaySeconds)
272 {
273   GetImplementation(*this).Show(GetImplementation(actor), delaySeconds);
274 }
275
276 void Animation::Hide(Actor actor, float delaySeconds)
277 {
278   GetImplementation(*this).Hide(GetImplementation(actor), delaySeconds);
279 }
280
281 void Animation::SetCurrentProgress( float progress )
282 {
283   return GetImplementation(*this).SetCurrentProgress( progress );
284 }
285
286 float Animation::GetCurrentProgress()
287 {
288   return GetImplementation(*this).GetCurrentProgress();
289 }
290
291 void Animation::SetSpeedFactor( float factor )
292 {
293   GetImplementation(*this).SetSpeedFactor( factor );
294 }
295
296 float Animation::GetSpeedFactor() const
297 {
298   return GetImplementation(*this).GetSpeedFactor();
299 }
300
301 void Animation::SetPlayRange( const Vector2& range )
302 {
303   GetImplementation(*this).SetPlayRange(range);
304 }
305
306 Vector2 Animation::GetPlayRange() const
307 {
308   return GetImplementation(*this).GetPlayRange();
309 }
310
311 } // namespace Dali