1 #ifndef __DALI_TOOLKIT_CLUSTER_STYLE_H__
2 #define __DALI_TOOLKIT_CLUSTER_STYLE_H__
5 * Copyright (c) 2014 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 * @addtogroup CAPI_DALI_TOOLKIT_CLUSTER_MODULE
27 #include <dali/dali.h>
28 #include <dali-toolkit/public-api/enums.h>
30 namespace Dali DALI_IMPORT_API
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 ClusterStyle : public Dali::BaseHandle
56 static const unsigned int UNLIMITED_CHILDREN; ///< Constant that represents an unlimited number of children.
61 * @brief Virtual destructor.
63 virtual ~ClusterStyle();
66 * @brief Query the maximum number of children this Style can handle.
68 * If return value is UNLIMITED_CHILDREN, then this style has no
70 * @return The maximum number of children.
72 unsigned int GetMaximumNumberOfChildren() const;
75 * @brief Applies style (position) to child actor over a specified time duration.
77 * @param[in] child The child actor to apply
78 * @param[in] index The style position index for the actor to transform to.
79 * @param[in] alpha The alpha function to use.
80 * @param[in] durationSeconds The time period to apply this style.
82 void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
85 * @brief Applies style to background actor over a specified time duration.
87 * @param[in] background The background actor to apply
88 * @param[in] alpha The alpha function to use.
89 * @param[in] durationSeconds The time period to apply this style.
91 void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
94 * @brief Applies style to title actor over a specified time duration.
96 * @param[in] title The title actor to apply
97 * @param[in] alpha The alpha function to use.
98 * @param[in] durationSeconds The time period to apply this style.
100 void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
105 * @brief Create a new ClusterStyle; Only derived versions are instantiatable.
109 public: // Not intended for application developers
112 * @brief This constructor is used by Dali New() methods.
114 * @param [in] internal A pointer to a newly allocated Dali resource
116 ClusterStyle(Internal::ClusterStyle* internal);
120 * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
122 class ClusterStyleStandard : public ClusterStyle
127 * @brief Cluster Style type.
131 ClusterStyle1, ///< Style number 1
132 ClusterStyle2, ///< Style number 2
133 ClusterStyle3, ///< Style number 3
134 ClusterStyle4, ///< Style number 4
135 TotalClusterStyles ///< The number of styles
141 * @brief Create an initialized style.
143 static ClusterStyleStandard New(StyleType style);
145 public: // Not intended for application developers
148 * @brief This constructor is used by Dali New() methods.
150 * @param [in] internal A pointer to a newly allocated Dali resource
152 ClusterStyleStandard(Internal::ClusterStyle* internal);
156 * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
158 class ClusterStyleRandom : public ClusterStyle
163 * @brief Create an initialized style.
165 static ClusterStyleRandom New();
167 public: // Not intended for application developers
170 * @brief This constructor is used by Dali New() methods.
172 * @param [in] internal A pointer to a newly allocated Dali resource
174 ClusterStyleRandom(Internal::ClusterStyle* internal);
177 } // namespace Toolkit
184 #endif // __DALI_TOOLKIT_CLUSTER_STYLE_H__