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