Release 4.0.0-preview1-00271
[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 constraints the X and the Y position and the width and the height of the child actors.<br>
25     /// The Z position and depth are left intact so that the 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 new 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 the layout position for the 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             /// The 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             /// <since_tizen> 3 </since_tizen>
182             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true)
183             {
184                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185             }
186
187             /// <summary>
188             /// The constructor to initialize values to defaults for convenience.
189             /// </summary>
190             /// <param name="rowIndex">The row index initialized.</param>
191             /// <param name="columnIndex">The column index initialized.</param>
192             /// <param name="rowSpan">The row span initialized.</param>
193             /// <since_tizen> 3 </since_tizen>
194             public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true)
195             {
196                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197             }
198
199             /// <summary>
200             /// The constructor to initialize values to defaults for convenience.
201             /// </summary>
202             /// <param name="rowIndex">The row index initialized.</param>
203             /// <param name="columnIndex">The column index initialized.</param>
204             /// <since_tizen> 3 </since_tizen>
205             public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true)
206             {
207                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208             }
209
210             /// <summary>
211             /// The constructor to initialize values to default for convenience.
212             /// </summary>
213             /// <param name="rowIndex">The row index initialized.</param>
214             /// <since_tizen> 3 </since_tizen>
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             /// The default constructor.
222             /// </summary>
223             /// <since_tizen> 3 </since_tizen>
224             public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true)
225             {
226                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227             }
228
229             /// <summary>
230             /// The index of a row.
231             /// </summary>
232             /// <since_tizen> 3 </since_tizen>
233             public uint rowIndex
234             {
235                 set
236                 {
237                     NDalicPINVOKE.TableView_CellPosition_rowIndex_set(swigCPtr, value);
238                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239                 }
240                 get
241                 {
242                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr);
243                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244                     return ret;
245                 }
246             }
247
248             /// <summary>
249             /// The index of a column.
250             /// </summary>
251             /// <since_tizen> 3 </since_tizen>
252             public uint columnIndex
253             {
254                 set
255                 {
256                     NDalicPINVOKE.TableView_CellPosition_columnIndex_set(swigCPtr, value);
257                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258                 }
259                 get
260                 {
261                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr);
262                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263                     return ret;
264                 }
265             }
266
267             /// <summary>
268             /// The span of a row.
269             /// </summary>
270             /// <since_tizen> 3 </since_tizen>
271             public uint rowSpan
272             {
273                 set
274                 {
275                     NDalicPINVOKE.TableView_CellPosition_rowSpan_set(swigCPtr, value);
276                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277                 }
278                 get
279                 {
280                     uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr);
281                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282                     return ret;
283                 }
284             }
285
286             /// <summary>
287             /// The span of a column.
288             /// </summary>
289             /// <since_tizen> 3 </since_tizen>
290             public uint columnSpan
291             {
292                 set
293                 {
294                     NDalicPINVOKE.TableView_CellPosition_columnSpan_set(swigCPtr, value);
295                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296                 }
297                 get
298                 {
299                     uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr);
300                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301                     return ret;
302                 }
303             }
304
305         }
306
307         /// <summary>
308         /// Creates the TableView view.
309         /// </summary>
310         /// <param name="initialRows">Initial rows for the table.</param>
311         /// <param name="initialColumns">Initial columns for the table.</param>
312         /// <since_tizen> 3 </since_tizen>
313         public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true)
314         {
315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316
317         }
318
319         /// <summary>
320         /// The Copy constructor. Creates another handle that points to the same real object.
321         /// </summary>
322         /// <param name="handle">Handle to copy from.</param>
323         /// <since_tizen> 3 </since_tizen>
324         public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true)
325         {
326             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327         }
328
329         [Obsolete("Please do not use! this will be deprecated")]
330         public new static TableView DownCast(BaseHandle handle)
331         {
332             TableView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TableView;
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334             return ret;
335         }
336
337         /// <summary>
338         /// Adds a child to the table.<br>
339         /// If the row or column index is outside the table, the table gets resized bigger.<br>
340         /// </summary>
341         /// <param name="child">The child to add.</param>
342         /// <param name="position">The position for the child.</param>
343         /// <returns>True if the addition succeeded, and false if the cell is already occupied.</returns>
344         /// <since_tizen> 3 </since_tizen>
345         public bool AddChild(View child, TableView.CellPosition position)
346         {
347             bool ret = NDalicPINVOKE.TableView_AddChild(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
348             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349             return ret;
350         }
351
352         /// <summary>
353         /// Returns a child from the given layout position.
354         /// </summary>
355         /// <param name="position">The position in the table.</param>
356         /// <returns>Child that was in the cell or an uninitialized handle.</returns>
357         /// <since_tizen> 3 </since_tizen>
358         public View GetChildAt(TableView.CellPosition position)
359         {
360             IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
361             View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
362
363             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364             return ret;
365         }
366
367         /// <summary>
368         /// Removes a child from the given layout position.
369         /// </summary>
370         /// <param name="position">The position for the child to remove.</param>
371         /// <returns>Child that was removed or an uninitialized handle.</returns>
372         /// <since_tizen> 3 </since_tizen>
373         public View RemoveChildAt(TableView.CellPosition position)
374         {
375             IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
376             View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
377
378             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379             return ret;
380         }
381
382         /// <summary>
383         /// Finds the child's layout position.
384         /// </summary>
385         /// <param name="child">The child to search for.</param>
386         /// <param name="position">The position for the child.</param>
387         /// <returns>True if the child was included in this TableView.</returns>
388         /// <since_tizen> 3 </since_tizen>
389         public bool FindChildPosition(View child, TableView.CellPosition position)
390         {
391             bool ret = NDalicPINVOKE.TableView_FindChildPosition(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position));
392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393             return ret;
394         }
395
396         /// <summary>
397         /// Inserts a new row to the given index.
398         /// </summary>
399         /// <param name="rowIndex">The rowIndex of the new row.</param>
400         /// <since_tizen> 3 </since_tizen>
401         public void InsertRow(uint rowIndex)
402         {
403             NDalicPINVOKE.TableView_InsertRow(swigCPtr, rowIndex);
404             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405         }
406
407         /// <summary>
408         /// Deletes a row from the given index.<br>
409         /// Removed elements are deleted.<br>
410         /// </summary>
411         /// <param name="rowIndex">The rowIndex of the row to delete.</param>
412         /// <since_tizen> 3 </since_tizen>
413         public void DeleteRow(uint rowIndex)
414         {
415             NDalicPINVOKE.TableView_DeleteRow__SWIG_0(swigCPtr, rowIndex);
416             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417         }
418
419         /// <summary>
420         /// Inserts a new column to the given index.
421         /// </summary>
422         /// <param name="columnIndex">The columnIndex of the new column.</param>
423         /// <since_tizen> 3 </since_tizen>
424         public void InsertColumn(uint columnIndex)
425         {
426             NDalicPINVOKE.TableView_InsertColumn(swigCPtr, columnIndex);
427             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428         }
429
430         /// <summary>
431         /// Deletes a column from the given index.<br>
432         /// Removed elements are deleted.<br>
433         /// </summary>
434         /// <param name="columnIndex">The columnIndex of the column to delete.</param>
435         /// <since_tizen> 3 </since_tizen>
436         public void DeleteColumn(uint columnIndex)
437         {
438             NDalicPINVOKE.TableView_DeleteColumn__SWIG_0(swigCPtr, columnIndex);
439             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440         }
441
442         /// <summary>
443         /// Resizes the TableView.
444         /// </summary>
445         /// <param name="rows">The rows for the table.</param>
446         /// <param name="columns">The columns for the table.</param>
447         /// <since_tizen> 3 </since_tizen>
448         public void Resize(uint rows, uint columns)
449         {
450             NDalicPINVOKE.TableView_Resize__SWIG_0(swigCPtr, rows, columns);
451             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452         }
453
454         /// <summary>
455         /// Sets the horizontal and the vertical padding between cells.
456         /// </summary>
457         /// <param name="padding">Width and height.</param>
458         /// <since_tizen> 3 </since_tizen>
459         public void SetCellPadding(Size2D padding)
460         {
461             NDalicPINVOKE.TableView_SetCellPadding(swigCPtr, Size2D.getCPtr(padding));
462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463         }
464
465         /// <summary>
466         /// Gets the current padding as width and height.
467         /// </summary>
468         /// <returns>The current padding as width and height.</returns>
469         /// <since_tizen> 3 </since_tizen>
470         public Vector2 GetCellPadding()
471         {
472             Vector2 ret = new Vector2(NDalicPINVOKE.TableView_GetCellPadding(swigCPtr), true);
473             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474             return ret;
475         }
476
477         /// <summary>
478         /// Specifies this row as fitting its height to its children.
479         /// </summary>
480         /// <param name="rowIndex">The row to set.</param>
481         /// <since_tizen> 3 </since_tizen>
482         public void SetFitHeight(uint rowIndex)
483         {
484             NDalicPINVOKE.TableView_SetFitHeight(swigCPtr, rowIndex);
485             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486         }
487
488         /// <summary>
489         /// Checks if the row is a fit row.
490         /// </summary>
491         /// <param name="rowIndex">The row to check.</param>
492         /// <returns>True if the row is fit.</returns>
493         /// <since_tizen> 3 </since_tizen>
494         public bool IsFitHeight(uint rowIndex)
495         {
496             bool ret = NDalicPINVOKE.TableView_IsFitHeight(swigCPtr, rowIndex);
497             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498             return ret;
499         }
500
501         /// <summary>
502         /// Specifies this column as fitting its width to its children.
503         /// </summary>
504         /// <param name="columnIndex">The column to set.</param>
505         /// <since_tizen> 3 </since_tizen>
506         public void SetFitWidth(uint columnIndex)
507         {
508             NDalicPINVOKE.TableView_SetFitWidth(swigCPtr, columnIndex);
509             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510         }
511
512         /// <summary>
513         /// Checks if the column is a fit column.
514         /// </summary>
515         /// <param name="columnIndex">The column to check.</param>
516         /// <returns>True if the column is fit.</returns>
517         /// <since_tizen> 3 </since_tizen>
518         public bool IsFitWidth(uint columnIndex)
519         {
520             bool ret = NDalicPINVOKE.TableView_IsFitWidth(swigCPtr, columnIndex);
521             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522             return ret;
523         }
524
525         /// <summary>
526         /// Sets a row to have a fixed height.<br>
527         /// Setting a fixed height of 0 has no effect.<br>
528         /// </summary>
529         /// <param name="rowIndex">The rowIndex for row with a fixed height.</param>
530         /// <param name="height">The height in world coordinate units.</param>
531         /// <since_tizen> 3 </since_tizen>
532         public void SetFixedHeight(uint rowIndex, float height)
533         {
534             NDalicPINVOKE.TableView_SetFixedHeight(swigCPtr, rowIndex, height);
535             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536         }
537
538         /// <summary>
539         /// Gets a row's fixed height.
540         /// </summary>
541         /// <param name="rowIndex">The row index with a fixed height.</param>
542         /// <returns>height The height in world coordinate units.</returns>
543         /// <since_tizen> 3 </since_tizen>
544         public float GetFixedHeight(uint rowIndex)
545         {
546             float ret = NDalicPINVOKE.TableView_GetFixedHeight(swigCPtr, rowIndex);
547             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548             return ret;
549         }
550
551         /// <summary>
552         /// Sets a row to have a relative height. Relative height means percentage of
553         /// the remainder of the table height after subtracting padding and fixed height rows.<br>
554         /// Setting a relative height of 0 has no effect.<br>
555         /// </summary>
556         /// <param name="rowIndex">The rowIndex for row with a relative height.</param>
557         /// <param name="heightPercentage">The height percentage between 0.0f and 1.0f.</param>
558         /// <since_tizen> 3 </since_tizen>
559         public void SetRelativeHeight(uint rowIndex, float heightPercentage)
560         {
561             NDalicPINVOKE.TableView_SetRelativeHeight(swigCPtr, rowIndex, heightPercentage);
562             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563         }
564
565         /// <summary>
566         /// Gets a row's relative height.
567         /// </summary>
568         /// <param name="rowIndex">The row index with a relative height.</param>
569         /// <returns>Height in percentage units, between 0.0f and 1.0f.</returns>
570         /// <since_tizen> 3 </since_tizen>
571         public float GetRelativeHeight(uint rowIndex)
572         {
573             float ret = NDalicPINVOKE.TableView_GetRelativeHeight(swigCPtr, rowIndex);
574             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575             return ret;
576         }
577
578         /// <summary>
579         /// Sets a column to have a fixed width.<br>
580         /// Setting a fixed width of 0 has no effect.<br>
581         /// </summary>
582         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
583         /// <param name="width">The width in world coordinate units.</param>
584         /// <since_tizen> 3 </since_tizen>
585         public void SetFixedWidth(uint columnIndex, float width)
586         {
587             NDalicPINVOKE.TableView_SetFixedWidth(swigCPtr, columnIndex, width);
588             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589         }
590
591         /// <summary>
592         /// Gets a column's fixed width.
593         /// </summary>
594         /// <param name="columnIndex">The column index with a fixed width.</param>
595         /// <returns>Width in world coordinate units.</returns>
596         /// <since_tizen> 3 </since_tizen>
597         public float GetFixedWidth(uint columnIndex)
598         {
599             float ret = NDalicPINVOKE.TableView_GetFixedWidth(swigCPtr, columnIndex);
600             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
601             return ret;
602         }
603
604         /// <summary>
605         /// Sets a column to have a relative width. Relative width means percentage of
606         /// the remainder of the table width after subtracting padding and fixed width columns.<br>
607         /// Setting a relative width of 0 has no effect.<br>
608         /// </summary>
609         /// <param name="columnIndex">The columnIndex for column with a fixed width.</param>
610         /// <param name="widthPercentage">The widthPercentage between 0.0f and 1.0f.</param>
611         /// <since_tizen> 3 </since_tizen>
612         public void SetRelativeWidth(uint columnIndex, float widthPercentage)
613         {
614             NDalicPINVOKE.TableView_SetRelativeWidth(swigCPtr, columnIndex, widthPercentage);
615             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616         }
617
618         /// <summary>
619         /// Gets a column's relative width.
620         /// </summary>
621         /// <param name="columnIndex">The column index with a relative width.</param>
622         /// <returns>Width in percentage units, between 0.0f and 1.0f.</returns>
623         /// <since_tizen> 3 </since_tizen>
624         public float GetRelativeWidth(uint columnIndex)
625         {
626             float ret = NDalicPINVOKE.TableView_GetRelativeWidth(swigCPtr, columnIndex);
627             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628             return ret;
629         }
630
631         /// <summary>
632         /// Sets the alignment on a cell.<br>
633         /// Cells without calling this function have the default values of left and top respectively.<br>
634         /// </summary>
635         /// <param name="position">The cell to set alignment on.</param>
636         /// <param name="horizontal">The horizontal alignment.</param>
637         /// <param name="vertical">The vertical alignment.</param>
638         /// <since_tizen> 3 </since_tizen>
639         public void SetCellAlignment(TableView.CellPosition position, HorizontalAlignmentType horizontal, VerticalAlignmentType vertical)
640         {
641             NDalicPINVOKE.TableView_SetCellAlignment(swigCPtr, TableView.CellPosition.getCPtr(position), (int)horizontal, (int)vertical);
642             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643         }
644
645         /// <summary>
646         /// Enumeration for describing how the size of a row or column has been set.
647         /// </summary>
648         /// <since_tizen> 3 </since_tizen>
649         public enum LayoutPolicy
650         {
651             Fixed,
652             Relative,
653             Fill,
654             Fit
655         }
656
657         /// <summary>
658         /// The amount of rows in the table.
659         /// </summary>
660         /// <since_tizen> 3 </since_tizen>
661         public int Rows
662         {
663             get
664             {
665                 int temp = 0;
666                 GetProperty(TableView.Property.ROWS).Get(out temp);
667                 return temp;
668             }
669             set
670             {
671                 SetProperty(TableView.Property.ROWS, new Tizen.NUI.PropertyValue(value));
672             }
673         }
674         /// <summary>
675         /// The amount of columns in the table.
676         /// </summary>
677         /// <since_tizen> 3 </since_tizen>
678         public int Columns
679         {
680             get
681             {
682                 int temp = 0;
683                 GetProperty(TableView.Property.COLUMNS).Get(out temp);
684                 return temp;
685             }
686             set
687             {
688                 SetProperty(TableView.Property.COLUMNS, new Tizen.NUI.PropertyValue(value));
689             }
690         }
691         /// <summary>
692         /// Padding between cells.
693         /// </summary>
694         /// <since_tizen> 3 </since_tizen>
695         public Vector2 CellPadding
696         {
697             get
698             {
699                 Vector2 temp = new Vector2(0.0f, 0.0f);
700                 GetProperty(TableView.Property.CELL_PADDING).Get(temp);
701                 return temp;
702             }
703             set
704             {
705                 SetProperty(TableView.Property.CELL_PADDING, new Tizen.NUI.PropertyValue(value));
706             }
707         }
708
709         /// <summary>
710         /// The number of layout rows.
711         /// </summary>
712         /// <since_tizen> 3 </since_tizen>
713         public PropertyMap LayoutRows
714         {
715             get
716             {
717                 PropertyMap temp = new PropertyMap();
718                 GetProperty(TableView.Property.LAYOUT_ROWS).Get(temp);
719                 return temp;
720             }
721             set
722             {
723                 SetProperty(TableView.Property.LAYOUT_ROWS, new Tizen.NUI.PropertyValue(value));
724             }
725         }
726
727         /// <summary>
728         /// The number of layout columns.
729         /// </summary>
730         /// <since_tizen> 3 </since_tizen>
731         public PropertyMap LayoutColumns
732         {
733             get
734             {
735                 PropertyMap temp = new PropertyMap();
736                 GetProperty(TableView.Property.LAYOUT_COLUMNS).Get(temp);
737                 return temp;
738             }
739             set
740             {
741                 SetProperty(TableView.Property.LAYOUT_COLUMNS, new Tizen.NUI.PropertyValue(value));
742             }
743         }
744
745     }
746 }