#include <TableLayout.hpp>
It can be overloaded to add renderer specific functionalities.
Public Types | |
| typedef Container::WithCopyConstructor< Column >::Array | ColumnArray |
| The column array, however, is a simple linear array. | |
| typedef Container::WithCopyConstructor< Row >::Array | RowArray |
| Let's use a defined structure for the row array Here we use a binary tree because for large table, the row seeking will be optimized. | |
Public Member Functions | |
| void | appendColumn (const Column &col) |
| Append a column to this layout. | |
| void | appendMultipleColumns (uint32 count, const Column &col) |
| Append multiple columns to this layout The columns are appended in the end of the array. | |
| Column * | columnAt (const uint32 index) |
| Get the column at the given index. | |
| const uint32 | dataRowCount () const |
| Get the number of data rows in the table. | |
| Cell * | findCell (const void *data, const bool findFirstData=true) |
| Find a cell from its user data. | |
| Cell * | findCellAt (const uint32 rowIndex, const uint32 colIndex) |
| Find a cell at the matching (x, y) position. | |
| const uint32 | footerRowCount () const |
| Get the number of footer rows in the table. | |
| const uint32 | headerRowCount () const |
| Get the number of header rows in the table. | |
| Row & | operator[] (const uint32 index) |
| Immediate access operator. | |
| const uint32 | realColumnCount () const |
| Count the number of effective columns. | |
| const uint32 | rowCount () const |
| Get the number of rows in the table. | |
| TableLayout () | |
| Constructor. | |
| Column & | unsafeColumnAt (const uint32 index) |
| Get the column at the given index. | |
| void | updateRowAt (const uint32 index, const Row &row) |
| Update a row at given position. | |
| ~TableLayout () | |
| Destructor. | |
Public Attributes | |
| uint32 | maximumWidth |
| Maximum width for this table. | |
| uint32 | minimumWidth |
| Minimum width for this table. | |
Classes | |
| struct | Cell |
| This defines a simple cell layout. More... | |
| struct | Column |
| Define the column type. More... | |
| struct | Row |
| This defines the layout of a table's row. More... | |
The column array, however, is a simple linear array.
| typedef Container::WithCopyConstructor<Row>::Array HTML::Renderer::TableLayout::RowArray |
Let's use a defined structure for the row array Here we use a binary tree because for large table, the row seeking will be optimized.
| HTML::Renderer::TableLayout::TableLayout | ( | ) | [inline] |
Constructor.
| HTML::Renderer::TableLayout::~TableLayout | ( | ) | [inline] |
Destructor.
| void HTML::Renderer::TableLayout::appendColumn | ( | const Column & | col | ) | [inline] |
Append a column to this layout.
The column is appended in the end of the array.
| col | The column to append in the array. The object is copied |
| void HTML::Renderer::TableLayout::appendMultipleColumns | ( | uint32 | count, | |
| const Column & | col | |||
| ) | [inline] |
Append multiple columns to this layout The columns are appended in the end of the array.
| count | The number of time to append the specified object | |
| col | The column to append in the array. The object is copied count times |
| Column* HTML::Renderer::TableLayout::columnAt | ( | const uint32 | index | ) | [inline] |
Get the column at the given index.
| index | The column index to retrieve in the range 0 <= index < realColumnCount() |
| const uint32 HTML::Renderer::TableLayout::dataRowCount | ( | ) | const [inline] |
Get the number of data rows in the table.
| Cell* HTML::Renderer::TableLayout::findCell | ( | const void * | data, | |
| const bool | findFirstData = true | |||
| ) | [inline] |
Find a cell from its user data.
If the findFirstData is set, the first user data variable is checked, else the second is checked.
| data | The data to check against | |
| findFirstData | Which user data to test ? |
| Cell* HTML::Renderer::TableLayout::findCellAt | ( | const uint32 | rowIndex, | |
| const uint32 | colIndex | |||
| ) | [inline] |
Find a cell at the matching (x, y) position.
This method takes care of spanned cells, so it can return the same cell pointer for different indexes
| rowIndex | must be in range 0 <= rowIndex < rowCount() | |
| colIndex | must be in range 0 <= colIndex < realColumnCount() |
| const uint32 HTML::Renderer::TableLayout::footerRowCount | ( | ) | const [inline] |
Get the number of footer rows in the table.
| const uint32 HTML::Renderer::TableLayout::headerRowCount | ( | ) | const [inline] |
Get the number of header rows in the table.
| Row& HTML::Renderer::TableLayout::operator[] | ( | const uint32 | index | ) | [inline] |
Immediate access operator.
| const uint32 HTML::Renderer::TableLayout::realColumnCount | ( | ) | const [inline] |
Count the number of effective columns.
| const uint32 HTML::Renderer::TableLayout::rowCount | ( | ) | const [inline] |
Get the number of rows in the table.
| Column& HTML::Renderer::TableLayout::unsafeColumnAt | ( | const uint32 | index | ) | [inline] |
Get the column at the given index.
This method doesn't check the index given, so it's unsafe to use, unless, you're absolutely sure of your indexes.
| index | The column index to retrieve in the range 0 <= index < realColumnCount() |
| void HTML::Renderer::TableLayout::updateRowAt | ( | const uint32 | index, | |
| const Row & | row | |||
| ) | [inline] |
Update a row at given position.
If the position doesn't exist yet but is equal to rowCount(), the row is appended to the array. Else, it is updated.
| index | The row index to update (should be <= rowCount()) | |
| row | The row object to update with. The object is copied |
Maximum width for this table.
Minimum width for this table.
