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 Flora License, Version 1.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://floralicense.org/license/
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.
21 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali/dali.h>
27 #include <dali-toolkit/public-api/enums.h>
29 namespace Dali DALI_IMPORT_API
38 namespace Internal DALI_INTERNAL
41 class ClusterStyleRandom;
46 typedef IntrusivePtr<ClusterStyle> ClusterStylePtr;
49 * A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
51 class ClusterStyle : public Dali::BaseHandle
55 static const unsigned int UNLIMITED_CHILDREN;
62 virtual ~ClusterStyle();
65 * Query the maximum number of children this Style can handle.
66 * If return value is UNLIMITED_CHILDREN, then this style has no
68 * @return The maximum number of children.
70 unsigned int GetMaximumNumberOfChildren() const;
73 * Applies style (position) to child actor over a specified time duration.
75 * @param[in] child The child actor to apply
76 * @param[in] index The style position index for the actor to transform to.
77 * @param[in] alpha The alpha function to use.
78 * @param[in] durationSeconds The time period to apply this style.
80 void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
83 * Applies style to background actor over a specified time duration.
84 * @param[in] background The background actor to apply
85 * @param[in] alpha The alpha function to use.
86 * @param[in] durationSeconds The time period to apply this style.
88 void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
91 * Applies style to title actor over a specified time duration.
92 * @param[in] title The title actor to apply
93 * @param[in] alpha The alpha function to use.
94 * @param[in] durationSeconds The time period to apply this style.
96 void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
101 * Create a new ClusterStyle; Only derived versions are instantiatable.
105 public: // Not intended for application developers
108 * This constructor is used by Dali New() methods
109 * @param [in] internal A pointer to a newly allocated Dali resource
111 ClusterStyle(Internal::ClusterStyle* internal);
115 * A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
117 class ClusterStyleStandard : public ClusterStyle
133 * Create an initialized style
135 static ClusterStyleStandard New(StyleType style);
137 public: // Not intended for application developers
140 * This constructor is used by Dali New() methods
141 * @param [in] internal A pointer to a newly allocated Dali resource
143 ClusterStyleStandard(Internal::ClusterStyle* internal);
147 * A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
149 class ClusterStyleRandom : public ClusterStyle
154 * Create an initialized style
156 static ClusterStyleRandom New();
158 public: // Not intended for application developers
161 * This constructor is used by Dali New() methods
162 * @param [in] internal A pointer to a newly allocated Dali resource
164 ClusterStyleRandom(Internal::ClusterStyle* internal);
167 } // namespace Toolkit
174 #endif // __DALI_TOOLKIT_CLUSTER_STYLE_H__