1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 /// TableView is a layout container for aligning child actors in a grid like layout.
31 /// TableView constrains the x and y position and width and height of the child actors.
32 /// z position and depth are left intact so that 3D model actors can also be laid out
33 /// in a grid without loosing their depth scaling.
35 public class TableView : View
37 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
39 internal TableView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TableView_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TableView obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
51 DisposeQueue.Instance.Add(this);
57 public override void Dispose()
59 if (!Stage.IsInstalled())
61 DisposeQueue.Instance.Add(this);
67 if (swigCPtr.Handle != global::System.IntPtr.Zero)
72 NDalicPINVOKE.delete_TableView(swigCPtr);
74 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 global::System.GC.SuppressFinalize(this);
82 internal class Property : global::System.IDisposable
84 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
85 protected bool swigCMemOwn;
87 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
89 swigCMemOwn = cMemoryOwn;
90 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
93 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
95 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
103 public virtual void Dispose()
107 if (swigCPtr.Handle != global::System.IntPtr.Zero)
112 NDalicPINVOKE.delete_TableView_Property(swigCPtr);
114 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
116 global::System.GC.SuppressFinalize(this);
120 public Property() : this(NDalicPINVOKE.new_TableView_Property(), true)
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 internal static readonly int ROWS = NDalicPINVOKE.TableView_Property_ROWS_get();
126 internal static readonly int COLUMNS = NDalicPINVOKE.TableView_Property_COLUMNS_get();
127 internal static readonly int CELL_PADDING = NDalicPINVOKE.TableView_Property_CELL_PADDING_get();
128 internal static readonly int LAYOUT_ROWS = NDalicPINVOKE.TableView_Property_LAYOUT_ROWS_get();
129 internal static readonly int LAYOUT_COLUMNS = NDalicPINVOKE.TableView_Property_LAYOUT_COLUMNS_get();
133 internal class ChildProperty : global::System.IDisposable
135 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
136 protected bool swigCMemOwn;
138 internal ChildProperty(global::System.IntPtr cPtr, bool cMemoryOwn)
140 swigCMemOwn = cMemoryOwn;
141 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
144 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ChildProperty obj)
146 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
154 public virtual void Dispose()
158 if (swigCPtr.Handle != global::System.IntPtr.Zero)
163 NDalicPINVOKE.delete_TableView_ChildProperty(swigCPtr);
165 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
167 global::System.GC.SuppressFinalize(this);
171 public ChildProperty() : this(NDalicPINVOKE.new_TableView_ChildProperty(), true)
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 internal static readonly int CELL_INDEX = NDalicPINVOKE.TableView_ChildProperty_CELL_INDEX_get();
177 internal static readonly int ROW_SPAN = NDalicPINVOKE.TableView_ChildProperty_ROW_SPAN_get();
178 internal static readonly int COLUMN_SPAN = NDalicPINVOKE.TableView_ChildProperty_COLUMN_SPAN_get();
179 internal static readonly int CELL_HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_HORIZONTAL_ALIGNMENT_get();
180 internal static readonly int CELL_VERTICAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_VERTICAL_ALIGNMENT_get();
185 /// Class to specify layout position for child actor.
187 public class CellPosition : global::System.IDisposable
189 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
190 protected bool swigCMemOwn;
192 internal CellPosition(global::System.IntPtr cPtr, bool cMemoryOwn)
194 swigCMemOwn = cMemoryOwn;
195 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
198 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CellPosition obj)
200 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
211 public virtual void Dispose()
215 if (swigCPtr.Handle != global::System.IntPtr.Zero)
220 NDalicPINVOKE.delete_TableView_CellPosition(swigCPtr);
222 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
224 global::System.GC.SuppressFinalize(this);
231 public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true)
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true)
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true)
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 public CellPosition(uint rowIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_3(rowIndex), true)
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 /// Constructor to initialise values to defaults for convenience.
263 public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true)
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 NDalicPINVOKE.TableView_CellPosition_rowIndex_set(swigCPtr, value);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 public uint columnIndex
293 NDalicPINVOKE.TableView_CellPosition_columnIndex_set(swigCPtr, value);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 NDalicPINVOKE.TableView_CellPosition_rowSpan_set(swigCPtr, value);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr);
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 public uint columnSpan
329 NDalicPINVOKE.TableView_CellPosition_columnSpan_set(swigCPtr, value);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 /// Creates the TableView control.
345 public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true)
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 /// Copy constructor. Creates another handle that points to the same real object.
354 public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true)
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 /// Changes this handle to point to another real object.
362 public TableView Assign(TableView handle)
364 TableView ret = new TableView(NDalicPINVOKE.TableView_Assign(swigCPtr, TableView.getCPtr(handle)), false);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// Downcasts a handle to TableView handle.
372 public new static TableView DownCast(BaseHandle handle)
374 TableView ret = new TableView(NDalicPINVOKE.TableView_DownCast(BaseHandle.getCPtr(handle)), true);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 /// Adds a child to the table.
382 public bool AddChild(Actor child, TableView.CellPosition position)
384 bool ret = NDalicPINVOKE.TableView_AddChild(swigCPtr, Actor.getCPtr(child), TableView.CellPosition.getCPtr(position));
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 /// Returns a child from the given layout position.
392 public Actor GetChildAt(TableView.CellPosition position)
394 Actor ret = new Actor(NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 /// Removes a child from the given layout position.
402 public Actor RemoveChildAt(TableView.CellPosition position)
404 Actor ret = new Actor(NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 /// Finds the child's layout position.
412 public bool FindChildPosition(Actor child, TableView.CellPosition position)
414 bool ret = NDalicPINVOKE.TableView_FindChildPosition(swigCPtr, Actor.getCPtr(child), TableView.CellPosition.getCPtr(position));
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420 /// Inserts a new row to given index.
422 public void InsertRow(uint rowIndex)
424 NDalicPINVOKE.TableView_InsertRow(swigCPtr, rowIndex);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 /// Deletes a row from the given index.
431 public void DeleteRow(uint rowIndex)
433 NDalicPINVOKE.TableView_DeleteRow__SWIG_0(swigCPtr, rowIndex);
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437 internal void DeleteRow(uint rowIndex, ActorContainer removed)
439 NDalicPINVOKE.TableView_DeleteRow__SWIG_1(swigCPtr, rowIndex, ActorContainer.getCPtr(removed));
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 /// Inserts a new column to the given index.
446 public void InsertColumn(uint columnIndex)
448 NDalicPINVOKE.TableView_InsertColumn(swigCPtr, columnIndex);
449 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 /// Deletes a column from the given index.
455 public void DeleteColumn(uint columnIndex)
457 NDalicPINVOKE.TableView_DeleteColumn__SWIG_0(swigCPtr, columnIndex);
458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461 internal void DeleteColumn(uint columnIndex, ActorContainer removed)
463 NDalicPINVOKE.TableView_DeleteColumn__SWIG_1(swigCPtr, columnIndex, ActorContainer.getCPtr(removed));
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468 /// Resizes the TableView.
470 public void Resize(uint rows, uint columns)
472 NDalicPINVOKE.TableView_Resize__SWIG_0(swigCPtr, rows, columns);
473 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 internal void Resize(uint rows, uint columns, ActorContainer removed)
478 NDalicPINVOKE.TableView_Resize__SWIG_1(swigCPtr, rows, columns, ActorContainer.getCPtr(removed));
479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483 /// Sets horizontal and vertical padding between cells.
485 public void SetCellPadding(Size2D padding)
487 NDalicPINVOKE.TableView_SetCellPadding(swigCPtr, Size2D.getCPtr(padding));
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492 /// Gets the current padding as width and height.
494 public Vector2 GetCellPadding()
496 Vector2 ret = new Vector2(NDalicPINVOKE.TableView_GetCellPadding(swigCPtr), true);
497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502 /// Specifies this row as fitting its height to its children.
504 public void SetFitHeight(uint rowIndex)
506 NDalicPINVOKE.TableView_SetFitHeight(swigCPtr, rowIndex);
507 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511 /// Checks if the row is a fit row.
513 public bool IsFitHeight(uint rowIndex)
515 bool ret = NDalicPINVOKE.TableView_IsFitHeight(swigCPtr, rowIndex);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
521 /// Specifies this column as fitting its width to its children.
523 public void SetFitWidth(uint columnIndex)
525 NDalicPINVOKE.TableView_SetFitWidth(swigCPtr, columnIndex);
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530 /// Checks if the column is a fit column.
532 public bool IsFitWidth(uint columnIndex)
534 bool ret = NDalicPINVOKE.TableView_IsFitWidth(swigCPtr, columnIndex);
535 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540 /// Sets a row to have fixed height.
542 public void SetFixedHeight(uint rowIndex, float height)
544 NDalicPINVOKE.TableView_SetFixedHeight(swigCPtr, rowIndex, height);
545 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 /// Gets a row's fixed height.
551 public float GetFixedHeight(uint rowIndex)
553 float ret = NDalicPINVOKE.TableView_GetFixedHeight(swigCPtr, rowIndex);
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559 /// Sets a row to have relative height. Relative height means percentage of
560 /// the remainder of the table height after subtracting Padding and Fixed height rows.
561 /// Setting a relative height of 0 has no effect.
563 public void SetRelativeHeight(uint rowIndex, float heightPercentage)
565 NDalicPINVOKE.TableView_SetRelativeHeight(swigCPtr, rowIndex, heightPercentage);
566 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570 /// Gets a row's relative height.
572 public float GetRelativeHeight(uint rowIndex)
574 float ret = NDalicPINVOKE.TableView_GetRelativeHeight(swigCPtr, rowIndex);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580 /// Sets a column to have fixed width.
582 public void SetFixedWidth(uint columnIndex, float width)
584 NDalicPINVOKE.TableView_SetFixedWidth(swigCPtr, columnIndex, width);
585 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 /// Gets a column's fixed width.
591 public float GetFixedWidth(uint columnIndex)
593 float ret = NDalicPINVOKE.TableView_GetFixedWidth(swigCPtr, columnIndex);
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599 /// Sets a column to have relative width. Relative width means percentage of
600 /// the remainder of table width after subtracting Padding and Fixed width columns.
601 /// Setting a relative width of 0 has no effect.
603 public void SetRelativeWidth(uint columnIndex, float widthPercentage)
605 NDalicPINVOKE.TableView_SetRelativeWidth(swigCPtr, columnIndex, widthPercentage);
606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610 /// Gets a column's relative width.
612 public float GetRelativeWidth(uint columnIndex)
614 float ret = NDalicPINVOKE.TableView_GetRelativeWidth(swigCPtr, columnIndex);
615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620 /// Gets the amount of rows in the table.
622 public uint GetRows()
624 uint ret = NDalicPINVOKE.TableView_GetRows(swigCPtr);
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 /// Gets the amount of columns in the table.
632 public uint GetColumns()
634 uint ret = NDalicPINVOKE.TableView_GetColumns(swigCPtr);
635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 /// Sets the alignment on a cell.
642 public void SetCellAlignment(TableView.CellPosition position, HorizontalAlignmentType horizontal, VerticalAlignmentType vertical)
644 NDalicPINVOKE.TableView_SetCellAlignment(swigCPtr, TableView.CellPosition.getCPtr(position), (int)horizontal, (int)vertical);
645 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648 internal enum PropertyRange
650 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
651 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000,
652 CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX,
653 CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000
659 public enum LayoutPolicy
675 GetProperty(TableView.Property.ROWS).Get(ref temp);
680 SetProperty(TableView.Property.ROWS, new Tizen.NUI.PropertyValue(value));
685 /// Columns property.
692 GetProperty(TableView.Property.COLUMNS).Get(ref temp);
697 SetProperty(TableView.Property.COLUMNS, new Tizen.NUI.PropertyValue(value));
702 /// Cell padding property.
704 public Vector2 CellPadding
708 Vector2 temp = new Vector2(0.0f, 0.0f);
709 GetProperty(TableView.Property.CELL_PADDING).Get(temp);
714 SetProperty(TableView.Property.CELL_PADDING, new Tizen.NUI.PropertyValue(value));
719 /// Layout rows property.
721 public PropertyMap LayoutRows
725 PropertyMap temp = new PropertyMap();
726 GetProperty(TableView.Property.LAYOUT_ROWS).Get(temp);
731 SetProperty(TableView.Property.LAYOUT_ROWS, new Tizen.NUI.PropertyValue(value));
736 /// Layout columns property.
738 public PropertyMap LayoutColumns
742 PropertyMap temp = new PropertyMap();
743 GetProperty(TableView.Property.LAYOUT_COLUMNS).Get(temp);
748 SetProperty(TableView.Property.LAYOUT_COLUMNS, new Tizen.NUI.PropertyValue(value));
755 /// HorizontalAlignmentType.
757 public enum HorizontalAlignmentType
765 /// VerticalAlignmentType.
767 public enum VerticalAlignmentType