aab27655098993f4c5f75ed8ab3ad8ae47f10965
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / cluster / cluster.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19
20 #include <dali-toolkit/public-api/controls/cluster/cluster.h>
21
22 // INTERNAL INCLUDES
23
24 #include <dali-toolkit/internal/controls/cluster/cluster-impl.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 // Cluster
34 ///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 const std::string Cluster::CLUSTER_ACTOR_DEPTH( "cluster-actor-depth" );
37
38 Cluster::Cluster()
39 {
40 }
41
42 Cluster::Cluster(const Cluster& cluster)
43 : Control(cluster)
44 {
45 }
46
47 Cluster& Cluster::operator =(const Cluster& cluster)
48 {
49   if( &cluster != this )
50   {
51     Control::operator=( cluster );
52   }
53   return *this;
54 }
55
56 Cluster::~Cluster()
57 {
58 }
59
60 Cluster Cluster::New( ClusterStyle& style )
61 {
62   return Internal::Cluster::New(style);
63 }
64
65 Cluster Cluster::DownCast( BaseHandle handle )
66 {
67   return Control::DownCast<Cluster, Internal::Cluster>(handle);
68 }
69
70 void Cluster::AddChild( Actor child )
71 {
72   GetImpl(*this).AddChild( child );
73 }
74
75 void Cluster::AddChild( Actor child, unsigned int positionIndex )
76 {
77   GetImpl(*this).AddChild( child, positionIndex);
78 }
79
80 void Cluster::AddChildAt( Actor child, unsigned int index )
81 {
82   GetImpl(*this).AddChildAt( child, index );
83 }
84
85 void Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index )
86 {
87   GetImpl(*this).AddChildAt( child, positionIndex, index );
88 }
89
90 Actor Cluster::GetChildAt( unsigned int index )
91 {
92   return GetImpl(*this).GetChildAt(index);
93 }
94
95 Actor Cluster::RemoveChildAt( unsigned int index )
96 {
97   return GetImpl(*this).RemoveChildAt(index);
98 }
99
100 void Cluster::ExpandChild( unsigned int index )
101 {
102   GetImpl(*this).ExpandChild(index);
103 }
104
105 void Cluster::ExpandAllChildren()
106 {
107   GetImpl(*this).ExpandAllChildren();
108 }
109
110 void Cluster::CollapseChild( unsigned int index, bool front )
111 {
112   GetImpl(*this).CollapseChild(index, front);
113 }
114
115 void Cluster::CollapseAllChildren( bool front )
116 {
117   GetImpl(*this).CollapseAllChildren( front );
118 }
119
120 void Cluster::TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period )
121 {
122   GetImpl(*this).TransformChild( index, position, scale, rotation, alpha, period );
123 }
124
125 void Cluster::RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front )
126 {
127   GetImpl(*this).RestoreChild( index, alpha, period, front );
128 }
129
130 void Cluster::SetBackgroundImage( Actor image )
131 {
132   GetImpl(*this).SetBackgroundImage(image);
133 }
134
135 void Cluster::SetTitle( Actor text )
136 {
137   GetImpl(*this).SetTitle(text);
138 }
139
140 void Cluster::SetStyle(ClusterStyle style)
141 {
142   GetImpl(*this).SetStyle(style);
143 }
144
145 ClusterStyle Cluster::GetStyle() const
146 {
147   return GetImpl(*this).GetStyle();
148 }
149
150 unsigned int Cluster::GetExpandedCount() const
151 {
152   return GetImpl(*this).GetExpandedCount();
153 }
154
155 unsigned int Cluster::GetTotalCount() const
156 {
157   return GetImpl(*this).GetTotalCount();
158 }
159
160 Cluster::Cluster( Internal::Cluster& impl )
161 : Control( impl )
162 {
163 }
164
165 Cluster::Cluster( Dali::Internal::CustomActor* internal )
166 : Control( internal )
167 {
168   VerifyCustomActorPointer<Internal::Cluster>(internal);
169 }
170
171 } // namespace Toolkit
172
173 } // namespace Dali