License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / table-view / table-view.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 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/table-view/table-view-impl.h>
23
24 using std::vector;
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 TableView::TableView()
33 {
34 }
35
36 TableView::TableView( const TableView& handle )
37 : Control( handle )
38 {
39 }
40
41 TableView& TableView::operator=( const TableView& handle )
42 {
43   if( &handle != this )
44   {
45     Control::operator=( handle );
46   }
47   return *this;
48 }
49
50 TableView TableView::New( unsigned int initialRows, unsigned int initialColumns )
51 {
52   return Internal::TableView::New( initialRows, initialColumns );
53 }
54
55 TableView::~TableView()
56 {
57 }
58
59 TableView TableView::DownCast( BaseHandle handle )
60 {
61   return Control::DownCast<TableView, Internal::TableView>(handle);
62 }
63
64 bool TableView::AddChild( Actor child, CellPosition position )
65 {
66   return GetImpl(*this).AddChild( child, position );
67 }
68
69 Actor TableView::GetChildAt( CellPosition position )
70 {
71   return GetImpl(*this).GetChildAt( position );
72 }
73
74 Actor TableView::RemoveChildAt( CellPosition position )
75 {
76   return GetImpl(*this).RemoveChildAt( position );
77 }
78
79 bool TableView::FindChildPosition( Actor child, CellPosition& position )
80 {
81   return GetImpl(*this).FindChildPosition( child, position );
82 }
83
84 void TableView::InsertRow( unsigned int rowIndex )
85 {
86   GetImpl(*this).InsertRow( rowIndex );
87 }
88
89 void TableView::DeleteRow( unsigned int rowIndex )
90 {
91   GetImpl(*this).DeleteRow( rowIndex );
92 }
93
94 void TableView::DeleteRow( unsigned int rowIndex, vector<Actor>& removed )
95 {
96   GetImpl(*this).DeleteRow( rowIndex, removed );
97 }
98
99 void TableView::InsertColumn( unsigned int columnIndex )
100 {
101   GetImpl(*this).InsertColumn( columnIndex );
102 }
103
104 void TableView::DeleteColumn( unsigned int columnIndex )
105 {
106   GetImpl(*this).DeleteColumn( columnIndex );
107 }
108
109 void TableView::DeleteColumn( unsigned int columnIndex, vector<Actor>& removed )
110 {
111   GetImpl(*this).DeleteColumn( columnIndex, removed );
112 }
113
114 void TableView::Resize( unsigned int rows, unsigned int columns )
115 {
116   GetImpl(*this).Resize( rows, columns );
117 }
118
119 void TableView::Resize( unsigned int rows, unsigned int columns, vector<Actor>& removed )
120 {
121   GetImpl(*this).Resize( rows, columns, removed );
122 }
123
124 void TableView::SetCellPadding( Size padding )
125 {
126   GetImpl(*this).SetCellPadding( padding );
127 }
128
129 Size TableView::GetCellPadding()
130 {
131   return GetImpl(*this).GetCellPadding();
132 }
133
134 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
135 {
136   GetImpl(*this).SetFixedHeight( rowIndex, height );
137 }
138
139 float TableView::GetFixedHeight( unsigned int rowIndex ) const
140 {
141   return GetImpl(*this).GetFixedHeight( rowIndex );
142 }
143
144 void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
145 {
146   GetImpl(*this).SetRelativeHeight( rowIndex, heightPercentage );
147 }
148
149 float TableView::GetRelativeHeight( unsigned int rowIndex ) const
150 {
151   return GetImpl(*this).GetRelativeHeight( rowIndex );
152 }
153
154 void TableView::SetFixedWidth( unsigned int columnIndex, float width )
155 {
156   GetImpl(*this).SetFixedWidth( columnIndex, width );
157 }
158
159 float TableView::GetFixedWidth( unsigned int columnIndex ) const
160 {
161   return GetImpl(*this).GetFixedWidth( columnIndex );
162 }
163
164 void TableView::SetRelativeWidth( unsigned int columnIndex, float widthPercentage )
165 {
166   GetImpl(*this).SetRelativeWidth( columnIndex, widthPercentage );
167 }
168
169 float TableView::GetRelativeWidth( unsigned int columnIndex ) const
170 {
171   return GetImpl(*this).GetRelativeWidth( columnIndex );
172 }
173
174 void TableView::SetLayoutAnimationDuration( float duration )
175 {
176   GetImpl(*this).SetLayoutAnimationDuration( duration );
177 }
178
179 float TableView::GetLayoutAnimationDuration()
180 {
181   return GetImpl(*this).GetLayoutAnimationDuration();
182 }
183
184 unsigned int TableView::GetRows()
185 {
186   return GetImpl(*this).GetRows();
187 }
188
189 unsigned int TableView::GetColumns()
190 {
191   return GetImpl(*this).GetColumns();
192 }
193
194 TableView::TableView(Internal::TableView& implementation)
195 : Control(implementation)
196 {
197 }
198
199 TableView::TableView( Dali::Internal::CustomActor* internal )
200 : Control( internal )
201 {
202   VerifyCustomActorPointer<Internal::TableView>(internal);
203 }
204
205 } // namespace Toolkit
206
207 } // namespace Dali