8fe2b1017ded962f36a9b517d80515e8c8591e3c
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TableView.cs
1 /*
2  * Copyright(c) 2019 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 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25
26     /// <summary>
27     /// TableView is a layout container for aligning child actors in a grid like layout.<br />
28     /// TableView constraints the X and the Y position and the width and the height of the child actors.<br />
29     /// The Z position and depth are left intact so that the 3D model actors can also be laid out
30     /// in a grid without loosing their depth scaling.<br />
31     /// </summary>
32     /// <since_tizen> 3 </since_tizen>
33     public class TableView : View
34     {
35         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public static readonly BindableProperty RowsProperty = BindableProperty.Create(nameof(Rows), typeof(int), typeof(TableView), default(int), propertyChanged: (bindable, oldValue, newValue) =>
38         {
39             var tableView = (TableView)bindable;
40             if (newValue != null)
41             {
42                 Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.ROWS, new Tizen.NUI.PropertyValue((int)newValue));
43             }
44         },
45         defaultValueCreator: (bindable) =>
46         {
47             var tableView = (TableView)bindable;
48             int temp = 0;
49             Tizen.NUI.Object.GetProperty(tableView.swigCPtr, TableView.Property.ROWS).Get(out temp);
50             return temp;
51         });
52         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
53         [EditorBrowsable(EditorBrowsableState.Never)]
54         public static readonly BindableProperty ColumnsProperty = BindableProperty.Create(nameof(Columns), typeof(int), typeof(TableView), default(int), propertyChanged: (bindable, oldValue, newValue) =>
55         {
56             var tableView = (TableView)bindable;
57             if (newValue != null)
58             {
59                 Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.COLUMNS, new Tizen.NUI.PropertyValue((int)newValue));
60             }
61         },
62         defaultValueCreator: (bindable) =>
63         {
64             var tableView = (TableView)bindable;
65             int temp = 0;
66             Tizen.NUI.Object.GetProperty(tableView.swigCPtr, TableView.Property.COLUMNS).Get(out temp);
67             return temp;
68         });
69         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
70         [EditorBrowsable(EditorBrowsableState.Never)]
71         public static readonly BindableProperty CellPaddingProperty = BindableProperty.Create(nameof(CellPadding), typeof(Vector2), typeof(TableView), null, propertyChanged: (bindable, oldValue, newValue) =>
72         {
73             var tableView = (TableView)bindable;
74             if (newValue != null)
75             {
76                 Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.CELL_PADDING, new Tizen.NUI.PropertyValue((Vector2)newValue));
77             }
78         },
79         defaultValueCreator: (bindable) =>
80         {
81             var tableView = (TableView)bindable;
82             Vector2 temp = new Vector2(0.0f, 0.0f);
83             Tizen.NUI.Object.GetProperty(tableView.swigCPtr, TableView.Property.CELL_PADDING).Get(temp);
84             return temp;
85         });
86         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
87         [EditorBrowsable(EditorBrowsableState.Never)]
88         public static readonly BindableProperty LayoutRowsProperty = BindableProperty.Create(nameof(LayoutRows), typeof(PropertyMap), typeof(TableView), null, propertyChanged: (bindable, oldValue, newValue) =>
89         {
90             var tableView = (TableView)bindable;
91             if (newValue != null)
92             {
93                 Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_ROWS, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
94             }
95         },
96         defaultValueCreator: (bindable) =>
97         {
98             var tableView = (TableView)bindable;
99             PropertyMap temp = new PropertyMap();
100             Tizen.NUI.Object.GetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_ROWS).Get(temp);
101             return temp;
102         });
103         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
104         [EditorBrowsable(EditorBrowsableState.Never)]
105         public static readonly BindableProperty LayoutColumnsProperty = BindableProperty.Create(nameof(LayoutColumns), typeof(PropertyMap), typeof(TableView), null, propertyChanged: (bindable, oldValue, newValue) =>
106         {
107             var tableView = (TableView)bindable;
108             if (newValue != null)
109             {
110                 Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_COLUMNS, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
111             }
112         },
113         defaultValueCreator: (bindable) =>
114         {
115             var tableView = (TableView)bindable;
116             PropertyMap temp = new PropertyMap();
117             Tizen.NUI.Object.GetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_COLUMNS).Get(temp);
118             return temp;
119         });
120
121
122         /// <summary>
123         /// Creates the default TableView view.
124         /// </summary>
125         public TableView() : this(Interop.TableView.TableView_New(1, 1), true)
126         {
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128         }
129
130         /// <summary>
131         /// Creates the TableView view.
132         /// </summary>
133         /// <param name="initialRows">Initial rows for the table.</param>
134         /// <param name="initialColumns">Initial columns for the table.</param>
135         /// <since_tizen> 3 </since_tizen>
136         public TableView(uint initialRows, uint initialColumns) : this(Interop.TableView.TableView_New(initialRows, initialColumns), true)
137         {
138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139
140         }
141
142         /// <summary>
143         /// The Copy constructor. Creates another handle that points to the same real object.
144         /// </summary>
145         /// <param name="handle">Handle to copy from.</param>
146         /// <since_tizen> 3 </since_tizen>
147         public TableView(TableView handle) : this(Interop.TableView.new_TableView__SWIG_1(TableView.getCPtr(handle)), true)
148         {
149             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150         }
151
152         internal TableView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TableView.TableView_SWIGUpcast(cPtr), cMemoryOwn)
153         {
154         }
155
156         /// <summary>
157         /// Enumeration for describing how the size of a row or column has been set.
158         /// </summary>
159         /// <since_tizen> 3 </since_tizen>
160         public enum LayoutPolicy
161         {
162             /// <summary>
163             /// Fixed with the given value.
164             /// </summary>
165             /// <since_tizen> 3 </since_tizen>
166             Fixed,
167             /// <summary>
168             /// Calculated as percentage of the remainder after subtracting Padding and Fixed height/width.
169             /// </summary>
170             /// <since_tizen> 3 </since_tizen>
171             Relative,
172             /// <summary>
173             ///  Default policy, get the remainder of the 100% (after subtracting Fixed, Fit and Relative height/ width) divided evenly between 'fill' rows/columns.
174             /// </summary>
175             /// <since_tizen> 3 </since_tizen>
176             Fill,
177             /// <summary>
178             /// Fit around its children.
179             /// </summary>
180             /// <since_tizen> 3 </since_tizen>
181             Fit
182         }
183
184         /// <summary>
185         /// The amount of rows in the table.
186         /// </summary>
187         /// <since_tizen> 3 </since_tizen>
188         public int Rows
189         {
190             get
191             {
192                 return (int)GetValue(RowsProperty);
193             }
194             set
195             {
196                 SetValue(RowsProperty, value);
197                 NotifyPropertyChanged();
198             }
199         }
200         /// <summary>
201         /// The amount of columns in the table.
202         /// </summary>
203         /// <since_tizen> 3 </since_tizen>
204         public int Columns
205         {
206             get
207             {
208                 return (int)GetValue(ColumnsProperty);
209             }
210             set
211             {
212                 SetValue(ColumnsProperty, value);
213                 NotifyPropertyChanged();
214             }
215         }
216         /// <summary>
217         /// Padding between cells.
218         /// </summary>
219         /// <since_tizen> 3 </since_tizen>
220         public Vector2 CellPadding
221         {
222             get
223             {
224                 return (Vector2)GetValue(CellPaddingProperty);
225             }
226             set
227             {
228                 SetValue(CellPaddingProperty, value);
229                 NotifyPropertyChanged();
230             }
231         }
232
233         /// <summary>
234         /// The number of layout rows.
235         /// </summary>
236         /// <since_tizen> 3 </since_tizen>
237         public PropertyMap LayoutRows
238         {
239             get
240             {
241                 return (PropertyMap)GetValue(LayoutRowsProperty);
242             }
243             set
244             {
245                 SetValue(LayoutRowsProperty, value);
246                 NotifyPropertyChanged();
247             }
248         }
249
250         /// <summary>
251         /// The number of layout columns.
252         /// </summary>
253         /// <since_tizen> 3 </since_tizen>
254         public PropertyMap LayoutColumns
255         {
256             get
257             {
258                 return (PropertyMap)GetValue(LayoutColumnsProperty);
259             }
260             set
261             {
262                 SetValue(LayoutColumnsProperty, value);
263                 NotifyPropertyChanged();
264             }
265         }
266
267
268         /// <summary>
269         /// Adds a child to the table.<br />
270         /// If the row or column index is outside the table, the table gets resized bigger.<br />
271         /// </summary>
272         /// <param name="child">The child to add.</param>
273         /// <param name="position">The position for the child.</param>
274         /// <returns>True if the addition succeeded, and false if the cell is already occupied.</returns>
275         /// <since_tizen> 3 </since_tizen>
276         public bool AddChild(View child, TableView.CellPosition position)
277         {
278             bool ret = Interop.TableView.TableView_AddChild(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
279             Children.Add(child);
280             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281             return ret;
282         }
283
284         /// <summary>
285         /// Returns a child from the given layout position.
286         /// </summary>
287         /// <param name="position">The position in the table.</param>
288         /// <returns>Child that was in the cell or an uninitialized handle.</returns>
289         /// <since_tizen> 3 </since_tizen>
290         public View GetChildAt(TableView.CellPosition position)
291         {
292             //to fix memory leak issue, match the handle count with native side.
293             IntPtr cPtr = Interop.TableView.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
294             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
295             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
296             Interop.BaseHandle.delete_BaseHandle(CPtr);
297             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
298
299             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300             return ret;
301         }
302
303         /// <summary>
304         /// Removes a child from the given layout position.
305         /// </summary>
306         /// <param name="position">The position for the child to remove.</param>
307         /// <returns>Child that was removed or an uninitialized handle.</returns>
308         /// <since_tizen> 3 </since_tizen>
309         public View RemoveChildAt(TableView.CellPosition position)
310         {
311             //to fix memory leak issue, match the handle count with native side.
312             IntPtr cPtr = Interop.TableView.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
313             View ret = this.GetInstanceSafely<View>(cPtr);
314             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315
316             Children.Remove(ret);
317
318             return ret;
319         }
320
321         /// <summary>
322         /// Finds the child's layout position.
323         /// </summary>
324         /// <param name="child">The child to search for.</param>
325         /// <param name="position">The position for the child.</param>
326         /// <returns>True if the child was included in this TableView.</returns>
327         /// <since_tizen> 3 </since_tizen>
328         public bool FindChildPosition(View child, TableView.CellPosition position)
329         {
330             bool ret = Interop.TableView.TableView_FindChildPosition(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
331             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332             return ret;
333         }
334
335         /// <summary>
336         /// Inserts a new row to the given index.
337         /// </summary>
338         /// <param name="rowIndex">The rowIndex of the new row.</param>
339         /// <since_tizen> 3 </since_tizen>
340         public void InsertRow(uint rowIndex)
341         {
342             Interop.TableView.TableView_InsertRow(swigCPtr, rowIndex);
343             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344         }
345
346         /// <summary>
347         /// Deletes a row from the given index.<br />
348         /// Removed elements are deleted.<br />
349         /// </summary>
350         /// <param name="rowIndex">The rowIndex of the row to delete.</param>
351         /// <since_tizen> 3 </since_tizen>
352         public void DeleteRow(uint rowIndex)
353         {
354             Interop.TableView.TableView_DeleteRow__SWIG_0(swigCPtr, rowIndex);
355             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356         }
357
358         /// <summary>
359         /// Inserts a new column to the given index.
360         /// </summary>
361         /// <param name="columnIndex">The columnIndex of the new column.</param>
362         /// <since_tizen> 3 </since_tizen>
363         public void InsertColumn(uint columnIndex)
364         {
365             Interop.TableView.TableView_InsertColumn(swigCPtr, columnIndex);
366             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367         }
368
369         /// <summary>
370         /// Deletes a column from the given index.<br />
371         /// Removed elements are deleted.<br />
372         /// </summary>
373         /// <param name="columnIndex">The columnIndex of the column to delete.</param>
374         /// <since_tizen> 3 </since_tizen>
375         public void DeleteColumn(uint columnIndex)
376         {
377             Interop.TableView.TableView_DeleteColumn__SWIG_0(swigCPtr, columnIndex);
378             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379         }
380
381         /// <summary>
382         /// Resizes the TableView.
383         /// </summary>
384         /// <param name="rows">The rows for the table.</param>
385         /// <param name="columns">The columns for the table.</param>
386         /// <since_tizen> 3 </since_tizen>
387         public void Resize(uint rows, uint columns)
388         {
389             Interop.TableView.TableView_Resize__SWIG_0(swigCPtr, rows, columns);
390             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391         }
392
393         /// <summary>
394         /// Sets the horizontal and the vertical padding between cells.
395         /// </summary>
396         /// <param name="padding">Width and height.</param>
397         /// <since_tizen> 3 </since_tizen>
398         public void SetCellPadding(Size2D padding)
399         {
400             Interop.TableView.TableView_SetCellPadding(swigCPtr, Size2D.getCPtr(padding));
401             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
402         }
403
404         /// <summary>
405         /// Gets the current padding as width and height.
406         /// </summary>
407         /// <returns>The current padding as width and height.</returns>
408         /// <since_tizen> 3 </since_tizen>
409         public Vector2 GetCellPadding()
410         {
411             Vector2 ret = new Vector2(Interop.TableView.TableView_GetCellPadding(swigCPtr), true);
412             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413             return ret;
414         }
415
416         /// <summary>
417         /// Specifies this row as fitting its height to its children.
418         /// </summary>
419         /// <param name="rowIndex">The row to set.</param>
420         /// <since_tizen> 3 </since_tizen>
421         public void SetFitHeight(uint rowIndex)
422         {
423             Interop.TableView.TableView_SetFitHeight(swigCPtr, rowIndex);
424             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425         }
426
427         /// <summary>
428         /// Checks if the row is a fit row.
429         /// </summary>
430         /// <param name="rowIndex">The row to check.</param>
431         /// <returns>True if the row is fit.</returns>
432         /// <since_tizen> 3 </since_tizen>
433         public bool IsFitHeight(uint rowIndex)
434         {
435             bool ret = Interop.TableView.TableView_IsFitHeight(swigCPtr, rowIndex);
436             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437             return ret;
438         }
439
440         /// <summary>
441         /// Specifies this column as fitting its width to its children.
442         /// </summary>
443         /// <param name="columnIndex">The column to set.</param>
444         /// <since_tizen> 3 </since_tizen>
445         public void SetFitWidth(uint columnIndex)
446         {
447             Interop.TableView.TableView_SetFitWidth(swigCPtr, columnIndex);
448             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449         }
450
451         /// <summary>
452         /// Checks if the column is a fit column.
453         /// </summary>
454         /// <param name="columnIndex">The column to check.</param>
455         /// <returns>True if the column is fit.</returns>
456         /// <since_tizen> 3 </since_tizen>
457         public bool IsFitWidth(uint columnIndex)
458         {
459             bool ret = Interop.TableView.TableView_IsFitWidth(swigCPtr, columnIndex);
460             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461             return ret;
462         }
463
464         /// <summary>
465         /// Sets a row to have a fixed height.<br />
466         /// Setting a fixed height of 0 has no effect.<br />
467         /// </summary>
468         /// <param name="rowIndex">The rowIndex for row with a fixed height.</param>
469         /// <param name="height">The height in world coordinate units.</param>
470         /// <since_tizen> 3 </since_tizen>
471         public void SetFixedHeight(uint rowIndex, float height)
472         {
473             Interop.TableView.TableView_SetFixedHeight(swigCPtr, rowIndex, height);
474             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475         }
476
477         /// <summary>
478         /// Gets a row's fixed height.
479         /// </summary>
480         /// <param name="rowIndex">The row index with a fixed height.</param>
481         /// <returns>height The height in world coordinate units.</returns>
482         /// <since_tizen> 3 </since_tizen>
483         public float GetFixedHeight(uint rowIndex)
484         {
485             float ret = Interop.TableView.TableView_GetFixedHeight(swigCPtr, rowIndex);
486             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487             return ret;
488         }
489
490         /// <summary>
491         /// Sets a row to have a relative height. Relative height means percentage of
492         /// the remainder of the table height after subtracting padding and fixed height rows.<br />
493         /// Setting a relative height of 0 has no effect.<br />
494         /// </summary>
495         /// <param name="rowIndex">The rowIndex for row with a relative height.</param>
496         /// <param name="heightPercentage">The height percentage between 0.0f and 1.0f.</param>
497         /// <since_tizen> 3 </since_tizen>
498         public void SetRelativeHeight(uint rowIndex, float heightPercentage)
499         {
500             Interop.TableView.TableView_SetRelativeHeight(swigCPtr, rowIndex, heightPercentage);
501             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502         }
503
504         /// <summary>
505         /// Gets a row's relative height.
506         /// </summary>
507         /// <param name="rowIndex">The row index with a relative height.</param>
508         /// <returns>Height in percentage units, between 0.0f and 1.0f.</returns>
509         /// <since_tizen> 3 </since_tizen>
510         public float GetRelativeHeight(uint rowIndex)
511         {
512             float ret = Interop.TableView.TableView_GetRelativeHeight(swigCPtr, rowIndex);
513             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514             return ret;
515         }
516
517         /// <summary>
518         /// Sets a column to have a fixed width.<br />
519         /// Setting a fixed width of 0 has no effect.<br />
520         /// </summary>
521         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
522         /// <param name="width">The width in world coordinate units.</param>
523         /// <since_tizen> 3 </since_tizen>
524         public void SetFixedWidth(uint columnIndex, float width)
525         {
526             Interop.TableView.TableView_SetFixedWidth(swigCPtr, columnIndex, width);
527             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528         }
529
530         /// <summary>
531         /// Gets a column's fixed width.
532         /// </summary>
533         /// <param name="columnIndex">The column index with a fixed width.</param>
534         /// <returns>Width in world coordinate units.</returns>
535         /// <since_tizen> 3 </since_tizen>
536         public float GetFixedWidth(uint columnIndex)
537         {
538             float ret = Interop.TableView.TableView_GetFixedWidth(swigCPtr, columnIndex);
539             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540             return ret;
541         }
542
543         /// <summary>
544         /// Sets a column to have a relative width. Relative width means percentage of
545         /// the remainder of the table width after subtracting padding and fixed width columns.<br />
546         /// Setting a relative width of 0 has no effect.<br />
547         /// </summary>
548         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
549         /// <param name="widthPercentage">The widthPercentage between 0.0f and 1.0f.</param>
550         /// <since_tizen> 3 </since_tizen>
551         public void SetRelativeWidth(uint columnIndex, float widthPercentage)
552         {
553             Interop.TableView.TableView_SetRelativeWidth(swigCPtr, columnIndex, widthPercentage);
554             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555         }
556
557         /// <summary>
558         /// Gets a column's relative width.
559         /// </summary>
560         /// <param name="columnIndex">The column index with a relative width.</param>
561         /// <returns>Width in percentage units, between 0.0f and 1.0f.</returns>
562         /// <since_tizen> 3 </since_tizen>
563         public float GetRelativeWidth(uint columnIndex)
564         {
565             float ret = Interop.TableView.TableView_GetRelativeWidth(swigCPtr, columnIndex);
566             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567             return ret;
568         }
569
570         /// <summary>
571         /// Sets the alignment on a cell.<br />
572         /// Cells without calling this function have the default values of left and top respectively.<br />
573         /// </summary>
574         /// <param name="position">The cell to set alignment on.</param>
575         /// <param name="horizontal">The horizontal alignment.</param>
576         /// <param name="vertical">The vertical alignment.</param>
577         /// <since_tizen> 3 </since_tizen>
578         public void SetCellAlignment(TableView.CellPosition position, HorizontalAlignmentType horizontal, VerticalAlignmentType vertical)
579         {
580             Interop.TableView.TableView_SetCellAlignment(swigCPtr, TableView.CellPosition.getCPtr(position), (int)horizontal, (int)vertical);
581             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582         }
583
584         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TableView obj)
585         {
586             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
587         }
588
589         /// This will not be public opened.
590         [EditorBrowsable(EditorBrowsableState.Never)]
591         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
592         {
593             Interop.TableView.delete_TableView(swigCPtr);
594         }
595
596         /// <summary>
597         /// Class to specify the layout position for the child view.
598         /// </summary>
599         /// <since_tizen> 3 </since_tizen>
600         public class CellPosition : Disposable
601         {
602             /// <summary>
603             /// The constructor.
604             /// </summary>
605             /// <param name="rowIndex">The row index initialized.</param>
606             /// <param name="columnIndex">The column index initialized.</param>
607             /// <param name="rowSpan">The row span initialized.</param>
608             /// <param name="columnSpan">The column span initialized.</param>
609             /// <since_tizen> 3 </since_tizen>
610             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(Interop.TableView.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true)
611             {
612                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613             }
614
615             /// <summary>
616             /// The constructor to initialize values to defaults for convenience.
617             /// </summary>
618             /// <param name="rowIndex">The row index initialized.</param>
619             /// <param name="columnIndex">The column index initialized.</param>
620             /// <param name="rowSpan">The row span initialized.</param>
621             /// <since_tizen> 3 </since_tizen>
622             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(Interop.TableView.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true)
623             {
624                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625             }
626
627             /// <summary>
628             /// The constructor to initialize values to defaults for convenience.
629             /// </summary>
630             /// <param name="rowIndex">The row index initialized.</param>
631             /// <param name="columnIndex">The column index initialized.</param>
632             /// <since_tizen> 3 </since_tizen>
633             public CellPosition(uint rowIndex, uint columnIndex) : this(Interop.TableView.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true)
634             {
635                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636             }
637
638             /// <summary>
639             /// The constructor to initialize values to default for convenience.
640             /// </summary>
641             /// <param name="rowIndex">The row index initialized.</param>
642             /// <since_tizen> 3 </since_tizen>
643             public CellPosition(uint rowIndex) : this(Interop.TableView.new_TableView_CellPosition__SWIG_3(rowIndex), true)
644             {
645                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646             }
647
648             /// <summary>
649             /// The default constructor.
650             /// </summary>
651             /// <since_tizen> 3 </since_tizen>
652             public CellPosition() : this(Interop.TableView.new_TableView_CellPosition__SWIG_4(), true)
653             {
654                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
655             }
656
657             internal CellPosition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
658             {
659             }
660
661             /// <summary>
662             /// The index of a row.
663             /// </summary>
664             /// <since_tizen> 3 </since_tizen>
665             [Obsolete("Please do not use! This will be deprecated! Please use RowIndex instead!")]
666             [EditorBrowsable(EditorBrowsableState.Never)]
667             public uint rowIndex
668             {
669                 set
670                 {
671                     Interop.TableView.TableView_CellPosition_rowIndex_set(swigCPtr, value);
672                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673                 }
674                 get
675                 {
676                     uint ret = Interop.TableView.TableView_CellPosition_rowIndex_get(swigCPtr);
677                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678                     return ret;
679                 }
680             }
681
682             /// <summary>
683             /// The index or position of a row.
684             /// </summary>
685             /// <since_tizen> 5 </since_tizen>
686             public uint RowIndex
687             {
688                 get
689                 {
690                     uint ret = Interop.TableView.TableView_CellPosition_rowIndex_get(swigCPtr);
691                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692                     return ret;
693                 }
694             }
695
696
697             /// <summary>
698             /// The index of a column.
699             /// </summary>
700             /// <since_tizen> 3 </since_tizen>
701             [Obsolete("Please do not use! This will be deprecated! Please use ColumnIndex instead!")]
702             [EditorBrowsable(EditorBrowsableState.Never)]
703             public uint columnIndex
704             {
705                 set
706                 {
707                     Interop.TableView.TableView_CellPosition_columnIndex_set(swigCPtr, value);
708                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
709                 }
710                 get
711                 {
712                     uint ret = Interop.TableView.TableView_CellPosition_columnIndex_get(swigCPtr);
713                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
714                     return ret;
715                 }
716             }
717
718             /// <summary>
719             /// The index or position of a column.
720             /// </summary>
721             /// <since_tizen> 5 </since_tizen>
722             public uint ColumnIndex
723             {
724                 get
725                 {
726                     uint ret = Interop.TableView.TableView_CellPosition_columnIndex_get(swigCPtr);
727                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
728                     return ret;
729                 }
730             }
731
732             /// <summary>
733             /// The span of a row.
734             /// </summary>
735             /// <since_tizen> 3 </since_tizen>
736             [Obsolete("Please do not use! This will be deprecated! Please use RowSpan instead!")]
737             [EditorBrowsable(EditorBrowsableState.Never)]
738             public uint rowSpan
739             {
740                 set
741                 {
742                     Interop.TableView.TableView_CellPosition_rowSpan_set(swigCPtr, value);
743                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
744                 }
745                 get
746                 {
747                     uint ret = Interop.TableView.TableView_CellPosition_rowSpan_get(swigCPtr);
748                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749                     return ret;
750                 }
751             }
752
753             /// <summary>
754             /// The span of a row.
755             /// </summary>
756             /// <since_tizen> 5 </since_tizen>
757             public uint RowSpan
758             {
759                 get
760                 {
761                     uint ret = Interop.TableView.TableView_CellPosition_rowSpan_get(swigCPtr);
762                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
763                     return ret;
764                 }
765             }
766
767             /// <summary>
768             /// The span of a column.
769             /// </summary>
770             /// <since_tizen> 3 </since_tizen>
771             [Obsolete("Please do not use! This will be deprecated! Please use ColumnSpan instead!")]
772             [EditorBrowsable(EditorBrowsableState.Never)]
773             public uint columnSpan
774             {
775                 set
776                 {
777                     Interop.TableView.TableView_CellPosition_columnSpan_set(swigCPtr, value);
778                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779                 }
780                 get
781                 {
782                     uint ret = Interop.TableView.TableView_CellPosition_columnSpan_get(swigCPtr);
783                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
784                     return ret;
785                 }
786             }
787
788             /// <summary>
789             /// The span of a column.
790             /// </summary>
791             /// <since_tizen> 5 </since_tizen>
792             public uint ColumnSpan
793             {
794                 get
795                 {
796                     uint ret = Interop.TableView.TableView_CellPosition_columnSpan_get(swigCPtr);
797                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
798                     return ret;
799                 }
800             }
801
802             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CellPosition obj)
803             {
804                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
805             }
806
807             /// This will not be public opened.
808             [EditorBrowsable(EditorBrowsableState.Never)]
809             protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
810             {
811                 Interop.TableView.delete_TableView_CellPosition(swigCPtr);
812             }
813         }
814
815         internal new class Property
816         {
817             internal static readonly int ROWS = Interop.TableView.TableView_Property_ROWS_get();
818             internal static readonly int COLUMNS = Interop.TableView.TableView_Property_COLUMNS_get();
819             internal static readonly int CELL_PADDING = Interop.TableView.TableView_Property_CELL_PADDING_get();
820             internal static readonly int LAYOUT_ROWS = Interop.TableView.TableView_Property_LAYOUT_ROWS_get();
821             internal static readonly int LAYOUT_COLUMNS = Interop.TableView.TableView_Property_LAYOUT_COLUMNS_get();
822         }
823
824         internal class ChildProperty
825         {
826             internal static readonly int CELL_INDEX = Interop.TableView.TableView_ChildProperty_CELL_INDEX_get();
827             internal static readonly int ROW_SPAN = Interop.TableView.TableView_ChildProperty_ROW_SPAN_get();
828             internal static readonly int COLUMN_SPAN = Interop.TableView.TableView_ChildProperty_COLUMN_SPAN_get();
829             internal static readonly int CELL_HORIZONTAL_ALIGNMENT = Interop.TableView.TableView_ChildProperty_CELL_HORIZONTAL_ALIGNMENT_get();
830             internal static readonly int CELL_VERTICAL_ALIGNMENT = Interop.TableView.TableView_ChildProperty_CELL_VERTICAL_ALIGNMENT_get();
831         }
832     }
833 }