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