1 #ifndef DALI_TOOLKIT_LAYOUTING_LAYOUT_TRANSITION_DATA_H
2 #define DALI_TOOLKIT_LAYOUTING_LAYOUT_TRANSITION_DATA_H
4 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <dali/public-api/common/dali-common.h>
22 #include <dali/public-api/actors/actor-enumerations.h>
23 #include <dali/public-api/animation/animation.h>
24 #include <dali/public-api/object/base-handle.h>
25 #include <dali/public-api/object/property-index-ranges.h>
26 #include <dali/public-api/object/property-map.h>
27 #include <dali-toolkit/public-api/dali-toolkit-common.h>
36 class LayoutTransitionData;
39 class DALI_TOOLKIT_API LayoutTransitionData final : public BaseHandle
44 * @brief Enumeration for property animator keys belonging to the LayoutTransitionData class.
50 PROPERTY, ///< A property to animate
51 INITIAL_VALUE, ///< Initial value of an animated property
52 TARGET_VALUE, ///< Target value of an animated property
53 ANIMATOR, ///< Animator for an animated property
54 TYPE, ///< Type of an animator
55 NAME, ///< Name of an animator
56 TIME_PERIOD, ///< Time period of an property animation
57 DURATION, ///< Duration of an property animation
58 DELAY, ///< Delay of an property animation
59 ALPHA_FUNCTION, ///< Alpha function of a property animation
63 enum LayoutTransitionType
70 typedef Signal< void (LayoutTransitionData::LayoutTransitionType, LayoutTransitionData&) > LayoutTransitionSignalType; ///< Transition finished signal
73 * Create an uninitialized handle
77 LayoutTransitionData();
80 * Destructor - non virtual
84 ~LayoutTransitionData() = default;
87 * Create an initialized LayoutTransitionData
89 static LayoutTransitionData New();
92 * @brief Downcasts a handle to LayoutTransitionData handle.
94 * If handle points to an LayoutTransitionData object, the downcast produces valid handle.
95 * If not, the returned handle is left uninitialized.
97 * @param[in] handle Handle to an object
98 * @return Handle to an LayoutTransitionData object or an uninitialized handle
100 static LayoutTransitionData DownCast( BaseHandle handle );
103 * @brief Add a property animator for an actor
105 * @param[in] actor An owner of the animated property
106 * @param[in] map The animated property map including animator map
108 void AddPropertyAnimator( Actor actor, Property::Map map );
111 * @brief Add a property animator for an actor
113 * @param[in] actor An owner of the animated property
114 * @param[in] map The properties map
115 * @param[in] keyFrames key frames
116 * @param[in] interpolation An interpolation
118 void AddPropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation );
121 * @brief Add a property animator for an actor
123 * @param[in] actor An owner of the animated property
124 * @param[in] map A properties map
125 * @param[in] path An animation path
126 * @param[in] forward A forward vector for the path
128 void AddPropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward );
131 * @brief Connects to this signal to be notified when a transition animation have finished.
133 * @return A signal object to connect with
135 LayoutTransitionSignalType& FinishedSignal();
140 * @brief This constructor is used by LayoutTransitionData::New() method.
142 * @param[in] layoutTransitonData A pointer to a newly allocated transition data resource
144 DALI_INTERNAL explicit LayoutTransitionData( Internal::LayoutTransitionData* layoutTransitonData );
151 #endif // DALI_TOOLKIT_LAYOUTING_LAYOUT_TRANSITION_DATA_H