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