KDChartTableDataBase Class Reference

KD Chart's build-in table data for an easy way of storing data values.

#include <KDChartTableBase.h>

Inheritance diagram for KDChartTableDataBase:

QObject KDChartListTableData KDChartSeriesCollection KDChartVectorTableData
Collaboration diagram for KDChartTableDataBase:

Collaboration graph
[legend]

List of all members.

Public Slots

virtual uint rows () const =0
virtual uint cols () const =0
virtual void setCell (uint _row, uint _col, const QVariant &_value1, const QVariant &_value2=QVariant())=0
virtual void setProp (uint _row, uint _col, int _propSet=0)=0
virtual bool cellCoord (uint _row, uint _col, QVariant &_value, int coordinate=1) const =0
virtual QVariant cellVal (uint _row, uint _col, int coordinate=1) const
virtual bool cellProp (uint _row, uint _col, int &_prop) const =0
virtual void expand (uint _rows, uint _cols)=0
virtual bool cellContent (uint _row, uint _col, QVariant &_value1, QVariant &_value2, int &_prop) const
virtual bool cellCoords (uint _row, uint _col, QVariant &_value1, QVariant &_value2) const
virtual void setUsedRows (uint _rows)
virtual uint usedRows () const
virtual void setUsedCols (uint _cols)
virtual uint usedCols () const
virtual uint colsScrolledBy () const
virtual void setSorted (bool sorted)
virtual bool sorted () const
virtual bool isPosInfinite (double value) const
virtual bool isNegInfinite (double value) const
virtual bool isNormalDouble (double value) const
bool isNormalDouble (QVariant value, double &dVal) const
virtual void importFromQTable (QTable *table)
virtual double maxValue (int coordinate=1) const
virtual double minValue (int coordinate=1, bool bOnlyGTZero=false) const
virtual QDateTime maxDtValue (int coordinate=1) const
virtual QDateTime minDtValue (int coordinate=1) const
virtual double maxColSum (int coordinate=1) const
virtual double minColSum (int coordinate=1) const
virtual double maxColSum (uint row, uint row2, int coordinate=1) const
virtual double minColSum (uint row, uint row2, int coordinate=1) const
virtual double colSum (uint col, int coordinate=1) const
virtual double colAbsSum (uint col, int coordinate=1) const
virtual double maxRowSum (int coordinate=1) const
virtual double minRowSum (int coordinate=1) const
virtual double rowSum (uint row, int coordinate=1) const
virtual double rowAbsSum (uint row, int coordinate=1) const
virtual double maxInColumn (uint col, int coordinate=1) const
virtual double minInColumn (uint col, int coordinate=1) const
virtual double maxInRow (uint row, int coordinate=1) const
virtual double minInRow (uint row, int coordinate=1) const
virtual double maxInRows (uint row, uint row2, int coordinate=1) const
virtual double minInRows (uint row, uint row2, int coordinate=1, bool bOnlyGTZero=false) const
virtual QDateTime maxDtInRows (uint row, uint row2, int coordinate=1) const
virtual QDateTime minDtInRows (uint row, uint row2, int coordinate=1) const
virtual uint lastPositiveCellInColumn (uint col, int coordinate=1) const
virtual bool cellsHaveSeveralCoordinates (QVariant::Type *type2Ref) const
virtual bool cellsHaveSeveralCoordinates (uint row1=0, uint row2=UINT_MAX, QVariant::Type *type2Ref=NULL) const
virtual QVariant::Type cellsValueType (uint row1, uint row2=UINT_MAX, int coordinate=1) const
virtual QVariant::Type cellsValueType (int coordinate=1) const

Public Member Functions

 KDChartTableDataBase ()
 KDChartTableDataBase (const KDChartTableDataBase &other)
virtual ~KDChartTableDataBase ()

Protected Attributes

bool _useUsedRows
bool _useUsedCols

Private Attributes

bool _sorted
uint _usedRows
uint _usedCols


Constructor & Destructor Documentation

KDChartTableDataBase::KDChartTableDataBase (  )  [inline]

Default constructor.

Creates an empty table and sets the sorted flag to false.

KDChartTableDataBase::KDChartTableDataBase ( const KDChartTableDataBase other  )  [inline]

Default copy constructor.

Just initializes the QObject part of this class and copies the sorted flag.

virtual KDChartTableDataBase::~KDChartTableDataBase (  )  [inline, virtual]

Default destructor.

Does nothing, only defined to have it virtual.


Member Function Documentation

virtual uint KDChartTableDataBase::rows (  )  const [pure virtual, slot]

Returns the number of rows in the table.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Returns:
the number of rows in the table.
See also:
setRows, usedRows, cols

Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual uint KDChartTableDataBase::cols (  )  const [pure virtual, slot]

Returns the number of cols in the table.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Returns:
the number of cols in the table.
See also:
setCols, usedCols, rows

Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual void KDChartTableDataBase::setCell ( uint  _row,
uint  _col,
const QVariant &  _value1,
const QVariant &  _value2 = QVariant() 
) [pure virtual, slot]

Stores data in a cell.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Parameters:
_row the row number of the cell to store the data object into.
_col the column number of the cell to store the data object into.
_value1 the first value to be stored, normally the Y value, possible types: int, double, QString QString might be used in case you want to use this cell's content for axis label
_value2 the second value to be stored, normally the X value (if any), possible types: int, double, QDateTime
See also:
cellCoords, cellContent, setProp

Implemented in KDChartListTableData, and KDChartVectorTableData.

virtual void KDChartTableDataBase::setProp ( uint  _row,
uint  _col,
int  _propSet = 0 
) [pure virtual, slot]

Specifies the property set ID for a cell.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Parameters:
_row the row number of the cell.
_col the column number of the cell.
_propSet the property set ID to be stored for this data cell, defaults to zero for normal data.
See also:
cellProp, cellContent, setCell

Implemented in KDChartListTableData, and KDChartVectorTableData.

virtual bool KDChartTableDataBase::cellCoord ( uint  _row,
uint  _col,
QVariant &  _value,
int  coordinate = 1 
) const [pure virtual, slot]

Returns one of the coordinate data value(s) stored in a cell.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Parameters:
_row the row number of the cell to be retrieved.
_col the column number of the cell to be retrieved.
_value the coordinate variable to be filled by this method.
coordinate the number of the coordinate to be retrieved, normally 1 is the Y value and 2 is the X value.
Returns:
TRUE if the row and col are addressing a cell in the table.
See also:
cellCoords, cellProp, cellContent, cellVal, setCell, setProp

Implemented in KDChartListTableData, and KDChartVectorTableData.

virtual QVariant KDChartTableDataBase::cellVal ( uint  _row,
uint  _col,
int  coordinate = 1 
) const [inline, virtual, slot]

Returns one of the coordinate data value(s) stored in a cell.

This convenience method calls the bool cellCoord() function and returns the result if it returned successfully - otherwise it returns an invalid QVariant.

Note:
If you know that a cell is containing valid double data you may quickly access them like this:
const double yVal = data.cellVal( r, c    ).toDouble();
const double xVal = data.cellVal( r, c, 2 ).toDouble(); 
Parameters:
_row the row number of the cell to be retrieved.
_col the column number of the cell to be retrieved.
coordinate the number of the coordinate to be retrieved, normally 1 is the Y value and 2 is the X value.
Returns:
cell contens if the row and col are addressing a cell in the table, otherwise an invalid QVariant is returned.
See also:
cellCoords, cellProp, cellContent, setCell, setProp

virtual bool KDChartTableDataBase::cellProp ( uint  _row,
uint  _col,
int &  _prop 
) const [pure virtual, slot]

Returns the property set ID stored in a cell.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.
Parameters:
_prop the property set ID of the cell to be retrieved.
Returns:
TRUE if the row and col are addressing a cell in the table.
See also:
cellCoord, cellCoords, cellContent, setCell, setProp

Implemented in KDChartListTableData, and KDChartVectorTableData.

virtual void KDChartTableDataBase::expand ( uint  _rows,
uint  _cols 
) [pure virtual, slot]

Increases the number of rows (and/or columns, resp.) stored in this table.

Note:
This pure-virtual function has to be implemented by each class derived from KDChartTableDataBase.

The old content of the table must be preserved (e.g. by copying the data into the cells of the new table).

Parameters:
_row the new number of rows.
_col the new number of columns.
See also:
cell

Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual bool KDChartTableDataBase::cellContent ( uint  _row,
uint  _col,
QVariant &  _value1,
QVariant &  _value2,
int &  _prop 
) const [inline, virtual, slot]

Note:
To improve runtime speed this virtual function may be reimplemented by classes derived from KDChartTableDataBase.
See also:
cellCoords, cellProp, setCell, setProp

virtual bool KDChartTableDataBase::cellCoords ( uint  _row,
uint  _col,
QVariant &  _value1,
QVariant &  _value2 
) const [inline, virtual, slot]

Note:
To improve runtime speed this virtual function may be reimplemented by classes derived from KDChartTableDataBase.
See also:
cellCoord, cellProp, cellContent, setCell, setProp

virtual void KDChartTableDataBase::setUsedRows ( uint  _rows  )  [virtual, slot]

Sets the number of rows in the table that actually contain data.

Note:
You might want to re-implement this function in derived classes, the default implementation just stores the new number of used rows.
Parameters:
_rows the number of rows in the table that actually contain data.
See also:
usedRows, rows, cols

Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual uint KDChartTableDataBase::usedRows (  )  const [virtual, slot]

Returns the number of rows in the table that actually contain data.

Returns:
the number of rows in the table that actually contain data.
See also:
setUsedRows, rows, cols

Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual void KDChartTableDataBase::setUsedCols ( uint  _cols  )  [virtual, slot]

Sets the number of cols in the table that actually contain data.

Note:
You might want to re-implement this function in derived classes, the default implementation just stores the new number of used cols.
Parameters:
_cols the number of cols in the table that actually contain data.
See also:
usedCols, rows, cols

Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual uint KDChartTableDataBase::usedCols (  )  const [virtual, slot]

Returns the number of cols in the table that actually contain data.

Returns:
the number of cols in the table that actually contain data.
See also:
setUsedCols, rows, cols

Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData.

virtual uint KDChartTableDataBase::colsScrolledBy (  )  const [inline, virtual, slot]

Returns the number of cols the table has been scrolled by.

Default implementation of this always returns zero, so make sure to return the appropriate value if your class derived from KDChartTableDataBase is supporting internal data scrolling technics.

See the KD Chart Programmers Manual for details described in the Data Scrolling chapter.

Returns:
the number of cols the table has been scrolled by.
See also:
cols, rows

virtual void KDChartTableDataBase::setSorted ( bool  sorted  )  [virtual, slot]

Specified whether the table is sorted.

See also:
sorted

virtual bool KDChartTableDataBase::sorted (  )  const [virtual, slot]

Returns whether the table is sorted.

See also:
setSorted

virtual bool KDChartTableDataBase::isPosInfinite ( double  value  )  const [inline, virtual, slot]

Returns true if the given value represents a positive infinite value.

Note:
This virtual function may be implemented by classes derived from KDChartTableDataBase. This should be done if your data are not stored as special value KDCHART_POS_INFINITE to indicate positive infinite values
Returns:
TRUE if the value given is a positive infinite value.

virtual bool KDChartTableDataBase::isNegInfinite ( double  value  )  const [inline, virtual, slot]

Returns true if the given value represents a negative infinite value.

Note:
This virtual function may be implemented by classes derived from KDChartTableDataBase. This should be done if your data are not stored as special value KDCHART_NEG_INFINITE to indicate negative infinite values
Returns:
TRUE if the value given is a negative infinite value.

virtual bool KDChartTableDataBase::isNormalDouble ( double  value  )  const [inline, virtual, slot]

Returns true if the given value represents a normal double value.

Normal double values are defined as values that are neither positive infinite nor negative infinite. This method is provided to let derived classed use their own way to determine when a double value is to be threated as normal.

Note:
To improve runtime speed this virtual function may be reimplemented by classes derived from KDChartTableDataBase.
Returns:
TRUE if the value given is neither positive infinite nor negativr infinite.

bool KDChartTableDataBase::isNormalDouble ( QVariant  value,
double &  dVal 
) const [inline, slot]

Returns true if the given QVariant value represents a normal double value.

This method tests if value has type QVariant::Double: if no, it returns false; if yes, it sets dVal accordingly and calls the virtual method isNormalDouble( double value ).

Parameters:
value The QVariant value to be tested and converted.
dVal Points to the double variable to be filled with the converted value.
Returns:
TRUE if the value given is neither positive infinite nor negative infinite, value is set to the converted value if the type of value is QVariant::Double, otherwise it is not modified.

virtual void KDChartTableDataBase::importFromQTable ( QTable table  )  [virtual, slot]

virtual double KDChartTableDataBase::maxValue ( int  coordinate = 1  )  const [virtual, slot]

Reimplemented in KDChartSeriesCollection.

virtual double KDChartTableDataBase::minValue ( int  coordinate = 1,
bool  bOnlyGTZero = false 
) const [virtual, slot]

virtual QDateTime KDChartTableDataBase::maxDtValue ( int  coordinate = 1  )  const [virtual, slot]

virtual QDateTime KDChartTableDataBase::minDtValue ( int  coordinate = 1  )  const [virtual, slot]

virtual double KDChartTableDataBase::maxColSum ( int  coordinate = 1  )  const [virtual, slot]

virtual double KDChartTableDataBase::minColSum ( int  coordinate = 1  )  const [virtual, slot]

virtual double KDChartTableDataBase::maxColSum ( uint  row,
uint  row2,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::minColSum ( uint  row,
uint  row2,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::colSum ( uint  col,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::colAbsSum ( uint  col,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::maxRowSum ( int  coordinate = 1  )  const [virtual, slot]

virtual double KDChartTableDataBase::minRowSum ( int  coordinate = 1  )  const [virtual, slot]

virtual double KDChartTableDataBase::rowSum ( uint  row,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::rowAbsSum ( uint  row,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::maxInColumn ( uint  col,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::minInColumn ( uint  col,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::maxInRow ( uint  row,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::minInRow ( uint  row,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::maxInRows ( uint  row,
uint  row2,
int  coordinate = 1 
) const [virtual, slot]

virtual double KDChartTableDataBase::minInRows ( uint  row,
uint  row2,
int  coordinate = 1,
bool  bOnlyGTZero = false 
) const [virtual, slot]

virtual QDateTime KDChartTableDataBase::maxDtInRows ( uint  row,
uint  row2,
int  coordinate = 1 
) const [virtual, slot]

virtual QDateTime KDChartTableDataBase::minDtInRows ( uint  row,
uint  row2,
int  coordinate = 1 
) const [virtual, slot]

virtual uint KDChartTableDataBase::lastPositiveCellInColumn ( uint  col,
int  coordinate = 1 
) const [virtual, slot]

virtual bool KDChartTableDataBase::cellsHaveSeveralCoordinates ( QVariant::Type *  type2Ref  )  const [virtual, slot]

virtual bool KDChartTableDataBase::cellsHaveSeveralCoordinates ( uint  row1 = 0,
uint  row2 = UINT_MAX,
QVariant::Type *  type2Ref = NULL 
) const [virtual, slot]

virtual QVariant::Type KDChartTableDataBase::cellsValueType ( uint  row1,
uint  row2 = UINT_MAX,
int  coordinate = 1 
) const [virtual, slot]

virtual QVariant::Type KDChartTableDataBase::cellsValueType ( int  coordinate = 1  )  const [virtual, slot]


Member Data Documentation


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

Generated on Wed Jan 26 13:06:52 2011 for KMyMoney by  doxygen 1.5.6