1 #ifndef __DALI_TOOLKIT_TRANSITION_DATA_H__
2 #define __DALI_TOOLKIT_TRANSITION_DATA_H__
5 * Copyright (c) 2018 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/object/base-handle.h>
23 #include <dali/public-api/animation/alpha-function.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>
42 * @brief This object translates data from a property array of maps
43 * into an array of animators.
45 * Each animator describes a named object and a named property of that object
46 * to be animated. Internally, these are translated into object instances and
47 * property indices to be animated.
48 * @see Dali::Toolkit::Internal::Control::CreateTransition()
50 * The animators can each be retrieved as a Property::Map by using Count() and
53 * In psuedo-JSON, the property array can be represented as follows:
57 * "target": "objectName",
58 * "property": "propertyKey",
59 * "initialValue": <value>, # The property value can be one of several types
60 * "targetValue": <value>,
62 * "alphaFunction":<easing-function>",
73 class DALI_TOOLKIT_API TransitionData : public BaseHandle
77 * Create an uninitialized handle
84 * Destructor - non virtual
91 * @brief Creates a TransitionData object
94 * @param[in] transition The transition data to store (a single animator)
95 * @return A handle to an initialized data.
97 static TransitionData New( const Property::Map& transition );
100 * @brief Creates a TransitionData object
103 * @param[in] transition The transition data to store (an array of maps of animators)
104 * @return A handle to an initialized data.
106 static TransitionData New( const Property::Array& transition );
109 * @brief Downcast to a TransitionData handle
112 * If handle is not a TransitionData, the returned handle is left uninitialized.
113 * @param[in] handle Handle to an object
114 * @return TransitionData handle or an uninitialized handle.
116 static TransitionData DownCast( BaseHandle handle );
119 * @brief Copy constructor
122 * @param[in] handle Handle to an object
124 TransitionData( const TransitionData& handle );
127 * @brief Assignment Operator
130 * @param[in] handle Handle to an object
131 * @return A reference to this object.
133 TransitionData& operator=( const TransitionData& handle );
136 * @brief returns the count of the individual property transitions
137 * stored within this handle.
140 * @return The count of individual transitions
142 size_t Count() const;
145 * @brief Return the animator at the given index as a property map.
146 * @param[in] index The index of the animator ( Must be less than Count() )
147 * @return A property map representing the animator
149 Property::Map GetAnimatorAt( size_t index );
151 public: // Not intended for application developers
153 explicit DALI_INTERNAL TransitionData( Internal::TransitionData *impl );
156 } // namespace Toolkit
159 #endif // __DALI_TOOLKIT_TRANSITION_DATA_H__