[dali_2.0.50] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / transition / transition.h
1 #ifndef DALI_TOOLKIT_TRANSITION_H
2 #define DALI_TOOLKIT_TRANSITION_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 Transition;
32 }
33
34 /**
35  * @brief
36  *
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.
40  */
41 class DALI_TOOLKIT_API Transition : public TransitionBase
42 {
43 public:
44   /**
45    * @brief Creates an uninitialized Transition; this can be initialized with Transition::New().
46    *
47    * Calling member functions with an uninitialized Transition handle is not allowed.
48    */
49   Transition();
50
51   /**
52    * @brief Creates an initialized Transition.
53    *
54    * @param[in] source A source control of this transition.
55    * @param[in] destination A destination control of this transition.
56    * @param[in] useDestinationTarget True if this transition uses destination control as target.
57    * @param[in] timePeriod The duration in seconds
58    * @return A handle to a newly allocated Dali resource
59    * @note durationSeconds can not be negative.
60    */
61   static Transition New(Dali::Toolkit::Control source, Dali::Toolkit::Control destination, bool useDestinationTarget, TimePeriod timePeriod);
62
63   /**
64    * @brief Downcasts a handle to Transition handle.
65    *
66    * If handle points to an Transition object, the downcast produces valid handle.
67    * If not, the returned handle is left uninitialized.
68    *
69    * @param[in] handle Handle to an object
70    * @return Handle to an Transition object or an uninitialized handle
71    */
72   static Transition DownCast(BaseHandle handle);
73
74   /**
75    * @brief Destructor.
76    *
77    * This is non-virtual since derived Handle types must not contain data or virtual methods.
78    */
79   ~Transition();
80
81   /**
82    * @brief This copy constructor is required for (smart) pointer semantics.
83    *
84    * @param[in] handle A reference to the copied handle
85    */
86   Transition(const Transition& handle);
87
88   /**
89    * @brief This assignment operator is required for (smart) pointer semantics.
90    *
91    * @param[in] rhs A reference to the copied handle
92    * @return A reference to this
93    */
94   Transition& operator=(const Transition& rhs);
95
96   /**
97    * @brief Move constructor.
98    *
99    * @param[in] rhs A reference to the moved handle
100    */
101   Transition(Transition&& rhs);
102
103   /**
104    * @brief Move assignment operator.
105    *
106    * @param[in] rhs A reference to the moved handle
107    * @return A reference to this handle
108    */
109   Transition& operator=(Transition&& rhs);
110
111 public: // Not intended for use by Application developers
112   /// @cond internal
113   /**
114    * @brief This constructor is used by Transition::New() methods.
115    * @param[in] transition A pointer to a newly allocated Dali resource
116    */
117   explicit DALI_INTERNAL Transition(Internal::Transition* transition);
118   /// @endcond
119 };
120
121 } // namespace Toolkit
122
123 } // namespace Dali
124
125 #endif // DALI_TOOLKIT_TRANSITION_H