Tizen Native API

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  Property
 An enumeration of properties belonging to the TableView class. More...

Public Types

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

Public Member Functions

 TableView ()
 Create a TableView handle; this can be initialised with TableView::New() Calling member functions with an uninitialised 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 childs layout position.
void InsertRow (unsigned int rowIndex)
 Insert a new row to given index.
void DeleteRow (unsigned int rowIndex)
 Delete a row from given index Removed elements are deleted.
void DeleteRow (unsigned int rowIndex, std::vector< Actor > &removed)
 Delete a row from given index.
void InsertColumn (unsigned int columnIndex)
 Insert a new column to given index.
void DeleteColumn (unsigned int columnIndex)
 Delete a column from given index. Removed elements are deleted.
void DeleteColumn (unsigned int columnIndex, std::vector< Actor > &removed)
 Delete a column from given index.
void Resize (unsigned int rows, unsigned int columns)
 Resize the TableView.
void Resize (unsigned int rows, unsigned int columns, std::vector< Actor > &removed)
 Resize the TableView.
void SetCellPadding (Size padding)
 Set horizontal and vertical padding between cells.
Size GetCellPadding ()
 Get the current padding as width and height.
void SetFitHeight (unsigned int rowIndex)
 Specify this row as fitting its height to its children.
bool IsFitHeight (unsigned int rowIndex) const
 Is the row a fit row.
void SetFitWidth (unsigned int columnIndex)
 Specify this column as fitting its width to its children.
bool IsFitWidth (unsigned int columnIndex) const
 Is the column 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)
 Set the alignment on a cell.

Static Public Member Functions

static TableView New (unsigned int initialRows, unsigned int initialColumns)
 Create the TableView control.
static TableView DownCast (BaseHandle handle)
 Downcast 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.

Since :
2.4

Member Enumeration Documentation

Describes how the size of a row / column been set.

Since :
2.4
Enumerator:
FIXED 

Fixed with the given value.

Since :
2.4
RELATIVE 

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

Since :
2.4
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
FIT 

Fit around its children.

Since :
2.4

The start and end property ranges for this control.

Since :
2.4
Enumerator:
PROPERTY_END_INDEX 

Reserve property indices.

Since :
2.4

Reimplemented from Dali::Toolkit::Control.


Constructor & Destructor Documentation

Create a TableView handle; this can be initialised with TableView::New() Calling member functions with an uninitialised handle is not allowed.

Since :
2.4

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

Since :
2.4
Parameters:
handleto copy from

Destructor.

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

Since :
2.4

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
Parameters:
[in]childto add
[in]positionfor 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)

Delete a column from given index. Removed elements are deleted.

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

Delete a column from given index.

Since :
2.4
Parameters:
[in]columnIndexof the column to delete
[out]removedelements
void Dali::Toolkit::TableView::DeleteRow ( unsigned int  rowIndex)

Delete a row from given index Removed elements are deleted.

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

Delete a row from given index.

Since :
2.4
Parameters:
[in]rowIndexof the row to delete
[out]removedelements

Downcast 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
Parameters:
[in]handleHandle to an object
Returns:
handle to a TableView or an uninitialized handle

Reimplemented from Dali::Toolkit::Control.

Finds the childs layout position.

Since :
2.4
Parameters:
[in]childto search for
[out]positionfor the child
Returns:
true if the child was included in this TableView

Get the current padding as width and height.

Since :
2.4
Returns:
the current padding as width and height

Returns a child from the given layout position.

Since :
2.4
Parameters:
[in]positionin 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
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
Returns:
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
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
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
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
Returns:
the amount of rows in the table
void Dali::Toolkit::TableView::InsertColumn ( unsigned int  columnIndex)

Insert a new column to given index.

Since :
2.4
Parameters:
[in]columnIndexof the new column
void Dali::Toolkit::TableView::InsertRow ( unsigned int  rowIndex)

Insert a new row to given index.

Since :
2.4
Parameters:
[in]rowIndexof the new row
bool Dali::Toolkit::TableView::IsFitHeight ( unsigned int  rowIndex) const

Is the row a fit row.

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

Is the column a fit column.

Since :
2.4
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]

Create the TableView control.

Since :
2.4
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

Removes a child from the given layout position.

Since :
2.4
Parameters:
[in]positionfor 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 
)

Resize the TableView.

Since :
2.4
Parameters:
[in]rowsfor the table
[in]columnsfor 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 
)

Resize the TableView.

Since :
2.4
Parameters:
[in]rowsfor the table
[in]columnsfor the table
[out]removedactor 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

Set the alignment on a cell.

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

Since :
2.4
Parameters:
[in]positionThe cell to set alignment on.
[in]horizontalThe horizontal alignment.
[in]verticalThe vertical alignment.

Set horizontal and vertical padding between cells.

Since :
2.4
Parameters:
[in]paddingwidth and height
void Dali::Toolkit::TableView::SetFitHeight ( unsigned int  rowIndex)

Specify this row as fitting its height to its children.

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

Specify this column as fitting its width to its children.

Since :
2.4
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
Parameters:
rowIndexfor row with fixed height
heightin 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
Parameters:
columnIndexfor column with fixed width
widthin 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
Parameters:
rowIndexfor 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
Parameters:
columnIndexfor column with fixed width
widthPercentagebetween 0.0f and 1.0f
Precondition:
The column columnIndex must exist.