[Tizen] Adds transition effect
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / transition / transition-base.cpp
1 /*
2  * Copyright (c) 2021 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-toolkit/public-api/transition/transition-base.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/transition/transition-base-impl.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 TransitionBase::TransitionBase() = default;
29
30 TransitionBase::TransitionBase(Internal::TransitionBase* transitionBase)
31 : BaseHandle(transitionBase)
32 {
33 }
34
35 TransitionBase TransitionBase::New()
36 {
37   Internal::TransitionBasePtr internal = Dali::Toolkit::Internal::TransitionBase::New();
38
39   return TransitionBase(internal.Get());
40 }
41
42 TransitionBase TransitionBase::DownCast(BaseHandle handle)
43 {
44   return TransitionBase(dynamic_cast<Dali::Toolkit::Internal::TransitionBase*>(handle.GetObjectPtr()));
45 }
46
47 TransitionBase::~TransitionBase() = default;
48
49 TransitionBase::TransitionBase(const TransitionBase& handle) = default;
50
51 TransitionBase& TransitionBase::operator=(const TransitionBase& rhs) = default;
52
53 TransitionBase::TransitionBase(TransitionBase&& rhs) = default;
54
55 TransitionBase& TransitionBase::operator=(TransitionBase&& rhs) = default;
56
57 void TransitionBase::SetDuration(float seconds)
58 {
59   GetImplementation(*this).SetDuration(seconds);
60 }
61
62 float TransitionBase::GetDuration() const
63 {
64   return GetImplementation(*this).GetDuration();
65 }
66
67 void TransitionBase::SetDelay(float seconds)
68 {
69   GetImplementation(*this).SetDelay(seconds);
70 }
71
72 float TransitionBase::GetDelay() const
73 {
74   return GetImplementation(*this).GetDelay();
75 }
76
77 void TransitionBase::SetTimePeriod(TimePeriod timePeriod)
78 {
79   GetImplementation(*this).SetTimePeriod(timePeriod);
80 }
81
82 void TransitionBase::SetAlphaFunction(AlphaFunction alphaFunction)
83 {
84   GetImplementation(*this).SetAlphaFunction(alphaFunction);
85 }
86
87 AlphaFunction TransitionBase::GetAlphaFunction() const
88 {
89   return GetImplementation(*this).GetAlphaFunction();
90 }
91
92 void TransitionBase::TransitionWithChild(bool transitionWithChild)
93 {
94   return GetImplementation(*this).TransitionWithChild(transitionWithChild);
95 }
96
97 } // namespace Toolkit
98
99 } // namespace Dali