1 #ifndef DALI_TOOLKIT_TRANSITION_BASE_H
2 #define DALI_TOOLKIT_TRANSITION_BASE_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/dali-toolkit-common.h>
25 #include <dali/public-api/animation/alpha-function.h>
26 #include <dali/public-api/animation/time-period.h>
27 #include <dali/public-api/object/base-handle.h>
33 namespace Internal DALI_INTERNAL
41 * Transition provides continuous and seamless motions for the visually plausible scene change.
42 * And, TransitionBase is a base class for every Transition cases.
44 class DALI_TOOLKIT_API TransitionBase : public BaseHandle
48 * @brief Creates an uninitialized TransitionBase; this can be initialized with TransitionBase::New().
50 * Calling member functions with an uninitialized TransitionBase handle is not allowed.
55 * @brief Creates an initialized TransitionBase.
57 static TransitionBase New();
60 * @brief Downcasts a handle to TransitionBase handle.
62 * If handle points to an TransitionBase object, the downcast produces valid handle.
63 * If not, the returned handle is left uninitialized.
65 * @param[in] handle Handle to an object
66 * @return Handle to an TransitionBase object or an uninitialized handle
68 static TransitionBase DownCast(BaseHandle handle);
73 * This is non-virtual since derived Handle types must not contain data or virtual methods.
78 * @brief This copy constructor is required for (smart) pointer semantics.
80 * @param[in] handle A reference to the copied handle
82 TransitionBase(const TransitionBase& handle);
85 * @brief This assignment operator is required for (smart) pointer semantics.
87 * @param[in] rhs A reference to the copied handle
88 * @return A reference to this
90 TransitionBase& operator=(const TransitionBase& rhs);
93 * @brief Move constructor.
95 * @param[in] rhs A reference to the moved handle
97 TransitionBase(TransitionBase&& rhs);
100 * @brief Move assignment operator.
102 * @param[in] rhs A reference to the moved handle
103 * @return A reference to this handle
105 TransitionBase& operator=(TransitionBase&& rhs);
108 * Set time period that contains delay and duration
109 * @param[in] timePeriod The time period for an animator.
111 void SetTimePeriod(TimePeriod timePeriod);
114 * Get time period that contains delay and duration
116 TimePeriod GetTimePeriod() const;
119 * @brief Sets the alpha function for an transition.
121 * This is applied to individual property transitions, if no further alpha functions are supplied.
122 * @param[in] alpha The alpha function
124 void SetAlphaFunction(AlphaFunction alpha);
127 * @brief Retrieves the alpha function for an transition.
129 * @return The alpha function
131 AlphaFunction GetAlphaFunction() const;
134 * @brief A View could be transition with its child Views or without them.
136 void TransitionWithChild(bool transitionWithChild);
138 public: // Not intended for use by Application developers
141 * @brief This constructor is used by TransitionBase::New() methods.
142 * @param[in] transitionBase A pointer to a newly allocated Dali resource
144 explicit DALI_INTERNAL TransitionBase(Internal::TransitionBase* transitionBase);
148 } // namespace Toolkit
152 #endif // DALI_TOOLKIT_TRANSITION_BASE_H