Move more public-api headers to devel-api. PART 3
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / table-view / table-view.cpp
1 /*
2  * Copyright (c) 2015 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/devel-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 const std::string TableView::CELL_INDICES_PROPERTY_NAME("cell-indices");
33 const std::string TableView::ROW_SPAN_PROPERTY_NAME("row-span");
34 const std::string TableView::COLUMN_SPAN_PROPERTY_NAME("column-span");
35
36 TableView::TableView()
37 {
38 }
39
40 TableView::TableView( const TableView& handle )
41 : Control( handle )
42 {
43 }
44
45 TableView& TableView::operator=( const TableView& handle )
46 {
47   if( &handle != this )
48   {
49     Control::operator=( handle );
50   }
51   return *this;
52 }
53
54 TableView TableView::New( unsigned int initialRows, unsigned int initialColumns )
55 {
56   return Internal::TableView::New( initialRows, initialColumns );
57 }
58
59 TableView::~TableView()
60 {
61 }
62
63 TableView TableView::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast<TableView, Internal::TableView>(handle);
66 }
67
68 bool TableView::AddChild( Actor child, CellPosition position )
69 {
70   return GetImpl(*this).AddChild( child, position );
71 }
72
73 Actor TableView::GetChildAt( CellPosition position )
74 {
75   return GetImpl(*this).GetChildAt( position );
76 }
77
78 Actor TableView::RemoveChildAt( CellPosition position )
79 {
80   return GetImpl(*this).RemoveChildAt( position );
81 }
82
83 bool TableView::FindChildPosition( Actor child, CellPosition& position )
84 {
85   return GetImpl(*this).FindChildPosition( child, position );
86 }
87
88 void TableView::InsertRow( unsigned int rowIndex )
89 {
90   GetImpl(*this).InsertRow( rowIndex );
91 }
92
93 void TableView::DeleteRow( unsigned int rowIndex )
94 {
95   GetImpl(*this).DeleteRow( rowIndex );
96 }
97
98 void TableView::DeleteRow( unsigned int rowIndex, vector<Actor>& removed )
99 {
100   GetImpl(*this).DeleteRow( rowIndex, removed );
101 }
102
103 void TableView::InsertColumn( unsigned int columnIndex )
104 {
105   GetImpl(*this).InsertColumn( columnIndex );
106 }
107
108 void TableView::DeleteColumn( unsigned int columnIndex )
109 {
110   GetImpl(*this).DeleteColumn( columnIndex );
111 }
112
113 void TableView::DeleteColumn( unsigned int columnIndex, vector<Actor>& removed )
114 {
115   GetImpl(*this).DeleteColumn( columnIndex, removed );
116 }
117
118 void TableView::Resize( unsigned int rows, unsigned int columns )
119 {
120   GetImpl(*this).Resize( rows, columns );
121 }
122
123 void TableView::Resize( unsigned int rows, unsigned int columns, vector<Actor>& removed )
124 {
125   GetImpl(*this).Resize( rows, columns, removed );
126 }
127
128 void TableView::SetCellPadding( Size padding )
129 {
130   GetImpl(*this).SetCellPadding( padding );
131 }
132
133 Size TableView::GetCellPadding()
134 {
135   return GetImpl(*this).GetCellPadding();
136 }
137
138 void TableView::SetFitHeight( unsigned int rowIndex )
139 {
140   GetImpl(*this).SetRowPolicy( rowIndex, Internal::TableView::FIT );
141 }
142
143 bool TableView::IsFitHeight( unsigned int rowIndex ) const
144 {
145   return ( GetImpl(*this).GetRowPolicy( rowIndex ) == Internal::TableView::FIT );
146 }
147
148 void TableView::SetFitWidth( unsigned int columnIndex )
149 {
150   GetImpl(*this).SetColumnPolicy( columnIndex, Internal::TableView::FIT );
151 }
152
153 bool TableView::IsFitWidth( unsigned int columnIndex ) const
154 {
155   return ( GetImpl(*this).GetColumnPolicy( columnIndex ) == Internal::TableView::FIT );
156 }
157
158 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
159 {
160   GetImpl(*this).SetFixedHeight( rowIndex, height );
161 }
162
163 float TableView::GetFixedHeight( unsigned int rowIndex ) const
164 {
165   return GetImpl(*this).GetFixedHeight( rowIndex );
166 }
167
168 void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
169 {
170   GetImpl(*this).SetRelativeHeight( rowIndex, heightPercentage );
171 }
172
173 float TableView::GetRelativeHeight( unsigned int rowIndex ) const
174 {
175   return GetImpl(*this).GetRelativeHeight( rowIndex );
176 }
177
178 void TableView::SetFixedWidth( unsigned int columnIndex, float width )
179 {
180   GetImpl(*this).SetFixedWidth( columnIndex, width );
181 }
182
183 float TableView::GetFixedWidth( unsigned int columnIndex ) const
184 {
185   return GetImpl(*this).GetFixedWidth( columnIndex );
186 }
187
188 void TableView::SetRelativeWidth( unsigned int columnIndex, float widthPercentage )
189 {
190   GetImpl(*this).SetRelativeWidth( columnIndex, widthPercentage );
191 }
192
193 float TableView::GetRelativeWidth( unsigned int columnIndex ) const
194 {
195   return GetImpl(*this).GetRelativeWidth( columnIndex );
196 }
197
198 unsigned int TableView::GetRows()
199 {
200   return GetImpl(*this).GetRows();
201 }
202
203 unsigned int TableView::GetColumns()
204 {
205   return GetImpl(*this).GetColumns();
206 }
207
208 void TableView::SetCellAlignment( CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical )
209 {
210   GetImpl(*this).SetCellAlignment( position, horizontal, vertical );
211 }
212
213 TableView::TableView(Internal::TableView& implementation)
214 : Control(implementation)
215 {
216 }
217
218 TableView::TableView( Dali::Internal::CustomActor* internal )
219 : Control( internal )
220 {
221   VerifyCustomActorPointer<Internal::TableView>(internal);
222 }
223
224 } // namespace Toolkit
225
226 } // namespace Dali