Merge "Change MatchSystemLanguageDirection is true." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / transition / transition-base.h
1 #ifndef DALI_TOOLKIT_TRANSITION_BASE_H
2 #define DALI_TOOLKIT_TRANSITION_BASE_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/dali-toolkit-common.h>
23
24 // EXTERNAL INCLUDES
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>
28
29 namespace Dali
30 {
31 namespace Toolkit
32 {
33 namespace Internal DALI_INTERNAL
34 {
35 class TransitionBase;
36 }
37
38 /**
39  * @brief
40  *
41  * Transition provides continuous and seamless motions for the visually plausible scene change.
42  * And, TransitionBase is a base class for every Transition cases.
43  */
44 class DALI_TOOLKIT_API TransitionBase : public BaseHandle
45 {
46 public:
47   /**
48    * @brief Creates an uninitialized TransitionBase; this can be initialized with TransitionBase::New().
49    *
50    * Calling member functions with an uninitialized TransitionBase handle is not allowed.
51    */
52   TransitionBase();
53
54   /**
55    * @brief Creates an initialized TransitionBase.
56    */
57   static TransitionBase New();
58
59   /**
60    * @brief Downcasts a handle to TransitionBase handle.
61    *
62    * If handle points to an TransitionBase object, the downcast produces valid handle.
63    * If not, the returned handle is left uninitialized.
64    *
65    * @param[in] handle Handle to an object
66    * @return Handle to an TransitionBase object or an uninitialized handle
67    */
68   static TransitionBase DownCast(BaseHandle handle);
69
70   /**
71    * @brief Destructor.
72    *
73    * This is non-virtual since derived Handle types must not contain data or virtual methods.
74    */
75   ~TransitionBase();
76
77   /**
78    * @brief This copy constructor is required for (smart) pointer semantics.
79    *
80    * @param[in] handle A reference to the copied handle
81    */
82   TransitionBase(const TransitionBase& handle);
83
84   /**
85    * @brief This assignment operator is required for (smart) pointer semantics.
86    *
87    * @param[in] rhs A reference to the copied handle
88    * @return A reference to this
89    */
90   TransitionBase& operator=(const TransitionBase& rhs);
91
92   /**
93    * @brief Move constructor.
94    *
95    * @param[in] rhs A reference to the moved handle
96    */
97   TransitionBase(TransitionBase&& rhs);
98
99   /**
100    * @brief Move assignment operator.
101    *
102    * @param[in] rhs A reference to the moved handle
103    * @return A reference to this handle
104    */
105   TransitionBase& operator=(TransitionBase&& rhs);
106
107   /**
108    * Set time period that contains delay and duration
109    * @param[in] timePeriod The time period for an animator.
110    */
111   void SetTimePeriod(TimePeriod timePeriod);
112
113   /**
114    * Get time period that contains delay and duration
115    */
116   TimePeriod GetTimePeriod() const;
117
118   /**
119    * @brief Sets the alpha function for an transition.
120    *
121    * This is applied to individual property transitions, if no further alpha functions are supplied.
122    * @param[in] alpha The alpha function
123    */
124   void SetAlphaFunction(AlphaFunction alpha);
125
126   /**
127    * @brief Retrieves the alpha function for an transition.
128    *
129    * @return The alpha function
130    */
131   AlphaFunction GetAlphaFunction() const;
132
133   /**
134    * @brief A Control could be transition with its child Controls or without them.
135    * @param[in] transitionWithChild True if the Control is transitioned with children.
136    */
137   void TransitionWithChild(bool transitionWithChild);
138
139   /**
140    * @brief Set this transition is appearing transition or not.
141    * @param[in] appearingTransition True if this transition is appearing transition.
142    */
143   void SetAppearingTransition(bool appearingTransition);
144
145 public: // Not intended for use by Application developers
146   /// @cond internal
147   /**
148    * @brief This constructor is used by TransitionBase::New() methods.
149    * @param[in] transitionBase A pointer to a newly allocated Dali resource
150    */
151   explicit DALI_INTERNAL TransitionBase(Internal::TransitionBase* transitionBase);
152   /// @endcond
153 };
154
155 } // namespace Toolkit
156
157 } // namespace Dali
158
159 #endif // DALI_TOOLKIT_TRANSITION_BASE_H