1 #ifndef __DALI_TOOLKIT_CLUSTER_STYLE_H__
2 #define __DALI_TOOLKIT_CLUSTER_STYLE_H__
5 * Copyright (c) 2015 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/actors/actor.h>
23 #include <dali/public-api/animation/alpha-functions.h>
24 #include <dali/public-api/animation/time-period.h>
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/base-handle.h>
29 #include <dali-toolkit/public-api/enums.h>
39 namespace Internal DALI_INTERNAL
42 class ClusterStyleRandom;
47 typedef IntrusivePtr<ClusterStyle> ClusterStylePtr; ///< Pointer to a Dali::Toolkit::ClusterStyle object
50 * @brief A ClusterStyle describes the constraints which are imposed on the child actors in the cluster.
52 class DALI_IMPORT_API ClusterStyle : public Dali::BaseHandle
56 static const unsigned int UNLIMITED_CHILDREN; ///< Constant that represents an unlimited number of children.
63 * This is non-virtual since derived Handle types must not contain data or virtual methods.
68 * @brief Query the maximum number of children this Style can handle.
70 * If return value is UNLIMITED_CHILDREN, then this style has no
72 * @return The maximum number of children.
74 unsigned int GetMaximumNumberOfChildren() const;
77 * @brief Applies style (position) to child actor over a specified time duration.
79 * @param[in] child The child actor to apply
80 * @param[in] index The style position index for the actor to transform to.
81 * @param[in] alpha The alpha function to use.
82 * @param[in] durationSeconds The time period to apply this style.
84 void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
87 * @brief Applies style to background actor over a specified time duration.
89 * @param[in] background The background actor to apply
90 * @param[in] alpha The alpha function to use.
91 * @param[in] durationSeconds The time period to apply this style.
93 void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
96 * @brief Applies style to title actor over a specified time duration.
98 * @param[in] title The title actor to apply
99 * @param[in] alpha The alpha function to use.
100 * @param[in] durationSeconds The time period to apply this style.
102 void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
107 * @brief Create a new ClusterStyle; Only derived versions are instantiatable.
111 public: // Not intended for application developers
114 * @brief This constructor is used by Dali New() methods.
116 * @param [in] internal A pointer to a newly allocated Dali resource
118 explicit DALI_INTERNAL ClusterStyle(Internal::ClusterStyle* internal);
122 * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
124 class DALI_IMPORT_API ClusterStyleStandard : public ClusterStyle
129 * @brief Cluster Style type.
133 ClusterStyle1, ///< Style number 1
134 ClusterStyle2, ///< Style number 2
135 ClusterStyle3, ///< Style number 3
136 ClusterStyle4, ///< Style number 4
137 TotalClusterStyles ///< The number of styles
143 * @brief Create an initialized style.
145 static ClusterStyleStandard New(StyleType style);
147 public: // Not intended for application developers
150 * @brief This constructor is used by Dali New() methods.
152 * @param [in] internal A pointer to a newly allocated Dali resource
154 explicit DALI_INTERNAL ClusterStyleStandard(Internal::ClusterStyle* internal);
158 * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
160 class DALI_IMPORT_API ClusterStyleRandom : public ClusterStyle
165 * @brief Create an initialized style.
167 static ClusterStyleRandom New();
169 public: // Not intended for application developers
172 * @brief This constructor is used by Dali New() methods.
174 * @param [in] internal A pointer to a newly allocated Dali resource
176 explicit DALI_INTERNAL ClusterStyleRandom(Internal::ClusterStyle* internal);
179 } // namespace Toolkit
183 #endif // __DALI_TOOLKIT_CLUSTER_STYLE_H__