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