HTML::Renderer::TableLayout Class Reference

#include <TableLayout.hpp>

List of all members.


Detailed Description

This class describes the layout of an HTML table.

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.
ColumncolumnAt (const uint32 index)
 Get the column at the given index.
const uint32 dataRowCount () const
 Get the number of data rows in the table.
CellfindCell (const void *data, const bool findFirstData=true)
 Find a cell from its user data.
CellfindCellAt (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.
Rowoperator[] (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.
ColumnunsafeColumnAt (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...


Member Typedef Documentation

typedef Container::WithCopyConstructor<Column>::Array HTML::Renderer::TableLayout::ColumnArray

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.


Constructor & Destructor Documentation

HTML::Renderer::TableLayout::TableLayout (  )  [inline]

Constructor.

HTML::Renderer::TableLayout::~TableLayout (  )  [inline]

Destructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
index The column index to retrieve in the range 0 <= index < realColumnCount()
Returns:
A pointer on the column object, if found, or zero else

const uint32 HTML::Renderer::TableLayout::dataRowCount (  )  const [inline]

Get the number of data rows in the table.

Returns:
the number of data rows in this table, not including table headers and footers if any

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.

Parameters:
data The data to check against
findFirstData Which user data to test ?
Returns:
A pointer on the matching cell, or 0 on error (or not found)

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

Parameters:
rowIndex must be in range 0 <= rowIndex < rowCount()
colIndex must be in range 0 <= colIndex < realColumnCount()
Returns:
A pointer on the matching cell, or 0 on error (or not found)

const uint32 HTML::Renderer::TableLayout::footerRowCount (  )  const [inline]

Get the number of footer rows in the table.

Returns:
the number of footer rows in this table, not including table headers and data if any

const uint32 HTML::Renderer::TableLayout::headerRowCount (  )  const [inline]

Get the number of header rows in the table.

Returns:
the number of header rows in this table, not including table data and footers if any

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.

Returns:
the number of rows in this 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.

Parameters:
index The column index to retrieve in the range 0 <= index < realColumnCount()
Returns:
A reference on the column object, if found, or zero else

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.

Parameters:
index The row index to update (should be <= rowCount())
row The row object to update with. The object is copied


Member Data Documentation

uint32 HTML::Renderer::TableLayout::maximumWidth

Maximum width for this table.

uint32 HTML::Renderer::TableLayout::minimumWidth

Minimum width for this table.


The documentation for this class was generated from the following file:

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is