1 #ifndef DALI_TOOLKIT_FADE_H
2 #define DALI_TOOLKIT_FADE_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
35 * @brief Fade provides smoothly appearing/disappearing effects for target Control.
37 class DALI_TOOLKIT_API Fade : public TransitionBase
41 * @brief Creates an uninitialized Fade; this can be initialized with Fade::New().
43 * Calling member functions with an uninitialized Fade handle is not allowed.
48 * @brief Creates an initialized Fade.
50 * @param[in] control A control of this transition.
51 * @param[in] opacity opacity value the control Opacity property will be changed from/to. Opacity must be between [0, 1].
52 * @param[in] timePeriod The duration of the animation.
53 * @return A handle to a newly allocated Dali resource
55 static Fade New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
58 * @brief Downcasts a handle to Fade handle.
60 * If handle points to an Fade object, the downcast produces valid handle.
61 * If not, the returned handle is left uninitialized.
63 * @param[in] handle Handle to an object
64 * @return Handle to an Fade object or an uninitialized handle
66 static Fade DownCast(BaseHandle handle);
71 * This is non-virtual since derived Handle types must not contain data or virtual methods.
76 * @brief This copy constructor is required for (smart) pointer semantics.
78 * @param[in] handle A reference to the copied handle
80 Fade(const Fade& handle);
83 * @brief This assignment operator is required for (smart) pointer semantics.
85 * @param[in] rhs A reference to the copied handle
86 * @return A reference to this
88 Fade& operator=(const Fade& rhs);
91 * @brief Move constructor.
93 * @param[in] rhs A reference to the moved handle
98 * @brief Move assignment operator.
100 * @param[in] rhs A reference to the moved handle
101 * @return A reference to this handle
103 Fade& operator=(Fade&& rhs);
105 public: // Not intended for use by Application developers
108 * @brief This constructor is used by Fade::New() methods.
109 * @param[in] fade A pointer to a newly allocated Dali resource
111 explicit DALI_INTERNAL Fade(Internal::Fade* fade);
115 } // namespace Toolkit
119 #endif // DALI_TOOLKIT_FADE_H