[NUI] Manual merge from tizen50 (#653)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TableView.cs
1 /*
2  * Copyright(c) 2017 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("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("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("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("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("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         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
122
123         /// <summary>
124         /// Creates the default TableView view.
125         /// </summary>
126         public TableView() : this(NDalicPINVOKE.TableView_New(1, 1), true)
127         {
128             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129         }
130
131         /// <summary>
132         /// Creates the TableView view.
133         /// </summary>
134         /// <param name="initialRows">Initial rows for the table.</param>
135         /// <param name="initialColumns">Initial columns for the table.</param>
136         /// <since_tizen> 3 </since_tizen>
137         public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true)
138         {
139             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140
141         }
142
143         /// <summary>
144         /// The Copy constructor. Creates another handle that points to the same real object.
145         /// </summary>
146         /// <param name="handle">Handle to copy from.</param>
147         /// <since_tizen> 3 </since_tizen>
148         public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true)
149         {
150             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151         }
152
153         internal TableView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TableView_SWIGUpcast(cPtr), cMemoryOwn)
154         {
155             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
156         }
157
158         /// <summary>
159         /// Enumeration for describing how the size of a row or column has been set.
160         /// </summary>
161         /// <since_tizen> 3 </since_tizen>
162         public enum LayoutPolicy
163         {
164             /// <summary>
165             /// Fixed with the given value.
166             /// </summary>
167             /// <since_tizen> 3 </since_tizen>
168             Fixed,
169             /// <summary>
170             /// Calculated as percentage of the remainder after subtracting Padding and Fixed height/width.
171             /// </summary>
172             /// <since_tizen> 3 </since_tizen>
173             Relative,
174             /// <summary>
175             ///  Default policy, get the remainder of the 100% (after subtracting Fixed, Fit and Relative height/ width) divided evenly between 'fill' rows/columns.
176             /// </summary>
177             /// <since_tizen> 3 </since_tizen>
178             Fill,
179             /// <summary>
180             /// Fit around its children.
181             /// </summary>
182             /// <since_tizen> 3 </since_tizen>
183             Fit
184         }
185
186         /// <summary>
187         /// The amount of rows in the table.
188         /// </summary>
189         /// <since_tizen> 3 </since_tizen>
190         public int Rows
191         {
192             get
193             {
194                 return (int)GetValue(RowsProperty);
195             }
196             set
197             {
198                 SetValue(RowsProperty, value);
199                 NotifyPropertyChanged();
200             }
201         }
202         /// <summary>
203         /// The amount of columns in the table.
204         /// </summary>
205         /// <since_tizen> 3 </since_tizen>
206         public int Columns
207         {
208             get
209             {
210                 return (int)GetValue(ColumnsProperty);
211             }
212             set
213             {
214                 SetValue(ColumnsProperty, value);
215                 NotifyPropertyChanged();
216             }
217         }
218         /// <summary>
219         /// Padding between cells.
220         /// </summary>
221         /// <since_tizen> 3 </since_tizen>
222         public Vector2 CellPadding
223         {
224             get
225             {
226                 return (Vector2)GetValue(CellPaddingProperty);
227             }
228             set
229             {
230                 SetValue(CellPaddingProperty, value);
231                 NotifyPropertyChanged();
232             }
233         }
234
235         /// <summary>
236         /// The number of layout rows.
237         /// </summary>
238         /// <since_tizen> 3 </since_tizen>
239         public PropertyMap LayoutRows
240         {
241             get
242             {
243                 return (PropertyMap)GetValue(LayoutRowsProperty);
244             }
245             set
246             {
247                 SetValue(LayoutRowsProperty, value);
248                 NotifyPropertyChanged();
249             }
250         }
251
252         /// <summary>
253         /// The number of layout columns.
254         /// </summary>
255         /// <since_tizen> 3 </since_tizen>
256         public PropertyMap LayoutColumns
257         {
258             get
259             {
260                 return (PropertyMap)GetValue(LayoutColumnsProperty);
261             }
262             set
263             {
264                 SetValue(LayoutColumnsProperty, value);
265                 NotifyPropertyChanged();
266             }
267         }
268
269
270         /// <summary>
271         /// Adds a child to the table.<br />
272         /// If the row or column index is outside the table, the table gets resized bigger.<br />
273         /// </summary>
274         /// <param name="child">The child to add.</param>
275         /// <param name="position">The position for the child.</param>
276         /// <returns>True if the addition succeeded, and false if the cell is already occupied.</returns>
277         /// <since_tizen> 3 </since_tizen>
278         public bool AddChild(View child, TableView.CellPosition position)
279         {
280             bool ret = NDalicPINVOKE.TableView_AddChild(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
281             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282             return ret;
283         }
284
285         /// <summary>
286         /// Returns a child from the given layout position.
287         /// </summary>
288         /// <param name="position">The position in the table.</param>
289         /// <returns>Child that was in the cell or an uninitialized handle.</returns>
290         /// <since_tizen> 3 </since_tizen>
291         public View GetChildAt(TableView.CellPosition position)
292         {
293             //to fix memory leak issue, match the handle count with native side.
294             IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
295             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
296             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
297             NDalicPINVOKE.delete_BaseHandle(CPtr);
298             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
299
300             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301             return ret;
302         }
303
304         /// <summary>
305         /// Removes a child from the given layout position.
306         /// </summary>
307         /// <param name="position">The position for the child to remove.</param>
308         /// <returns>Child that was removed or an uninitialized handle.</returns>
309         /// <since_tizen> 3 </since_tizen>
310         public View RemoveChildAt(TableView.CellPosition position)
311         {
312             //to fix memory leak issue, match the handle count with native side.
313             IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
314             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
315             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
316             NDalicPINVOKE.delete_BaseHandle(CPtr);
317             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
318
319             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320             return ret;
321         }
322
323         /// <summary>
324         /// Finds the child's layout position.
325         /// </summary>
326         /// <param name="child">The child to search for.</param>
327         /// <param name="position">The position for the child.</param>
328         /// <returns>True if the child was included in this TableView.</returns>
329         /// <since_tizen> 3 </since_tizen>
330         public bool FindChildPosition(View child, TableView.CellPosition position)
331         {
332             bool ret = NDalicPINVOKE.TableView_FindChildPosition(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334             return ret;
335         }
336
337         /// <summary>
338         /// Inserts a new row to the given index.
339         /// </summary>
340         /// <param name="rowIndex">The rowIndex of the new row.</param>
341         /// <since_tizen> 3 </since_tizen>
342         public void InsertRow(uint rowIndex)
343         {
344             NDalicPINVOKE.TableView_InsertRow(swigCPtr, rowIndex);
345             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346         }
347
348         /// <summary>
349         /// Deletes a row from the given index.<br />
350         /// Removed elements are deleted.<br />
351         /// </summary>
352         /// <param name="rowIndex">The rowIndex of the row to delete.</param>
353         /// <since_tizen> 3 </since_tizen>
354         public void DeleteRow(uint rowIndex)
355         {
356             NDalicPINVOKE.TableView_DeleteRow__SWIG_0(swigCPtr, rowIndex);
357             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358         }
359
360         /// <summary>
361         /// Inserts a new column to the given index.
362         /// </summary>
363         /// <param name="columnIndex">The columnIndex of the new column.</param>
364         /// <since_tizen> 3 </since_tizen>
365         public void InsertColumn(uint columnIndex)
366         {
367             NDalicPINVOKE.TableView_InsertColumn(swigCPtr, columnIndex);
368             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369         }
370
371         /// <summary>
372         /// Deletes a column from the given index.<br />
373         /// Removed elements are deleted.<br />
374         /// </summary>
375         /// <param name="columnIndex">The columnIndex of the column to delete.</param>
376         /// <since_tizen> 3 </since_tizen>
377         public void DeleteColumn(uint columnIndex)
378         {
379             NDalicPINVOKE.TableView_DeleteColumn__SWIG_0(swigCPtr, columnIndex);
380             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
381         }
382
383         /// <summary>
384         /// Resizes the TableView.
385         /// </summary>
386         /// <param name="rows">The rows for the table.</param>
387         /// <param name="columns">The columns for the table.</param>
388         /// <since_tizen> 3 </since_tizen>
389         public void Resize(uint rows, uint columns)
390         {
391             NDalicPINVOKE.TableView_Resize__SWIG_0(swigCPtr, rows, columns);
392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393         }
394
395         /// <summary>
396         /// Sets the horizontal and the vertical padding between cells.
397         /// </summary>
398         /// <param name="padding">Width and height.</param>
399         /// <since_tizen> 3 </since_tizen>
400         public void SetCellPadding(Size2D padding)
401         {
402             NDalicPINVOKE.TableView_SetCellPadding(swigCPtr, Size2D.getCPtr(padding));
403             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404         }
405
406         /// <summary>
407         /// Gets the current padding as width and height.
408         /// </summary>
409         /// <returns>The current padding as width and height.</returns>
410         /// <since_tizen> 3 </since_tizen>
411         public Vector2 GetCellPadding()
412         {
413             Vector2 ret = new Vector2(NDalicPINVOKE.TableView_GetCellPadding(swigCPtr), true);
414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415             return ret;
416         }
417
418         /// <summary>
419         /// Specifies this row as fitting its height to its children.
420         /// </summary>
421         /// <param name="rowIndex">The row to set.</param>
422         /// <since_tizen> 3 </since_tizen>
423         public void SetFitHeight(uint rowIndex)
424         {
425             NDalicPINVOKE.TableView_SetFitHeight(swigCPtr, rowIndex);
426             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427         }
428
429         /// <summary>
430         /// Checks if the row is a fit row.
431         /// </summary>
432         /// <param name="rowIndex">The row to check.</param>
433         /// <returns>True if the row is fit.</returns>
434         /// <since_tizen> 3 </since_tizen>
435         public bool IsFitHeight(uint rowIndex)
436         {
437             bool ret = NDalicPINVOKE.TableView_IsFitHeight(swigCPtr, rowIndex);
438             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439             return ret;
440         }
441
442         /// <summary>
443         /// Specifies this column as fitting its width to its children.
444         /// </summary>
445         /// <param name="columnIndex">The column to set.</param>
446         /// <since_tizen> 3 </since_tizen>
447         public void SetFitWidth(uint columnIndex)
448         {
449             NDalicPINVOKE.TableView_SetFitWidth(swigCPtr, columnIndex);
450             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451         }
452
453         /// <summary>
454         /// Checks if the column is a fit column.
455         /// </summary>
456         /// <param name="columnIndex">The column to check.</param>
457         /// <returns>True if the column is fit.</returns>
458         /// <since_tizen> 3 </since_tizen>
459         public bool IsFitWidth(uint columnIndex)
460         {
461             bool ret = NDalicPINVOKE.TableView_IsFitWidth(swigCPtr, columnIndex);
462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463             return ret;
464         }
465
466         /// <summary>
467         /// Sets a row to have a fixed height.<br />
468         /// Setting a fixed height of 0 has no effect.<br />
469         /// </summary>
470         /// <param name="rowIndex">The rowIndex for row with a fixed height.</param>
471         /// <param name="height">The height in world coordinate units.</param>
472         /// <since_tizen> 3 </since_tizen>
473         public void SetFixedHeight(uint rowIndex, float height)
474         {
475             NDalicPINVOKE.TableView_SetFixedHeight(swigCPtr, rowIndex, height);
476             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477         }
478
479         /// <summary>
480         /// Gets a row's fixed height.
481         /// </summary>
482         /// <param name="rowIndex">The row index with a fixed height.</param>
483         /// <returns>height The height in world coordinate units.</returns>
484         /// <since_tizen> 3 </since_tizen>
485         public float GetFixedHeight(uint rowIndex)
486         {
487             float ret = NDalicPINVOKE.TableView_GetFixedHeight(swigCPtr, rowIndex);
488             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
489             return ret;
490         }
491
492         /// <summary>
493         /// Sets a row to have a relative height. Relative height means percentage of
494         /// the remainder of the table height after subtracting padding and fixed height rows.<br />
495         /// Setting a relative height of 0 has no effect.<br />
496         /// </summary>
497         /// <param name="rowIndex">The rowIndex for row with a relative height.</param>
498         /// <param name="heightPercentage">The height percentage between 0.0f and 1.0f.</param>
499         /// <since_tizen> 3 </since_tizen>
500         public void SetRelativeHeight(uint rowIndex, float heightPercentage)
501         {
502             NDalicPINVOKE.TableView_SetRelativeHeight(swigCPtr, rowIndex, heightPercentage);
503             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504         }
505
506         /// <summary>
507         /// Gets a row's relative height.
508         /// </summary>
509         /// <param name="rowIndex">The row index with a relative height.</param>
510         /// <returns>Height in percentage units, between 0.0f and 1.0f.</returns>
511         /// <since_tizen> 3 </since_tizen>
512         public float GetRelativeHeight(uint rowIndex)
513         {
514             float ret = NDalicPINVOKE.TableView_GetRelativeHeight(swigCPtr, rowIndex);
515             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516             return ret;
517         }
518
519         /// <summary>
520         /// Sets a column to have a fixed width.<br />
521         /// Setting a fixed width of 0 has no effect.<br />
522         /// </summary>
523         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
524         /// <param name="width">The width in world coordinate units.</param>
525         /// <since_tizen> 3 </since_tizen>
526         public void SetFixedWidth(uint columnIndex, float width)
527         {
528             NDalicPINVOKE.TableView_SetFixedWidth(swigCPtr, columnIndex, width);
529             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530         }
531
532         /// <summary>
533         /// Gets a column's fixed width.
534         /// </summary>
535         /// <param name="columnIndex">The column index with a fixed width.</param>
536         /// <returns>Width in world coordinate units.</returns>
537         /// <since_tizen> 3 </since_tizen>
538         public float GetFixedWidth(uint columnIndex)
539         {
540             float ret = NDalicPINVOKE.TableView_GetFixedWidth(swigCPtr, columnIndex);
541             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542             return ret;
543         }
544
545         /// <summary>
546         /// Sets a column to have a relative width. Relative width means percentage of
547         /// the remainder of the table width after subtracting padding and fixed width columns.<br />
548         /// Setting a relative width of 0 has no effect.<br />
549         /// </summary>
550         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
551         /// <param name="widthPercentage">The widthPercentage between 0.0f and 1.0f.</param>
552         /// <since_tizen> 3 </since_tizen>
553         public void SetRelativeWidth(uint columnIndex, float widthPercentage)
554         {
555             NDalicPINVOKE.TableView_SetRelativeWidth(swigCPtr, columnIndex, widthPercentage);
556             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557         }
558
559         /// <summary>
560         /// Gets a column's relative width.
561         /// </summary>
562         /// <param name="columnIndex">The column index with a relative width.</param>
563         /// <returns>Width in percentage units, between 0.0f and 1.0f.</returns>
564         /// <since_tizen> 3 </since_tizen>
565         public float GetRelativeWidth(uint columnIndex)
566         {
567             float ret = NDalicPINVOKE.TableView_GetRelativeWidth(swigCPtr, columnIndex);
568             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569             return ret;
570         }
571
572         /// <summary>
573         /// Sets the alignment on a cell.<br />
574         /// Cells without calling this function have the default values of left and top respectively.<br />
575         /// </summary>
576         /// <param name="position">The cell to set alignment on.</param>
577         /// <param name="horizontal">The horizontal alignment.</param>
578         /// <param name="vertical">The vertical alignment.</param>
579         /// <since_tizen> 3 </since_tizen>
580         public void SetCellAlignment(TableView.CellPosition position, HorizontalAlignmentType horizontal, VerticalAlignmentType vertical)
581         {
582             NDalicPINVOKE.TableView_SetCellAlignment(swigCPtr, TableView.CellPosition.getCPtr(position), (int)horizontal, (int)vertical);
583             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584         }
585
586         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TableView obj)
587         {
588             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
589         }
590
591         /// <summary>
592         /// Dispose
593         /// </summary>
594         /// <param name="type">The dispose type</param>
595         /// <since_tizen> 3 </since_tizen>
596         protected override void Dispose(DisposeTypes type)
597         {
598             if (disposed)
599             {
600                 return;
601             }
602
603             if (type == DisposeTypes.Explicit)
604             {
605                 //Called by User
606                 //Release your own managed resources here.
607                 //You should release all of your own disposable objects here.
608             }
609
610             //Release your own unmanaged resources here.
611             //You should not access any managed member here except static instance.
612             //because the execution order of Finalizes is non-deterministic.
613
614             if (swigCPtr.Handle != global::System.IntPtr.Zero)
615             {
616                 if (swigCMemOwn)
617                 {
618                     swigCMemOwn = false;
619                     NDalicPINVOKE.delete_TableView(swigCPtr);
620                 }
621                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
622             }
623
624             base.Dispose(type);
625         }
626
627         /// <summary>
628         /// Class to specify the layout position for the child view.
629         /// </summary>
630         /// <since_tizen> 3 </since_tizen>
631         public class CellPosition : global::System.IDisposable
632         {
633             /// <summary>
634             /// swigCMemOwn
635             /// </summary>
636             /// <since_tizen> 3 </since_tizen>
637             protected bool swigCMemOwn;
638             /// <summary>
639             /// A Flat to check if it is already disposed.
640             /// </summary>
641             /// <since_tizen> 3 </since_tizen>
642             protected bool disposed = false;
643
644             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
645             //A Flag to check who called Dispose(). (By User or DisposeQueue)
646             private bool isDisposeQueued = false;
647
648             /// <summary>
649             /// The constructor.
650             /// </summary>
651             /// <param name="rowIndex">The row index initialized.</param>
652             /// <param name="columnIndex">The column index initialized.</param>
653             /// <param name="rowSpan">The row span initialized.</param>
654             /// <param name="columnSpan">The column span initialized.</param>
655             /// <since_tizen> 3 </since_tizen>
656             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true)
657             {
658                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659             }
660
661             /// <summary>
662             /// The constructor to initialize values to defaults for convenience.
663             /// </summary>
664             /// <param name="rowIndex">The row index initialized.</param>
665             /// <param name="columnIndex">The column index initialized.</param>
666             /// <param name="rowSpan">The row span initialized.</param>
667             /// <since_tizen> 3 </since_tizen>
668             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true)
669             {
670                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671             }
672
673             /// <summary>
674             /// The constructor to initialize values to defaults for convenience.
675             /// </summary>
676             /// <param name="rowIndex">The row index initialized.</param>
677             /// <param name="columnIndex">The column index initialized.</param>
678             /// <since_tizen> 3 </since_tizen>
679             public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true)
680             {
681                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
682             }
683
684             /// <summary>
685             /// The constructor to initialize values to default for convenience.
686             /// </summary>
687             /// <param name="rowIndex">The row index initialized.</param>
688             /// <since_tizen> 3 </since_tizen>
689             public CellPosition(uint rowIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_3(rowIndex), true)
690             {
691                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692             }
693
694             /// <summary>
695             /// The default constructor.
696             /// </summary>
697             /// <since_tizen> 3 </since_tizen>
698             public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true)
699             {
700                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
701             }
702
703             internal CellPosition(global::System.IntPtr cPtr, bool cMemoryOwn)
704             {
705                 swigCMemOwn = cMemoryOwn;
706                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
707             }
708
709             /// <summary>
710             /// Dispose.
711             /// </summary>
712             /// <since_tizen> 3 </since_tizen>
713             ~CellPosition()
714             {
715                 if (!isDisposeQueued)
716                 {
717                     isDisposeQueued = true;
718                     DisposeQueue.Instance.Add(this);
719                 }
720             }
721
722             /// <summary>
723             /// The index of a row.
724             /// </summary>
725             /// <since_tizen> 3 </since_tizen>
726             [Obsolete("Please do not use! This will be deprecated! Please use RowIndex instead!")]
727             [EditorBrowsable(EditorBrowsableState.Never)]
728             public uint rowIndex
729             {
730                 set
731                 {
732                     NDalicPINVOKE.TableView_CellPosition_rowIndex_set(swigCPtr, value);
733                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
734                 }
735                 get
736                 {
737                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr);
738                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739                     return ret;
740                 }
741             }
742
743             /// <summary>
744             /// The index or position of a row.
745             /// </summary>
746             /// <since_tizen> 5 </since_tizen>
747             public uint RowIndex
748             {
749                 get
750                 {
751                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr);
752                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753                     return ret;
754                 }
755             }
756
757
758             /// <summary>
759             /// The index of a column.
760             /// </summary>
761             /// <since_tizen> 3 </since_tizen>
762             [Obsolete("Please do not use! This will be deprecated! Please use ColumnIndex instead!")]
763             [EditorBrowsable(EditorBrowsableState.Never)]
764             public uint columnIndex
765             {
766                 set
767                 {
768                     NDalicPINVOKE.TableView_CellPosition_columnIndex_set(swigCPtr, value);
769                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770                 }
771                 get
772                 {
773                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr);
774                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775                     return ret;
776                 }
777             }
778
779             /// <summary>
780             /// The index or position of a column.
781             /// </summary>
782             /// <since_tizen> 5 </since_tizen>
783             public uint ColumnIndex
784             {
785                 get
786                 {
787                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr);
788                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
789                     return ret;
790                 }
791             }
792
793             /// <summary>
794             /// The span of a row.
795             /// </summary>
796             /// <since_tizen> 3 </since_tizen>
797             [Obsolete("Please do not use! This will be deprecated! Please use RowSpan instead!")]
798             [EditorBrowsable(EditorBrowsableState.Never)]
799             public uint rowSpan
800             {
801                 set
802                 {
803                     NDalicPINVOKE.TableView_CellPosition_rowSpan_set(swigCPtr, value);
804                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
805                 }
806                 get
807                 {
808                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr);
809                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810                     return ret;
811                 }
812             }
813
814             /// <summary>
815             /// The span of a row.
816             /// </summary>
817             /// <since_tizen> 5 </since_tizen>
818             public uint RowSpan
819             {
820                 get
821                 {
822                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr);
823                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
824                     return ret;
825                 }
826             }
827
828             /// <summary>
829             /// The span of a column.
830             /// </summary>
831             /// <since_tizen> 3 </since_tizen>
832             [Obsolete("Please do not use! This will be deprecated! Please use ColumnSpan instead!")]
833             [EditorBrowsable(EditorBrowsableState.Never)]
834             public uint columnSpan
835             {
836                 set
837                 {
838                     NDalicPINVOKE.TableView_CellPosition_columnSpan_set(swigCPtr, value);
839                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840                 }
841                 get
842                 {
843                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr);
844                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
845                     return ret;
846                 }
847             }
848
849             /// <summary>
850             /// The span of a column.
851             /// </summary>
852             /// <since_tizen> 5 </since_tizen>
853             public uint ColumnSpan
854             {
855                 get
856                 {
857                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr);
858                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859                     return ret;
860                 }
861             }
862
863
864             /// <summary>
865             /// Dispose.
866             /// </summary>
867             /// <since_tizen> 3 </since_tizen>
868             public void Dispose()
869             {
870                 //Throw excpetion if Dispose() is called in separate thread.
871                 if (!Window.IsInstalled())
872                 {
873                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
874                 }
875
876                 if (isDisposeQueued)
877                 {
878                     Dispose(DisposeTypes.Implicit);
879                 }
880                 else
881                 {
882                     Dispose(DisposeTypes.Explicit);
883                     System.GC.SuppressFinalize(this);
884                 }
885             }
886
887             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CellPosition obj)
888             {
889                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
890             }
891
892             /// <summary>
893             /// Dispose.
894             /// </summary>
895             /// <param name="type">DisposeTypes</param>
896             /// <since_tizen> 3 </since_tizen>
897             protected virtual void Dispose(DisposeTypes type)
898             {
899                 if (disposed)
900                 {
901                     return;
902                 }
903
904                 if (type == DisposeTypes.Explicit)
905                 {
906                     //Called by User
907                     //Release your own managed resources here.
908                     //You should release all of your own disposable objects here.
909                 }
910
911                 //Release your own unmanaged resources here.
912                 //You should not access any managed member here except static instance.
913                 //because the execution order of Finalizes is non-deterministic.
914
915                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
916                 {
917                     if (swigCMemOwn)
918                     {
919                         swigCMemOwn = false;
920                         NDalicPINVOKE.delete_TableView_CellPosition(swigCPtr);
921                     }
922                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
923                 }
924                 disposed = true;
925             }
926
927         }
928
929         internal new class Property
930         {
931             internal static readonly int ROWS = NDalicPINVOKE.TableView_Property_ROWS_get();
932             internal static readonly int COLUMNS = NDalicPINVOKE.TableView_Property_COLUMNS_get();
933             internal static readonly int CELL_PADDING = NDalicPINVOKE.TableView_Property_CELL_PADDING_get();
934             internal static readonly int LAYOUT_ROWS = NDalicPINVOKE.TableView_Property_LAYOUT_ROWS_get();
935             internal static readonly int LAYOUT_COLUMNS = NDalicPINVOKE.TableView_Property_LAYOUT_COLUMNS_get();
936         }
937
938         internal class ChildProperty
939         {
940             internal static readonly int CELL_INDEX = NDalicPINVOKE.TableView_ChildProperty_CELL_INDEX_get();
941             internal static readonly int ROW_SPAN = NDalicPINVOKE.TableView_ChildProperty_ROW_SPAN_get();
942             internal static readonly int COLUMN_SPAN = NDalicPINVOKE.TableView_ChildProperty_COLUMN_SPAN_get();
943             internal static readonly int CELL_HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_HORIZONTAL_ALIGNMENT_get();
944             internal static readonly int CELL_VERTICAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_VERTICAL_ALIGNMENT_get();
945         }
946     }
947 }