Table Class Reference

[libkorigin Index] [libkorigin Heirarchy]


Representation of a worksheets data More...

#include </home/mh/korigin/korigin/doc/tmp/table.h>

Public Members


Detailed Description

Representation of a worksheets data.

This class combines multiple columns to a table. (Therefore the class's name, Table.) It provides a confortable and homogenous access to all the table's cells.

The interface of the Table class hides most of the Column structure of the internal representation of a table. However, some functions still require direct contect with class Column, most notably the insertColumn() function.


Table()

Construct an empty table.

~Table()

Destruct table.

Table* clone()

Clone the table, i.e. make a deep copy.

int width()

Get the width of the table, i.e. the number of columns.

int height()

Get the height of the table, i.e. the length of the longest column.

const char* cell(int col, int row) const

Get the content of the given cell.

void getCell(int col, int row, char* value)

Get the content of the given cell. Make sure that the buffer, value, is big enough to hold the contents!!!

Parameters:
value into here the value of the cell is copied.

void setCell(int col, int row, const char* value)

Set the content of the given cell.

int findColumn(const char* title)

Return index of the column named "title".

Column column(int col)

Return Column of the given column.

void dump()

Dump the whole table on the console. For debugging.

void insertColumn(int at, Column newCol)

Insert a newly created column at the position specified. The column must be created before/while the call to insertColumn(), because insertColumn() has no way to know what kind of Column to create. You would, for example, create a new Column(Column::columnDouble), and then insert it into the table. Insertion means that the former column at the given position (and all following columns) are shifted one position to the right.

Note that the Column will be deleted by the Table's destructor.

Example:

myTable.insertColumn(0,Column(Column::columnDouble));

Parameters:
newCol the newly created column to be inserted.
at where to insert the column.

void insertRow(int at)

Insert an empty row in all columns.

void deleteColumn(int at)

Delete a column. Free the memory it uses.

void deleteRow(int at)

Delete a row across all columns. Decrememts height!!!

const char* name() const

Get the name of the table (its title).

void setName(const char* new_name)

Set the name of the table (its title).

Column::ColumnType type(int col)

Get type type string of a column.

int height(int col)

Get the height of a column.

const char* title(int col) const

Get the title of a column.

const char* format(int col) const

Get the format string of a column.

void setTitle(int col, const char* new_title)

Set the title of a column.

void setFormat(int col, const char* new_format)

Set the format string of a column.

void markActive()

Mark the table as active.This is especially important for the formula interpreter, since columns are looked up in the active table only.

See Also:
Formula

static const char* TableUnnamedStr

To this value the table's name is initialized.


  • Author: Patrick Schemitz
  • Documentation generated by mh@jeff_clever on Thu Feb 5 14:15:25 MET 1998
Kdoc