1 #ifndef DALI_TOOLKIT_TRANSITION_H
2 #define DALI_TOOLKIT_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/public-api/controls/control.h>
23 #include <dali-toolkit/public-api/transition/transition-base.h>
29 namespace Internal DALI_INTERNAL
37 * Transition provides continuous and seamless motions between two Controls.
38 * This Transition generates property animation for transforms(position, scale, orientation), size, color, and opacity.
39 * And, if there are common renderer properties of source and destination Control, they also animated.
41 class DALI_TOOLKIT_API Transition : public TransitionBase
45 * @brief Creates an uninitialized Transition; this can be initialized with Transition::New().
47 * Calling member functions with an uninitialized Transition handle is not allowed.
52 * @brief Creates an initialized Transition.
54 * @param[in] source A source control of this transition.
55 * @param[in] destination A destination control of this transition.
56 * @param[in] useDestinationTarget True if this transition uses destination control as target.
57 * @param[in] timePeriod The duration in seconds
58 * @return A handle to a newly allocated Dali resource
59 * @note durationSeconds can not be negative.
61 static Transition New(Dali::Toolkit::Control source, Dali::Toolkit::Control destination, bool useDestinationTarget, TimePeriod timePeriod);
64 * @brief Downcasts a handle to Transition handle.
66 * If handle points to an Transition object, the downcast produces valid handle.
67 * If not, the returned handle is left uninitialized.
69 * @param[in] handle Handle to an object
70 * @return Handle to an Transition object or an uninitialized handle
72 static Transition DownCast(BaseHandle handle);
77 * This is non-virtual since derived Handle types must not contain data or virtual methods.
82 * @brief This copy constructor is required for (smart) pointer semantics.
84 * @param[in] handle A reference to the copied handle
86 Transition(const Transition& handle);
89 * @brief This assignment operator is required for (smart) pointer semantics.
91 * @param[in] rhs A reference to the copied handle
92 * @return A reference to this
94 Transition& operator=(const Transition& rhs);
97 * @brief Move constructor.
99 * @param[in] rhs A reference to the moved handle
101 Transition(Transition&& rhs) noexcept;
104 * @brief Move assignment operator.
106 * @param[in] rhs A reference to the moved handle
107 * @return A reference to this handle
109 Transition& operator=(Transition&& rhs) noexcept;
111 public: // Not intended for use by Application developers
114 * @brief This constructor is used by Transition::New() methods.
115 * @param[in] transition A pointer to a newly allocated Dali resource
117 explicit DALI_INTERNAL Transition(Internal::Transition* transition);
121 } // namespace Toolkit
125 #endif // DALI_TOOLKIT_TRANSITION_H