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