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 Source
55 * @param[in] destination Destination
56 * @param[in] timePeriod The duration in seconds
57 * @return A handle to a newly allocated Dali resource
58 * @note durationSeconds can not be negative.
60 static Transition New(Dali::Toolkit::Control source, Dali::Toolkit::Control destination, TimePeriod timePeriod);
63 * @brief Downcasts a handle to Transition handle.
65 * If handle points to an Transition object, the downcast produces valid handle.
66 * If not, the returned handle is left uninitialized.
68 * @param[in] handle Handle to an object
69 * @return Handle to an Transition object or an uninitialized handle
71 static Transition DownCast(BaseHandle handle);
76 * This is non-virtual since derived Handle types must not contain data or virtual methods.
81 * @brief This copy constructor is required for (smart) pointer semantics.
83 * @param[in] handle A reference to the copied handle
85 Transition(const Transition& handle);
88 * @brief This assignment operator is required for (smart) pointer semantics.
90 * @param[in] rhs A reference to the copied handle
91 * @return A reference to this
93 Transition& operator=(const Transition& rhs);
96 * @brief Move constructor.
98 * @param[in] rhs A reference to the moved handle
100 Transition(Transition&& rhs);
103 * @brief Move assignment operator.
105 * @param[in] rhs A reference to the moved handle
106 * @return A reference to this handle
108 Transition& operator=(Transition&& rhs);
110 public: // Not intended for use by Application developers
113 * @brief This constructor is used by Transition::New() methods.
114 * @param[in] transition A pointer to a newly allocated Dali resource
116 explicit DALI_INTERNAL Transition(Internal::Transition* transition);
120 } // namespace Toolkit
124 #endif // DALI_TOOLKIT_TRANSITION_H