1 #ifndef __DALI_TOOLKIT_TRANSITION_DATA_H__
2 #define __DALI_TOOLKIT_TRANSITION_DATA_H__
5 * Copyright (c) 2016 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>
39 * @brief This object translates data from a property array of maps
40 * into an array of animators.
42 * Each animator describes a named object and a named property of that object
43 * to be animated. Internally, these are translated into object instances and
44 * property indices to be animated.
45 * @see Dali::Toolkit::Internal::Control::CreateTransition()
47 * The animators can each be retrieved as a Property::Map by using Count() and
50 * In psuedo-JSON, the property array can be represented as follows:
54 * "target": "objectName",
55 * "property": "propertyKey",
56 * "initialValue": <value>, # The property value can be one of several types
57 * "targetValue": <value>,
59 * "alphaFunction":<easing-function>",
70 class DALI_IMPORT_API TransitionData : public BaseHandle
74 * Create an uninitialized handle
81 * Destructor - non virtual
88 * @brief Creates a TransitionData object
91 * @param[in] transition The transition data to store (a single animator)
92 * @return A handle to an initialized data.
94 static TransitionData New( const Property::Map& transition );
97 * @brief Creates a TransitionData object
100 * @param[in] transition The transition data to store (an array of maps of animators)
101 * @return A handle to an initialized data.
103 static TransitionData New( const Property::Array& transition );
106 * @brief Downcast to a TransitionData handle
109 * If handle is not a TransitionData, the returned handle is left uninitialized.
110 * @param[in] handle Handle to an object
111 * @return TransitionData handle or an uninitialized handle.
113 static TransitionData DownCast( BaseHandle handle );
116 * @brief Copy constructor
119 * @param[in] handle Handle to an object
121 TransitionData( const TransitionData& handle );
124 * @brief Assignment Operator
127 * @param[in] handle Handle to an object
128 * @return A reference to this object.
130 TransitionData& operator=( const TransitionData& handle );
133 * @brief returns the count of the individual property transitions
134 * stored within this handle.
137 * @return The count of individual transitions
139 size_t Count() const;
142 * @brief Return the animator at the given index as a property map.
143 * @param[in] index The index of the animator ( Must be less than Count() )
144 * @return A property map representing the animator
146 Property::Map GetAnimatorAt( size_t index );
148 public: // Not intended for application developers
150 explicit DALI_INTERNAL TransitionData( Internal::TransitionData *impl );
153 } // namespace Toolkit
156 #endif // __DALI_TOOLKIT_TRANSITION_DATA_H__