2 * Copyright (c) 2015 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.
19 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
22 #include <dali-toolkit/internal/controls/table-view/table-view-impl.h>
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");
36 TableView::TableView()
40 TableView::TableView( const TableView& handle )
45 TableView& TableView::operator=( const TableView& handle )
49 Control::operator=( handle );
54 TableView TableView::New( unsigned int initialRows, unsigned int initialColumns )
56 return Internal::TableView::New( initialRows, initialColumns );
59 TableView::~TableView()
63 TableView TableView::DownCast( BaseHandle handle )
65 return Control::DownCast<TableView, Internal::TableView>(handle);
68 bool TableView::AddChild( Actor child, CellPosition position )
70 return GetImpl(*this).AddChild( child, position );
73 Actor TableView::GetChildAt( CellPosition position )
75 return GetImpl(*this).GetChildAt( position );
78 Actor TableView::RemoveChildAt( CellPosition position )
80 return GetImpl(*this).RemoveChildAt( position );
83 bool TableView::FindChildPosition( Actor child, CellPosition& position )
85 return GetImpl(*this).FindChildPosition( child, position );
88 void TableView::InsertRow( unsigned int rowIndex )
90 GetImpl(*this).InsertRow( rowIndex );
93 void TableView::DeleteRow( unsigned int rowIndex )
95 GetImpl(*this).DeleteRow( rowIndex );
98 void TableView::DeleteRow( unsigned int rowIndex, vector<Actor>& removed )
100 GetImpl(*this).DeleteRow( rowIndex, removed );
103 void TableView::InsertColumn( unsigned int columnIndex )
105 GetImpl(*this).InsertColumn( columnIndex );
108 void TableView::DeleteColumn( unsigned int columnIndex )
110 GetImpl(*this).DeleteColumn( columnIndex );
113 void TableView::DeleteColumn( unsigned int columnIndex, vector<Actor>& removed )
115 GetImpl(*this).DeleteColumn( columnIndex, removed );
118 void TableView::Resize( unsigned int rows, unsigned int columns )
120 GetImpl(*this).Resize( rows, columns );
123 void TableView::Resize( unsigned int rows, unsigned int columns, vector<Actor>& removed )
125 GetImpl(*this).Resize( rows, columns, removed );
128 void TableView::SetCellPadding( Size padding )
130 GetImpl(*this).SetCellPadding( padding );
133 Size TableView::GetCellPadding()
135 return GetImpl(*this).GetCellPadding();
138 void TableView::SetFitHeight( unsigned int rowIndex )
140 GetImpl(*this).SetRowPolicy( rowIndex, Internal::TableView::FIT );
143 bool TableView::IsFitHeight( unsigned int rowIndex ) const
145 return ( GetImpl(*this).GetRowPolicy( rowIndex ) == Internal::TableView::FIT );
148 void TableView::SetFitWidth( unsigned int columnIndex )
150 GetImpl(*this).SetColumnPolicy( columnIndex, Internal::TableView::FIT );
153 bool TableView::IsFitWidth( unsigned int columnIndex ) const
155 return ( GetImpl(*this).GetColumnPolicy( columnIndex ) == Internal::TableView::FIT );
158 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
160 GetImpl(*this).SetFixedHeight( rowIndex, height );
163 float TableView::GetFixedHeight( unsigned int rowIndex ) const
165 return GetImpl(*this).GetFixedHeight( rowIndex );
168 void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
170 GetImpl(*this).SetRelativeHeight( rowIndex, heightPercentage );
173 float TableView::GetRelativeHeight( unsigned int rowIndex ) const
175 return GetImpl(*this).GetRelativeHeight( rowIndex );
178 void TableView::SetFixedWidth( unsigned int columnIndex, float width )
180 GetImpl(*this).SetFixedWidth( columnIndex, width );
183 float TableView::GetFixedWidth( unsigned int columnIndex ) const
185 return GetImpl(*this).GetFixedWidth( columnIndex );
188 void TableView::SetRelativeWidth( unsigned int columnIndex, float widthPercentage )
190 GetImpl(*this).SetRelativeWidth( columnIndex, widthPercentage );
193 float TableView::GetRelativeWidth( unsigned int columnIndex ) const
195 return GetImpl(*this).GetRelativeWidth( columnIndex );
198 unsigned int TableView::GetRows()
200 return GetImpl(*this).GetRows();
203 unsigned int TableView::GetColumns()
205 return GetImpl(*this).GetColumns();
208 void TableView::SetCellAlignment( CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical )
210 GetImpl(*this).SetCellAlignment( position, horizontal, vertical );
213 TableView::TableView(Internal::TableView& implementation)
214 : Control(implementation)
218 TableView::TableView( Dali::Internal::CustomActor* internal )
219 : Control( internal )
221 VerifyCustomActorPointer<Internal::TableView>(internal);
224 } // namespace Toolkit