2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
19 #include <dali-toolkit/public-api/controls/cluster/cluster.h>
23 #include <dali-toolkit/internal/controls/cluster/cluster-impl.h>
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////////////////////////////
35 const std::string Cluster::CLUSTER_ACTOR_DEPTH( "cluster-actor-depth" );
37 const char* const Cluster::ACTION_EXPAND = "expand";
38 const char* const Cluster::ACTION_COLLAPSE = "collapse";
39 const char* const Cluster::ACTION_TRANSFORM = "transform";
45 Cluster::Cluster(const Cluster& cluster)
50 Cluster& Cluster::operator =(const Cluster& cluster)
52 if( &cluster != this )
54 Control::operator=( cluster );
63 Cluster Cluster::New( ClusterStyle& style )
65 return Internal::Cluster::New(style);
68 Cluster Cluster::DownCast( BaseHandle handle )
70 return Control::DownCast<Cluster, Internal::Cluster>(handle);
73 void Cluster::AddChild( Actor child )
75 GetImpl(*this).AddChild( child );
78 void Cluster::AddChild( Actor child, unsigned int positionIndex )
80 GetImpl(*this).AddChild( child, positionIndex);
83 void Cluster::AddChildAt( Actor child, unsigned int index )
85 GetImpl(*this).AddChildAt( child, index );
88 void Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index )
90 GetImpl(*this).AddChildAt( child, positionIndex, index );
93 Actor Cluster::GetChildAt( unsigned int index )
95 return GetImpl(*this).GetChildAt(index);
98 Actor Cluster::RemoveChildAt( unsigned int index )
100 return GetImpl(*this).RemoveChildAt(index);
103 void Cluster::ExpandChild( unsigned int index )
105 GetImpl(*this).ExpandChild(index);
108 void Cluster::ExpandAllChildren()
110 GetImpl(*this).ExpandAllChildren();
113 void Cluster::CollapseChild( unsigned int index, bool front )
115 GetImpl(*this).CollapseChild(index, front);
118 void Cluster::CollapseAllChildren( bool front )
120 GetImpl(*this).CollapseAllChildren( front );
123 void Cluster::TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period )
125 GetImpl(*this).TransformChild( index, position, scale, rotation, alpha, period );
128 void Cluster::RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front )
130 GetImpl(*this).RestoreChild( index, alpha, period, front );
133 void Cluster::SetBackgroundImage( Actor image )
135 GetImpl(*this).SetBackgroundImage(image);
138 void Cluster::SetTitle( Actor text )
140 GetImpl(*this).SetTitle(text);
143 void Cluster::SetStyle(ClusterStyle style)
145 GetImpl(*this).SetStyle(style);
148 ClusterStyle Cluster::GetStyle() const
150 return GetImpl(*this).GetStyle();
153 unsigned int Cluster::GetExpandedCount() const
155 return GetImpl(*this).GetExpandedCount();
158 unsigned int Cluster::GetTotalCount() const
160 return GetImpl(*this).GetTotalCount();
163 Cluster::Cluster( Internal::Cluster& impl )
168 Cluster::Cluster( Dali::Internal::CustomActor* internal )
169 : Control( internal )
171 VerifyCustomActorPointer<Internal::Cluster>(internal);
174 } // namespace Toolkit