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