Tizen Native API  5.5

TableView is a layout container for aligning child actors in a grid like layout. More...

Inheritance diagram for Dali::Toolkit::TableView:
Dali::Toolkit::Control Dali::CustomActor Dali::Actor Dali::Handle Dali::BaseHandle

Classes

struct  CellPosition
 Structure to specify layout position for child actor. More...
struct  ChildProperty
 Enumeration for the instance of child properties belonging to the TableView class. More...
struct  Property
 Enumeration for the instance of properties belonging to the TableView class. More...

Public Types

enum  PropertyRange
 Enumeration for the start and end property ranges for this control. More...
enum  LayoutPolicy
 Enumeration for describing how the size of a row / column has been set. More...

Public Member Functions

 TableView ()
 Creates a TableView handle; this can be initialized with TableView::New(). Calling member functions with an uninitialized handle is not allowed.
 TableView (const TableView &handle)
 Copy constructor. Creates another handle that points to the same real object.
TableViewoperator= (const TableView &handle)
 Assignment operator. Changes this handle to point to another real object.
 ~TableView ()
 Destructor.
bool AddChild (Actor child, CellPosition position)
 Adds a child to the table. If the row or column index is outside the table, the table gets resized bigger.
Actor GetChildAt (CellPosition position)
 Returns a child from the given layout position.
Actor RemoveChildAt (CellPosition position)
 Removes a child from the given layout position.
bool FindChildPosition (Actor child, CellPosition &position)
 Finds the child's layout position.
void InsertRow (unsigned int rowIndex)
 Inserts a new row to given index.
void DeleteRow (unsigned int rowIndex)
 Deletes a row from the given index. Removed elements are deleted.
void DeleteRow (unsigned int rowIndex, std::vector< Actor > &removed)
 Deletes a row from the given index.
void InsertColumn (unsigned int columnIndex)
 Inserts a new column to the given index.
void DeleteColumn (unsigned int columnIndex)
 Deletes a column from the given index. Removed elements are deleted.
void DeleteColumn (unsigned int columnIndex, std::vector< Actor > &removed)
 Deletes a column from the given index.
void Resize (unsigned int rows, unsigned int columns)
 Resizes the TableView.
void Resize (unsigned int rows, unsigned int columns, std::vector< Actor > &removed)
 Resizes the TableView.
void SetCellPadding (Size padding)
 Sets horizontal and vertical padding between cells.
Size GetCellPadding ()
 Gets the current padding as width and height.
void SetFitHeight (unsigned int rowIndex)
 Specifies this row as fitting its height to its children.
bool IsFitHeight (unsigned int rowIndex) const
 Checks if the row is a fit row.
void SetFitWidth (unsigned int columnIndex)
 Specifies this column as fitting its width to its children.
bool IsFitWidth (unsigned int columnIndex) const
 Checks if the column is a fit column.
void SetFixedHeight (unsigned int rowIndex, float height)
 Sets a row to have fixed height. Setting a fixed height of 0 has no effect.
float GetFixedHeight (unsigned int rowIndex) const
 Gets a row's fixed height.
void SetRelativeHeight (unsigned int rowIndex, float heightPercentage)
 Sets a row to have relative height. Relative height means percentage of the remainder of the table height after subtracting Padding and Fixed height rows. Setting a relative height of 0 has no effect.
float GetRelativeHeight (unsigned int rowIndex) const
 Gets a row's relative height.
void SetFixedWidth (unsigned int columnIndex, float width)
 Sets a column to have fixed width. Setting a fixed width of 0 has no effect.
float GetFixedWidth (unsigned int columnIndex) const
 Gets a column's fixed width.
void SetRelativeWidth (unsigned int columnIndex, float widthPercentage)
 Sets a column to have relative width. Relative width means percentage of the remainder of table width after subtracting Padding and Fixed width columns. Setting a relative width of 0 has no effect.
float GetRelativeWidth (unsigned int columnIndex) const
 Gets a column's relative width.
unsigned int GetRows ()
 Gets the amount of rows in the table.
unsigned int GetColumns ()
 Gets the amount of columns in the table.
void SetCellAlignment (CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical)
 Sets the alignment on a cell.

Static Public Member Functions

static TableView New (unsigned int initialRows, unsigned int initialColumns)
 Creates the TableView control.
static TableView DownCast (BaseHandle handle)
 Downcasts a handle to TableView handle.

Detailed Description

TableView is a layout container for aligning child actors in a grid like layout.

TableView constrains the x and y position and width and height of the child actors. z position and depth are left intact so that 3D model actors can also be laid out in a grid without loosing their depth scaling.

Per-child Custom properties for script supporting:

When an actor is add to the tableView through Actor::Add() instead of TableView::AddChild, the following custom properties of the actor are checked to decide the actor position inside the table.

These properties are registered dynamically to the child and is non-animatable.

| Property Name | Type | |-------------------------|-------------| | cellIndex | Vector2 | | rowSpan | float | | columnSpan | float | | cellHorizontalAlignment | string | | cellVerticalAlignment | string |

The rowSpan or columnSpan has integer value, but its type is float here due to the limitation of the builder's ability to differentiate integer and float from Json string. The available values for cellHorizontalAlignment are: left, center, right. The available values for cellVerticalAlignment are: top, center, bottom.

 "name":"gallery1",
 "type":"ImageView",
 "image": {
    "url": "{DALI_IMAGE_DIR}gallery-small-1.jpg"
  },
  "properties": {
     "cellIndex":[1,1],  // Property to specify the top-left cell this child occupies, if not set, the first available cell is used
     "rowSpan":3,        // Property to specify how many rows this child occupies, if not set, default value is 1
     "columnSpan": 2,    // Property to specify how many columns this child occupies, if nor set, default value is 1
     "cellHorizontalAlignment": "left", // Property to specify how to align horizontally inside the cells, if not set, default value is 'left'
     "cellVerticalAlignment": "center"  // Property to specify how to align vertically inside the cells, if not set, default value is 'top'
   }
Since:
2.4, DALi version 1.0.0

Member Enumeration Documentation

Enumeration for describing how the size of a row / column has been set.

Since:
2.4, DALi version 1.0.0
Enumerator:
FIXED 

Fixed with the given value.

Since:
2.4, DALi version 1.0.0
RELATIVE 

Calculated as percentage of the remainder after subtracting Padding and Fixed height/width.

Since:
2.4, DALi version 1.0.0
FILL 

Default policy, get the remainder of the 100% (after subtracting Fixed, Fit and Relative height/ width) divided evenly between 'fill' rows/columns.

Since:
2.4, DALi version 1.0.0
FIT 

Fit around its children.

Since:
2.4, DALi version 1.0.0

Enumeration for the start and end property ranges for this control.

Since:
2.4, DALi version 1.0.0
Enumerator:
PROPERTY_START_INDEX 
Since:
2.4, DALi version 1.0.0
PROPERTY_END_INDEX 

Reserve property indices.

Since:
2.4, DALi version 1.0.0
CHILD_PROPERTY_START_INDEX 
Since:
3.0, DALi version 1.1.36
CHILD_PROPERTY_END_INDEX 

Reserve child property indices.

Since:
3.0, DALi version 1.1.36

Reimplemented from Dali::Toolkit::Control.


Constructor & Destructor Documentation

Creates a TableView handle; this can be initialized with TableView::New(). Calling member functions with an uninitialized handle is not allowed.

Since:
2.4, DALi version 1.0.0

Copy constructor. Creates another handle that points to the same real object.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to copy from

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
2.4, DALi version 1.0.0

Member Function Documentation

bool Dali::Toolkit::TableView::AddChild ( Actor  child,
CellPosition  position 
)

Adds a child to the table. If the row or column index is outside the table, the table gets resized bigger.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]childThe child to add
[in]positionThe position for the child
Returns:
true if the addition succeeded, false if the cell is already occupied
Precondition:
The child actor has been initialized.
void Dali::Toolkit::TableView::DeleteColumn ( unsigned int  columnIndex)

Deletes a column from the given index. Removed elements are deleted.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe columnIndex of the column to delete
void Dali::Toolkit::TableView::DeleteColumn ( unsigned int  columnIndex,
std::vector< Actor > &  removed 
)

Deletes a column from the given index.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe columnIndex of the column to delete
[out]removedThe removed elements
void Dali::Toolkit::TableView::DeleteRow ( unsigned int  rowIndex)

Deletes a row from the given index. Removed elements are deleted.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe rowIndex of the row to delete
void Dali::Toolkit::TableView::DeleteRow ( unsigned int  rowIndex,
std::vector< Actor > &  removed 
)

Deletes a row from the given index.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe rowIndex of the row to delete
[out]removedThe removed elements

Downcasts a handle to TableView handle.

If handle points to a TableView, the downcast produces valid handle. If not, the returned handle is left uninitialized.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
Handle to a TableView or an uninitialized handle

Reimplemented from Dali::Toolkit::Control.

Finds the child's layout position.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]childThe child to search for
[out]positionThe position for the child
Returns:
true if the child was included in this TableView

Gets the current padding as width and height.

Since:
2.4, DALi version 1.0.0
Returns:
The current padding as width and height

Returns a child from the given layout position.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe position in the table
Returns:
Child that was in the cell or an uninitialized handle
Note:
If there is no child in this position this method returns an uninitialized. Actor handle

Gets the amount of columns in the table.

Since:
2.4, DALi version 1.0.0
Returns:
The amount of columns in the table
float Dali::Toolkit::TableView::GetFixedHeight ( unsigned int  rowIndex) const

Gets a row's fixed height.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe row index with fixed height
Returns:
height The height in world coordinate units
Precondition:
The row rowIndex must exist.
Note:
The returned value is valid if it has been set before.
float Dali::Toolkit::TableView::GetFixedWidth ( unsigned int  columnIndex) const

Gets a column's fixed width.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe column index with fixed width
Returns:
Width in world coordinate units
Precondition:
The column columnIndex must exist.
Note:
The returned value is valid if it has been set before.
float Dali::Toolkit::TableView::GetRelativeHeight ( unsigned int  rowIndex) const

Gets a row's relative height.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe row index with relative height
Returns:
Height in percentage units, between 0.0f and 1.0f
Precondition:
The row rowIndex must exist.
Note:
The returned value is valid if it has been set before.
float Dali::Toolkit::TableView::GetRelativeWidth ( unsigned int  columnIndex) const

Gets a column's relative width.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe column index with relative width
Returns:
Width in percentage units, between 0.0f and 1.0f
Precondition:
The column columnIndex must exist.
Note:
The returned value is valid if it has been set before.

Gets the amount of rows in the table.

Since:
2.4, DALi version 1.0.0
Returns:
The amount of rows in the table
void Dali::Toolkit::TableView::InsertColumn ( unsigned int  columnIndex)

Inserts a new column to the given index.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe columnIndex of the new column
void Dali::Toolkit::TableView::InsertRow ( unsigned int  rowIndex)

Inserts a new row to given index.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe rowIndex of the new row
bool Dali::Toolkit::TableView::IsFitHeight ( unsigned int  rowIndex) const

Checks if the row is a fit row.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe row to check
Returns:
Return true if the row is fit
bool Dali::Toolkit::TableView::IsFitWidth ( unsigned int  columnIndex) const

Checks if the column is a fit column.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe column to check
Returns:
Return true if the column is fit
static TableView Dali::Toolkit::TableView::New ( unsigned int  initialRows,
unsigned int  initialColumns 
) [static]

Creates the TableView control.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]initialRowsfor the table
[in]initialColumnsfor the table
Returns:
A handle to the TableView control
TableView& Dali::Toolkit::TableView::operator= ( const TableView handle)

Assignment operator. Changes this handle to point to another real object.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
A reference to this

Removes a child from the given layout position.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe position for the child to remove
Returns:
Child that was removed or an uninitialized handle
Note:
If there is no child in this position, this method does nothing.
void Dali::Toolkit::TableView::Resize ( unsigned int  rows,
unsigned int  columns 
)

Resizes the TableView.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowsThe rows for the table
[in]columnsThe columns for the table
Note:
If the new size is smaller than old, superfluous actors get removed. If you want to relayout removed children, use the variant that returns the removed Actors and reinsert them into the table. If an actor spans to a removed row or column, it gets removed from the table.
void Dali::Toolkit::TableView::Resize ( unsigned int  rows,
unsigned int  columns,
std::vector< Actor > &  removed 
)

Resizes the TableView.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowsThe rows for the table
[in]columnsThe columns for the table
[out]removedThe removed actor handles
Note:
If the new size is smaller than old, superfluous actors get removed. If an actor spans to a removed row or column it gets removed from the table.

Sets the alignment on a cell.

Cells without calling this function have the default values of LEFT and TOP respectively.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]positionThe cell to set alignment on
[in]horizontalThe horizontal alignment
[in]verticalThe vertical alignment

Sets horizontal and vertical padding between cells.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]paddingWidth and height
void Dali::Toolkit::TableView::SetFitHeight ( unsigned int  rowIndex)

Specifies this row as fitting its height to its children.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rowIndexThe row to set
void Dali::Toolkit::TableView::SetFitWidth ( unsigned int  columnIndex)

Specifies this column as fitting its width to its children.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]columnIndexThe column to set
void Dali::Toolkit::TableView::SetFixedHeight ( unsigned int  rowIndex,
float  height 
)

Sets a row to have fixed height. Setting a fixed height of 0 has no effect.

Since:
2.4, DALi version 1.0.0
Parameters:
rowIndexThe rowIndex for row with fixed height
heightThe height in world coordinate units
Precondition:
The row rowIndex must exist.
void Dali::Toolkit::TableView::SetFixedWidth ( unsigned int  columnIndex,
float  width 
)

Sets a column to have fixed width. Setting a fixed width of 0 has no effect.

Since:
2.4, DALi version 1.0.0
Parameters:
columnIndexThe columnIndex for column with fixed width
widthThe width in world coordinate units
Precondition:
The column columnIndex must exist.
void Dali::Toolkit::TableView::SetRelativeHeight ( unsigned int  rowIndex,
float  heightPercentage 
)

Sets a row to have relative height. Relative height means percentage of the remainder of the table height after subtracting Padding and Fixed height rows. Setting a relative height of 0 has no effect.

Since:
2.4, DALi version 1.0.0
Parameters:
rowIndexThe rowIndex for row with relative height
heightPercentagebetween 0.0f and 1.0f
Precondition:
The row rowIndex must exist.
void Dali::Toolkit::TableView::SetRelativeWidth ( unsigned int  columnIndex,
float  widthPercentage 
)

Sets a column to have relative width. Relative width means percentage of the remainder of table width after subtracting Padding and Fixed width columns. Setting a relative width of 0 has no effect.

Since:
2.4, DALi version 1.0.0
Parameters:
columnIndexThe columnIndex for column with fixed width
widthPercentageThe widthPercentage between 0.0f and 1.0f
Precondition:
The column columnIndex must exist.