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