Add npatch utility
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-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/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::SetFitHeight( unsigned int rowIndex )
135 {
136   GetImpl(*this).SetFitHeight( rowIndex );
137 }
138
139 bool TableView::IsFitHeight( unsigned int rowIndex ) const
140 {
141   return GetImpl(*this).IsFitHeight( rowIndex );
142 }
143
144 void TableView::SetFitWidth( unsigned int columnIndex )
145 {
146   GetImpl(*this).SetFitWidth( columnIndex );
147 }
148
149 bool TableView::IsFitWidth( unsigned int columnIndex ) const
150 {
151   return GetImpl(*this).IsFitWidth( columnIndex );
152 }
153
154 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
155 {
156   GetImpl(*this).SetFixedHeight( rowIndex, height );
157 }
158
159 float TableView::GetFixedHeight( unsigned int rowIndex ) const
160 {
161   return GetImpl(*this).GetFixedHeight( rowIndex );
162 }
163
164 void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
165 {
166   GetImpl(*this).SetRelativeHeight( rowIndex, heightPercentage );
167 }
168
169 float TableView::GetRelativeHeight( unsigned int rowIndex ) const
170 {
171   return GetImpl(*this).GetRelativeHeight( rowIndex );
172 }
173
174 void TableView::SetFixedWidth( unsigned int columnIndex, float width )
175 {
176   GetImpl(*this).SetFixedWidth( columnIndex, width );
177 }
178
179 float TableView::GetFixedWidth( unsigned int columnIndex ) const
180 {
181   return GetImpl(*this).GetFixedWidth( columnIndex );
182 }
183
184 void TableView::SetRelativeWidth( unsigned int columnIndex, float widthPercentage )
185 {
186   GetImpl(*this).SetRelativeWidth( columnIndex, widthPercentage );
187 }
188
189 float TableView::GetRelativeWidth( unsigned int columnIndex ) const
190 {
191   return GetImpl(*this).GetRelativeWidth( columnIndex );
192 }
193
194 unsigned int TableView::GetRows()
195 {
196   return GetImpl(*this).GetRows();
197 }
198
199 unsigned int TableView::GetColumns()
200 {
201   return GetImpl(*this).GetColumns();
202 }
203
204 void TableView::SetCellAlignment( CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical )
205 {
206   GetImpl(*this).SetCellAlignment( position, horizontal, vertical );
207 }
208
209 TableView::TableView(Internal::TableView& implementation)
210 : Control(implementation)
211 {
212 }
213
214 TableView::TableView( Dali::Internal::CustomActor* internal )
215 : Control( internal )
216 {
217   VerifyCustomActorPointer<Internal::TableView>(internal);
218 }
219
220 } // namespace Toolkit
221
222 } // namespace Dali