Merge "Change MatchSystemLanguageDirection is true." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / transition / fade.h
1 #ifndef DALI_TOOLKIT_FADE_H
2 #define DALI_TOOLKIT_FADE_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23 #include <dali-toolkit/public-api/transition/transition-base.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29 namespace Internal DALI_INTERNAL
30 {
31 class Fade;
32 }
33
34 /**
35  * @brief Fade provides smoothly appearing/disappearing effects for target Control.
36  */
37 class DALI_TOOLKIT_API Fade : public TransitionBase
38 {
39 public:
40   /**
41    * @brief Creates an uninitialized Fade; this can be initialized with Fade::New().
42    *
43    * Calling member functions with an uninitialized Fade handle is not allowed.
44    */
45   Fade();
46
47   /**
48    * @brief Creates an initialized Fade.
49    *
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
54    */
55   static Fade New(Dali::Toolkit::Control control, float opacity, TimePeriod timePeriod);
56
57   /**
58    * @brief Downcasts a handle to Fade handle.
59    *
60    * If handle points to an Fade object, the downcast produces valid handle.
61    * If not, the returned handle is left uninitialized.
62    *
63    * @param[in] handle Handle to an object
64    * @return Handle to an Fade object or an uninitialized handle
65    */
66   static Fade DownCast(BaseHandle handle);
67
68   /**
69    * @brief Destructor.
70    *
71    * This is non-virtual since derived Handle types must not contain data or virtual methods.
72    */
73   ~Fade();
74
75   /**
76    * @brief This copy constructor is required for (smart) pointer semantics.
77    *
78    * @param[in] handle A reference to the copied handle
79    */
80   Fade(const Fade& handle);
81
82   /**
83    * @brief This assignment operator is required for (smart) pointer semantics.
84    *
85    * @param[in] rhs A reference to the copied handle
86    * @return A reference to this
87    */
88   Fade& operator=(const Fade& rhs);
89
90   /**
91    * @brief Move constructor.
92    *
93    * @param[in] rhs A reference to the moved handle
94    */
95   Fade(Fade&& rhs);
96
97   /**
98    * @brief Move assignment operator.
99    *
100    * @param[in] rhs A reference to the moved handle
101    * @return A reference to this handle
102    */
103   Fade& operator=(Fade&& rhs);
104
105 public: // Not intended for use by Application developers
106   /// @cond internal
107   /**
108    * @brief This constructor is used by Fade::New() methods.
109    * @param[in] fade A pointer to a newly allocated Dali resource
110    */
111   explicit DALI_INTERNAL Fade(Internal::Fade* fade);
112   /// @endcond
113 };
114
115 } // namespace Toolkit
116
117 } // namespace Dali
118
119 #endif // DALI_TOOLKIT_FADE_H