1 #ifndef DALI_TOOLKIT_INTERNAL_TRANSITION_H
2 #define DALI_TOOLKIT_INTERNAL_TRANSITION_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali-toolkit/internal/transition/transition-base-impl.h>
23 #include <dali-toolkit/public-api/controls/control.h>
24 #include <dali-toolkit/public-api/transition/transition.h>
27 #include <dali/public-api/object/weak-handle.h>
35 using TransitionPtr = IntrusivePtr<Transition>;
37 class Transition : public TransitionBase
41 * @brief Create a new Transition object.
42 * @param[in] source A source control of this transition.
43 * @param[in] destination A destination control of this transition.
44 * @param[in] timePeriod The timePeriod of the animation.
45 * @return A smart-pointer to the newly allocated Transition.
47 static TransitionPtr New(Dali::Toolkit::Control source, Dali::Toolkit::Control destination, TimePeriod timePeriod);
51 * @copydoc Dali::Toolkit::Transition::OnPlay()
53 void OnPlay() override;
56 * @brief Emit the Finished signal
58 void OnFinished() override;
62 * @brief Construct a new Transition.
64 Transition(Dali::Toolkit::Control source,
65 Dali::Toolkit::Control destination,
66 TimePeriod timePeriod);
69 * @brief A reference counted object may only be deleted by calling Unreference()
71 ~Transition() override;
75 Transition(const Transition&);
78 Transition& operator=(const Transition& rhs);
81 WeakHandle<Dali::Toolkit::Control> mSourceControl;
82 WeakHandle<Dali::Toolkit::Control> mDestinationControl;
85 } // namespace Internal
87 // Helpers for public-api forwarding methods
89 inline Internal::Transition& GetImplementation(Dali::Toolkit::Transition& transition)
91 DALI_ASSERT_ALWAYS(transition && "Transition handle is empty");
93 BaseObject& handle = transition.GetBaseObject();
95 return static_cast<Internal::Transition&>(handle);
98 inline const Internal::Transition& GetImplementation(const Dali::Toolkit::Transition& transition)
100 DALI_ASSERT_ALWAYS(transition && "Transition handle is empty");
102 const BaseObject& handle = transition.GetBaseObject();
104 return static_cast<const Internal::Transition&>(handle);
107 } // namespace Toolkit
111 #endif // DALI_TOOLKIT_INTERNAL_TRANSITION_H