2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali-toolkit/public-api/controls/cluster/cluster.h>
24 #include <dali-toolkit/internal/controls/cluster/cluster-impl.h>
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////////////////////////////
36 const std::string Cluster::CLUSTER_ACTOR_DEPTH( "cluster-actor-depth" );
38 const char* const Cluster::ACTION_EXPAND = "expand";
39 const char* const Cluster::ACTION_COLLAPSE = "collapse";
40 const char* const Cluster::ACTION_TRANSFORM = "transform";
46 Cluster::Cluster(const Cluster& cluster)
51 Cluster& Cluster::operator =(const Cluster& cluster)
53 if( &cluster != this )
55 Control::operator=( cluster );
64 Cluster Cluster::New( ClusterStyle& style )
66 return Internal::Cluster::New(style);
69 Cluster Cluster::DownCast( BaseHandle handle )
71 return Control::DownCast<Cluster, Internal::Cluster>(handle);
74 void Cluster::AddChild( Actor child )
76 GetImpl(*this).AddChild( child );
79 void Cluster::AddChild( Actor child, unsigned int positionIndex )
81 GetImpl(*this).AddChild( child, positionIndex);
84 void Cluster::AddChildAt( Actor child, unsigned int index )
86 GetImpl(*this).AddChildAt( child, index );
89 void Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index )
91 GetImpl(*this).AddChildAt( child, positionIndex, index );
94 Actor Cluster::GetChildAt( unsigned int index )
96 return GetImpl(*this).GetChildAt(index);
99 Actor Cluster::RemoveChildAt( unsigned int index )
101 return GetImpl(*this).RemoveChildAt(index);
104 void Cluster::ExpandChild( unsigned int index )
106 GetImpl(*this).ExpandChild(index);
109 void Cluster::ExpandAllChildren()
111 GetImpl(*this).ExpandAllChildren();
114 void Cluster::CollapseChild( unsigned int index, bool front )
116 GetImpl(*this).CollapseChild(index, front);
119 void Cluster::CollapseAllChildren( bool front )
121 GetImpl(*this).CollapseAllChildren( front );
124 void Cluster::TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period )
126 GetImpl(*this).TransformChild( index, position, scale, rotation, alpha, period );
129 void Cluster::RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front )
131 GetImpl(*this).RestoreChild( index, alpha, period, front );
134 void Cluster::SetBackgroundImage( Actor image )
136 GetImpl(*this).SetBackgroundImage(image);
139 void Cluster::SetTitle( Actor text )
141 GetImpl(*this).SetTitle(text);
144 void Cluster::SetStyle(ClusterStyle style)
146 GetImpl(*this).SetStyle(style);
149 ClusterStyle Cluster::GetStyle() const
151 return GetImpl(*this).GetStyle();
154 unsigned int Cluster::GetExpandedCount() const
156 return GetImpl(*this).GetExpandedCount();
159 unsigned int Cluster::GetTotalCount() const
161 return GetImpl(*this).GetTotalCount();
164 Cluster::Cluster( Internal::Cluster& impl )
169 Cluster::Cluster( Dali::Internal::CustomActor* internal )
170 : Control( internal )
172 VerifyCustomActorPointer<Internal::Cluster>(internal);
175 } // namespace Toolkit