1 #ifndef DALI_TOOLKIT_TRANSITION_DATA_H
2 #define DALI_TOOLKIT_TRANSITION_DATA_H
5 * Copyright (c) 2020 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/public-api/animation/alpha-function.h>
23 #include <dali/public-api/object/base-handle.h>
24 #include <dali/public-api/object/property-array.h>
25 #include <dali/public-api/object/property-map.h>
28 #include <dali-toolkit/public-api/dali-toolkit-common.h>
40 * @brief This object translates data from a property array of maps
41 * into an array of animators.
43 * Each animator describes a named object and a named property of that object
44 * to be animated. Internally, these are translated into object instances and
45 * property indices to be animated.
46 * @see Dali::Toolkit::Internal::Control::CreateTransition()
48 * The animators can each be retrieved as a Property::Map by using Count() and
51 * In psuedo-JSON, the property array can be represented as follows:
55 * "target": "objectName",
56 * "property": "propertyKey",
57 * "initialValue": <value>, # The property value can be one of several types
58 * "targetValue": <value>,
60 * "alphaFunction":<easing-function>",
71 class DALI_TOOLKIT_API TransitionData : public BaseHandle
75 * Create an uninitialized handle
82 * Destructor - non virtual
89 * @brief Creates a TransitionData object
92 * @param[in] transition The transition data to store (a single animator)
93 * @return A handle to an initialized data.
95 static TransitionData New(const Property::Map& transition);
98 * @brief Creates a TransitionData object
101 * @param[in] transition The transition data to store (an array of maps of animators)
102 * @return A handle to an initialized data.
104 static TransitionData New(const Property::Array& transition);
107 * @brief Downcast to a TransitionData handle
110 * If handle is not a TransitionData, the returned handle is left uninitialized.
111 * @param[in] handle Handle to an object
112 * @return TransitionData handle or an uninitialized handle.
114 static TransitionData DownCast(BaseHandle handle);
117 * @brief Copy constructor
120 * @param[in] handle Handle to an object
122 TransitionData(const TransitionData& handle);
125 * @brief Assignment Operator
128 * @param[in] handle Handle to an object
129 * @return A reference to this object.
131 TransitionData& operator=(const TransitionData& handle);
134 * @brief returns the count of the individual property transitions
135 * stored within this handle.
138 * @return The count of individual transitions
140 size_t Count() const;
143 * @brief Return the animator at the given index as a property map.
144 * @param[in] index The index of the animator ( Must be less than Count() )
145 * @return A property map representing the animator
147 Property::Map GetAnimatorAt(size_t index);
149 public: // Not intended for application developers
150 explicit DALI_INTERNAL TransitionData(Internal::TransitionData* impl);
153 } // namespace Toolkit
156 #endif // DALI_TOOLKIT_TRANSITION_DATA_H