kspread Library API Documentation

KSpreadCell Class Reference

For every cell in the spread sheet there is a KSpreadCell object. More...

#include <kspread_cell.h>

List of all members.

Public Types

enum  CellFlags {
  Flag_LayoutDirty = 0x00010000, Flag_CalcDirty = 0x00020000, Flag_Progress = 0x00040000, Flag_UpdatingDeps = 0x00080000,
  Flag_DisplayDirty = 0x00100000, Flag_ForceExtra = 0x00200000, Flag_CellTooShortX = 0x00400000, Flag_CellTooShortY = 0x00800000,
  Flag_ParseError = 0x01000000, Flag_CircularCalculation = 0x02000000, Flag_DependancyError = 0x04000000, Flag_PaintingCell = 0x08000000,
  Flag_TextFormatDirty = 0x10000000
}

Public Member Functions

 KSpreadCell (KSpreadSheet *_sheet, int _column, int _row)
 KSpreadCell (KSpreadSheet *_sheet, KSpreadStyle *_style, int _column, int _row)
 ~KSpreadCell ()
KSpreadSheet * sheet () const
bool isDefault () const
bool isEmpty () const
int column () const
int row () const
QString name () const
QString fullName () const
QString columnName () const
KLocale * locale ()
bool isFormula () const
QString text () const
QString strOutText () const
const KSpreadValue value () const
void setValue (const KSpreadValue &value)
KSpreadCellpreviousCell () const
KSpreadCellnextCell () const
void setPreviousCell (KSpreadCell *c)
void setNextCell (KSpreadCell *c)
void move (int column, int row)
void sheetDies ()
QDomElement save (QDomDocument &doc, int _x_offset=0, int _y_offset=0, bool force=false, bool copy=false, bool era=false)
virtual bool saveOasis (KoXmlWriter &xmlwriter, KoGenStyles &mainStyles, int row, int column, int maxCol, int &repeated, KSpreadGenValidationStyles &valStyle)
void saveOasisValue (KoXmlWriter &xmlWriter)
QString saveOasisCellStyle (KoGenStyle &currentCellStyle, KoGenStyles &mainStyles, bool force=false, bool copy=false)
bool load (const QDomElement &cell, int _xshift, int _yshift, PasteMode pm=Normal, Operation op=OverWrite, bool paste=false)
bool loadOasis (const QDomElement &element, const KoOasisStyles &oasisStyles)
void loadOasisValidation (const QString &validationName)
QTime toTime (const QDomElement &element)
QDate toDate (const QDomElement &element)
void copyFormat (int _column, int _row)
void copyFormat (KSpreadCell *_cell)
void copyContent (KSpreadCell *_cell)
void copyAll (KSpreadCell *cell)
void paintCell (const KoRect &rect, QPainter &painter, KSpreadView *view, const KoPoint &coordinate, const QPoint &cellRef, bool paintBorderRight, bool paintBorderBottom, bool paintBorderLeft, bool paintBorderTop, QPen &rightPen, QPen &bottomPen, QPen &leftPen, QPen &topPen, bool drawCursor=true)
int width (int _col=-1, const KSpreadCanvas *_canvas=0L) const
int height (int _row=-1, const KSpreadCanvas *_canvas=0L) const
double dblWidth (int _col=-1, const KSpreadCanvas *_canvas=0L) const
double dblHeight (int _row=-1, const KSpreadCanvas *_canvas=0L) const
QRect cellRect ()
bool needsPrinting () const
void incPrecision ()
void decPrecision ()
void setCellText (const QString &_text, bool asString=false)
void setDisplayText (const QString &_text)
void setLink (const QString &link)
QString link () const
const QPeneffLeftBorderPen (int col, int row) const
const QPeneffTopBorderPen (int col, int row) const
const QPeneffRightBorderPen (int col, int row) const
const QPeneffBottomBorderPen (int col, int row) const
const QPeneffGoUpDiagonalPen (int col, int row) const
const QPeneffFallDiagonalPen (int col, int row) const
const QColoreffTextColor (int col, int row) const
uint effBottomBorderValue (int col, int row) const
uint effRightBorderValue (int col, int row) const
uint effLeftBorderValue (int col, int row) const
uint effTopBorderValue (int col, int row) const
const QPenleftBorderPen (int col, int row) const
const QPentopBorderPen (int col, int row) const
const QPenrightBorderPen (int col, int row) const
const QPenbottomBorderPen (int col, int row) const
const QColorbgColor (int col, int row) const
const QBrushbackGroundBrush (int col, int row) const
void setLeftBorderPen (const QPen &p)
void setTopBorderPen (const QPen &p)
void setRightBorderPen (const QPen &p)
void setBottomBorderPen (const QPen &p)
virtual void setCurrency (int type, QString const &symbol)
FormatType formatType () const
bool isDate () const
bool isTime () const
void setNumber (double number)
double getDouble ()
void convertToDouble ()
void convertToPercent ()
void convertToMoney ()
void convertToTime ()
void convertToDate ()
double textWidth () const
double textHeight () const
bool updateChart (bool refresh=true)
QString testAnchor (int _x, int _y) const
void clicked (KSpreadCanvas *_canvas)
bool calc (bool delay=true)
void setCalcDirtyFlag ()
bool calcDirtyFlag ()
void NotifyDepending (int col, int row, KSpreadSheet *sheet, bool isDepending)
virtual void setLayoutDirtyFlag (bool format=false)
bool layoutDirtyFlag () const
void clearDisplayDirtyFlag ()
void setDisplayDirtyFlag ()
void obscure (KSpreadCell *cell, bool isForcing=false)
void unobscure (KSpreadCell *cell)
bool isObscured () const
bool isObscuringForced () const
KSpreadCellultimateObscuringCell () const
QValueList< KSpreadCell * > obscuringCells () const
void clearObscuringCells ()
void forceExtraCells (int _col, int _row, int _x, int _y)
bool isForceExtraCells () const
int mergedXCells () const
int mergedYCells () const
int extraXCells () const
int extraYCells () const
double extraWidth () const
double extraHeight () const
QString encodeFormula (bool _era=false, int _col=-1, int _row=-1)
QString decodeFormula (const QString &_text, int _col=-1, int _row=-1)
QString pasteOperation (const QString &new_text, const QString &old_text, Operation op)
bool hasError () const
void clearAllErrors ()
void makeLayout (QPainter &_painter, int _col, int _row)
bool makeFormula ()
void defaultStyle ()
QValueList< KSpreadConditionalconditionList () const
void setConditionList (const QValueList< KSpreadConditional > &newList)
KSpreadValidity * getValidity (int newStruct=-1)
void removeValidity ()
bool testValidity () const
void calculateTextParameters (QPainter &painter, int _col, int _row)
int defineAlignX ()
bool operator> (const KSpreadCell &) const
bool operator< (const KSpreadCell &) const
void freeAllObscuredCells ()
void clearFlag (CellFlags flag)
void setFlag (CellFlags flag)
bool testFlag (CellFlags flag) const

Static Public Member Functions

static QString name (int col, int row)
static QString fullName (const KSpreadSheet *s, int col, int row)
static QString columnName (uint column)

Protected Member Functions

void formatChanged ()
KSpreadFormat * fallbackFormat (int col, int row)
const KSpreadFormat * fallbackFormat (int col, int row) const
void applyZoomedFont (QPainter &painter, int _col, int _row)
void textSize (QPainter &_paint)
QString textDisplaying (QPainter &painter)
void clearFormula ()
void checkTextInput ()
void checkNumberFormat ()
void loadOasisValidationCondition (QString &valExpression)
void saveOasisAnnotation (KoXmlWriter &xmlwriter)
void loadOasisConditional (QDomElement *style)

Friends

class SelectPrivate
class KSpreadConditions


Detailed Description

For every cell in the spread sheet there is a KSpreadCell object.

KSpreadCell contains format information and algorithm and it contains the calculation algorithm.

However, all empty cells are represented by one instace, called the default cell. isDefault tells wether a cell is the default one or not.

Definition at line 108 of file kspread_cell.h.


Constructor & Destructor Documentation

KSpreadCell::~KSpreadCell  ) 
 

See also:
sheetDies

Definition at line 6678 of file kspread_cell.cc.

References KSpreadValue::empty(), extraXCells(), extraYCells(), and isDefault().


Member Function Documentation

KSpreadSheet * KSpreadCell::sheet  )  const
 

Returns the worksheet which owns this cell.

Definition at line 294 of file kspread_cell.cc.

Referenced by checkTextInput(), fallbackFormat(), fullName(), and KSpreadConditions::loadConditions().

bool KSpreadCell::isDefault  )  const
 

Returns true if this is a default cell (with row and column equal to zero).

Normally, cell constructed within a sheet can't be a default cell.

Definition at line 300 of file kspread_cell.cc.

Referenced by KSpread::DependencyManager::cellChanged(), cellRect(), column(), copyAll(), getDouble(), isEmpty(), makeLayout(), needsPrinting(), paintCell(), KSpreadCanvas::paintUpdates(), row(), and ~KSpreadCell().

bool KSpreadCell::isEmpty  )  const
 

Returns true if this cell has no content, i.e no text and no formula.

Definition at line 768 of file kspread_cell.cc.

References isDefault().

Referenced by makeLayout(), save(), and textDisplaying().

int KSpreadCell::column  )  const
 

Returns the cell's column.

This could be 0 if the cell is the default cell.

Definition at line 324 of file kspread_cell.cc.

References isDefault().

Referenced by backGroundBrush(), bgColor(), copyFormat(), decPrecision(), defineAlignX(), KSpread::ValueFormatter::formatText(), KSpreadCanvas::gotoLocation(), incPrecision(), isObscuringForced(), KSpreadRangeIterator::next(), paintCell(), setBottomBorderPen(), setLeftBorderPen(), setRightBorderPen(), setTopBorderPen(), textDisplaying(), textSize(), and ultimateObscuringCell().

int KSpreadCell::row  )  const
 

Returns the cell's row.

This could be 0 if the cell is the default cell.

Definition at line 306 of file kspread_cell.cc.

References isDefault().

Referenced by backGroundBrush(), bgColor(), copyFormat(), decPrecision(), defineAlignX(), encodeFormula(), KSpread::ValueFormatter::formatText(), KSpreadCanvas::gotoLocation(), incPrecision(), isObscuringForced(), paintCell(), setBottomBorderPen(), setLeftBorderPen(), setRightBorderPen(), setTopBorderPen(), textDisplaying(), textSize(), and ultimateObscuringCell().

QString KSpreadCell::name  )  const
 

Returns the name of the cell.

For example, the cell in first column and first row is "A1".

Definition at line 341 of file kspread_cell.cc.

Referenced by fullName(), and paintCell().

QString KSpreadCell::fullName  )  const
 

Returns the full name of the cell, i.e.

including the worksheet name. Example: "Sheet1!A1"

Definition at line 358 of file kspread_cell.cc.

References sheet().

Referenced by calc(), and makeFormula().

QString KSpreadCell::columnName  )  const
 

Returns the column name of the cell.

Definition at line 374 of file kspread_cell.cc.

Referenced by name().

QString KSpreadCell::name int  col,
int  row
[static]
 

Given the cell position, this static function returns the name of the cell.

Example: name(5,4) will return "E4".

Definition at line 349 of file kspread_cell.cc.

References columnName().

QString KSpreadCell::fullName const KSpreadSheet *  s,
int  col,
int  row
[static]
 

Given the sheet and cell position, this static function returns the full name of the cell, i.e.

with the name of the sheet.

Definition at line 366 of file kspread_cell.cc.

References name().

QString KSpreadCell::columnName uint  column  )  [static]
 

Given the column number, this static function returns the corresponding column name, i.e.

the first column is "A", the second is "B", and so on.

Definition at line 386 of file kspread_cell.cc.

KLocale * KSpreadCell::locale  ) 
 

Returns the locale setting of this cell.

Definition at line 379 of file kspread_cell.cc.

Referenced by checkTextInput(), decPrecision(), incPrecision(), and setCurrency().

bool KSpreadCell::isFormula  )  const
 

Returns true if this cell holds a formula.

Definition at line 408 of file kspread_cell.cc.

Referenced by calc(), save(), setCalcDirtyFlag(), and KSpreadView::setText().

QString KSpreadCell::text  )  const
 

Return the text the user entered.

This could be a value (e.g. "14.03") or a formula (e.g. "=SUM(A1:A10)")

Definition at line 420 of file kspread_cell.cc.

Referenced by KSpreadConditions::currentCondition(), save(), KSpreadView::slotActivateTool(), KSpreadView::slotItemSelected(), KSpreadView::updateEditWidget(), and KSpreadView::updateEditWidgetOnPress().

const KSpreadValue KSpreadCell::value  )  const
 

Returns the value that this cell holds.

It could be from the user (i.e. when s/he enters a value) or a result of formula.

Definition at line 438 of file kspread_cell.cc.

Referenced by checkNumberFormat(), checkTextInput(), KSpreadConditions::currentCondition(), decPrecision(), defineAlignX(), KSpread::ValueFormatter::formatText(), getDouble(), incPrecision(), makeLayout(), operator>(), KSpreadView::setText(), testValidity(), and textDisplaying().

void KSpreadCell::setValue const KSpreadValue value  ) 
 

Sets the value for this cell.

Definition at line 450 of file kspread_cell.cc.

References cellRect(), clearAllErrors(), and KSpreadValue::type().

Referenced by calc(), checkTextInput(), makeFormula(), KSpread::ValueParser::parse(), and setCellText().

void KSpreadCell::move int  column,
int  row
 

Moves around the cell.

It cares about obscured and obscuring cells and forces, relayout, calculation and redrawing of the cell.

Definition at line 673 of file kspread_cell.cc.

References extraXCells(), extraYCells(), setCalcDirtyFlag(), setLayoutDirtyFlag(), and unobscure().

void KSpreadCell::sheetDies  ) 
 

The KSpreadSheet calls this method if the sheet becomes deleted.

At the time this method is called other cells may already be deleted or in some inconsistent state.

The purpose of this method is to clear up some variables so that the destructor runs without any crash. Especially all variables referencing other cells must be voided. This method may not call any other method since the whole sheet and all remaining cells are in an inconsistent state now.

Definition at line 6664 of file kspread_cell.cc.

QDomElement KSpreadCell::save QDomDocument doc,
int  _x_offset = 0,
int  _y_offset = 0,
bool  force = false,
bool  copy = false,
bool  era = false
 

Save this cell.

Parameters:
_x_offset ...
_y_offset ...
force if set to true, all the properties of the format are stored (used for "Copy")
era set this to true if you want to encode relative references as absolutely (they will be switched back to relative references during decoding) - is used for cutting to clipboard Usually this is false, to only store the properties explicitly set.

Definition at line 4939 of file kspread_cell.cc.

References encodeFormula(), extraXCells(), extraYCells(), isEmpty(), isForceExtraCells(), isFormula(), link(), and text().

void KSpreadCell::copyFormat int  _column,
int  _row
 

Copyies the format from the cell at the position (_column|_row).

See also:
copyAll

Definition at line 522 of file kspread_cell.cc.

References backGroundBrush(), bgColor(), bottomBorderPen(), conditionList(), d, leftBorderPen(), rightBorderPen(), setBottomBorderPen(), setConditionList(), setLeftBorderPen(), setRightBorderPen(), setTopBorderPen(), and topBorderPen().

Referenced by copyAll(), and copyFormat().

void KSpreadCell::copyFormat KSpreadCell _cell  ) 
 

A convenience function.

See also:
copyAll

Definition at line 517 of file kspread_cell.cc.

References column(), copyFormat(), and row().

void KSpreadCell::copyAll KSpreadCell cell  ) 
 

Copies the format and the content.

It does not copy the m_row and m_column attributes. Besides that all persistent attributes are copied. setCellText is called to set the real content.

See also:
copyFormat

Definition at line 568 of file kspread_cell.cc.

References copyFormat(), and isDefault().

void KSpreadCell::paintCell const KoRect &  rect,
QPainter painter,
KSpreadView view,
const KoPoint &  coordinate,
const QPoint cellRef,
bool  paintBorderRight,
bool  paintBorderBottom,
bool  paintBorderLeft,
bool  paintBorderTop,
QPen rightPen,
QPen bottomPen,
QPen leftPen,
QPen topPen,
bool  drawCursor = true
 

Paints the cell.

Parameters:
rect the portion of the canvas that is actually in view
painter the painter object to paint on
the view of this data. This may be NULL, but no selection will be included with the painting.
coordinates coordinates on the painter where the top left corner of the cell should be painted plus width and height
cellRef the column/row coordinates of the cell.
paintBorderRight whether to draw the right border too.
paintBorderBottom whether to draw the bottom border too.
drawCursor whether to draw the cursor and selection or not

Definition at line 2100 of file kspread_cell.cc.

References bgColor(), KSpreadView::canvasWidget(), cellRect(), column(), KSpreadView::doc(), effBottomBorderPen(), effLeftBorderPen(), effRightBorderPen(), effTopBorderPen(), extraXCells(), extraYCells(), height(), isDefault(), isObscured(), isObscuringForced(), makeLayout(), KSpreadView::marker(), name(), paintCell(), row(), KSpreadView::selection(), and width().

Referenced by paintCell(), and KSpreadCanvas::paintUpdates().

int KSpreadCell::width int  _col = -1,
const KSpreadCanvas _canvas = 0L
const
 

Parameters:
_col the column this cell is assumed to be in. This parameter defaults to the return value of column.
Returns:
the width of this cell as int

Definition at line 3993 of file kspread_cell.cc.

References dblWidth().

Referenced by makeLayout(), paintCell(), and textSize().

int KSpreadCell::height int  _row = -1,
const KSpreadCanvas _canvas = 0L
const
 

Parameters:
_row the row this cell is assumed to be in.
Returns:
the height of this cell as int

Definition at line 4019 of file kspread_cell.cc.

References dblHeight().

Referenced by makeLayout(), and paintCell().

double KSpreadCell::dblWidth int  _col = -1,
const KSpreadCanvas _canvas = 0L
const
 

Parameters:
_col the column this cell is assumed to be in. This parameter defaults to the return value of column.
Returns:
the width of this cell as double

Definition at line 3972 of file kspread_cell.cc.

Referenced by KSpreadCanvas::gotoLocation(), and width().

double KSpreadCell::dblHeight int  _row = -1,
const KSpreadCanvas _canvas = 0L
const
 

Parameters:
_row the row this cell is assumed to be in.
Returns:
the height of this cell as double

Definition at line 3998 of file kspread_cell.cc.

Referenced by KSpreadCanvas::gotoLocation(), and height().

QRect KSpreadCell::cellRect  ) 
 

Returns:
a QRect for this cell (i.e., a 1x1 rect)

Definition at line 6787 of file kspread_cell.cc.

References isDefault().

Referenced by obscure(), paintCell(), setCalcDirtyFlag(), setValue(), and unobscure().

bool KSpreadCell::needsPrinting  )  const
 

Returns:
TRUE if the cell should be printed in a print out. That si the case if it has any content, border, backgroundcolor, or background brush.
See also:
KSpreadSheet::print

Definition at line 732 of file kspread_cell.cc.

References isDefault().

void KSpreadCell::incPrecision  ) 
 

Increases the precison of the value displayed.

Precision means here the amount of digits behind the dot. If the current precision is the default of -1, then it is set to the number of digits behind the dot plus 1.

Definition at line 4336 of file kspread_cell.cc.

References column(), locale(), row(), and value().

void KSpreadCell::decPrecision  ) 
 

Decreases the precison of the value displayed.

Precision means here the amount of digits behind the dot. If the current precision is the default of -1, then it is set to the number of digits behind the dot minus 1.

Definition at line 4372 of file kspread_cell.cc.

References column(), locale(), row(), and value().

void KSpreadCell::setCellText const QString _text,
bool  asString = false
 

The high-level method for setting text, when the user inputs it.

It will revert back to the old text if testValidity() returns action==stop.

Definition at line 4417 of file kspread_cell.cc.

References setDisplayText(), setValue(), and testValidity().

Referenced by setLink(), KSpreadView::slotItemSelected(), and KSpreadView::slotReplace().

void KSpreadCell::setDisplayText const QString _text  ) 
 

Sets the text in the cell when the user inputs it.

Will determine the type of contents automatically. Called by setCellText.

Definition at line 4443 of file kspread_cell.cc.

References checkTextInput(), and makeFormula().

Referenced by setCellText().

void KSpreadCell::setLink const QString link  ) 
 

Sets a link for this cell.

For example, setLink( "mailto:joe@somewhere.com" ) will open a new e-mail if this cell is clicked. Possible choices for link are URL (web, ftp), e-mail address, local file, or another cell.

Definition at line 4480 of file kspread_cell.cc.

References setCellText().

QString KSpreadCell::link  )  const
 

Returns the link associated with cell.

It is empty if this cell contains no link.

Definition at line 4488 of file kspread_cell.cc.

Referenced by save().

const QPen & KSpreadCell::leftBorderPen int  col,
int  row
const
 

Definition at line 4123 of file kspread_cell.cc.

References rightBorderPen().

Referenced by copyFormat(), and rightBorderPen().

const QPen & KSpreadCell::topBorderPen int  col,
int  row
const
 

Definition at line 4147 of file kspread_cell.cc.

References bottomBorderPen().

Referenced by bottomBorderPen(), and copyFormat().

const QPen & KSpreadCell::rightBorderPen int  col,
int  row
const
 

Definition at line 4111 of file kspread_cell.cc.

References leftBorderPen().

Referenced by copyFormat(), and leftBorderPen().

const QPen & KSpreadCell::bottomBorderPen int  col,
int  row
const
 

Definition at line 4135 of file kspread_cell.cc.

References topBorderPen().

Referenced by copyFormat(), and topBorderPen().

const QColor & KSpreadCell::bgColor int  col,
int  row
const
 

Definition at line 4042 of file kspread_cell.cc.

References bgColor(), column(), and row().

Referenced by bgColor(), copyFormat(), and paintCell().

const QBrush & KSpreadCell::backGroundBrush int  col,
int  row
const
 

Definition at line 4031 of file kspread_cell.cc.

References backGroundBrush(), column(), and row().

Referenced by backGroundBrush(), and copyFormat().

void KSpreadCell::setLeftBorderPen const QPen p  ) 
 

Definition at line 4060 of file kspread_cell.cc.

References column(), and row().

Referenced by copyFormat().

void KSpreadCell::setTopBorderPen const QPen p  ) 
 

Definition at line 4073 of file kspread_cell.cc.

References column(), and row().

Referenced by copyFormat().

void KSpreadCell::setRightBorderPen const QPen p  ) 
 

Definition at line 4085 of file kspread_cell.cc.

References column(), and row().

Referenced by copyFormat().

void KSpreadCell::setBottomBorderPen const QPen p  ) 
 

Definition at line 4098 of file kspread_cell.cc.

References column(), and row().

Referenced by copyFormat().

void KSpreadCell::setCurrency int  type,
QString const &  symbol
[virtual]
 

Definition at line 4314 of file kspread_cell.cc.

References locale().

FormatType KSpreadCell::formatType  )  const
 

Return the format of this cell.

Convenience method for KSpreadFormat::getFormatType Note that this is "how the user would like the data to be displayed if possible". If he selects a date format, and the cell contains a string, we won't apply that format.

Definition at line 4717 of file kspread_cell.cc.

Referenced by checkNumberFormat(), checkTextInput(), defineAlignX(), KSpread::ValueParser::parse(), and KSpreadView::slotItemSelected().

double KSpreadCell::getDouble  ) 
 

return the cell's value as a double

Definition at line 4814 of file kspread_cell.cc.

References isDefault(), and value().

double KSpreadCell::textWidth  )  const
 

return size of the text

Definition at line 4722 of file kspread_cell.cc.

bool KSpreadCell::updateChart bool  refresh = true  ) 
 

Refreshing chart bool refresh is default true when it's false it's just for test it's used when you paste cell.

Definition at line 4792 of file kspread_cell.cc.

References CellBinding::cellChanged(), and CellBinding::contains().

void KSpreadCell::clicked KSpreadCanvas _canvas  ) 
 

Called if the user clicks on a cell.

If the cell is for example a button, then m_strAction is executed.

Definition at line 900 of file kspread_cell.cc.

bool KSpreadCell::calc bool  delay = true  ) 
 

Starts calculating.

Parameters:
delay true if you want to check for delay condition in doc() false if you really have to calculate the value right now e.g. if you sort with formula as key
Returns:
TRUE on success and FALSE on error.

Definition at line 1989 of file kspread_cell.cc.

References checkNumberFormat(), KSpreadValue::empty(), fullName(), isFormula(), makeFormula(), KSpreadValue::setError(), and setValue().

Referenced by KSpreadCanvas::paintUpdates().

void KSpreadCell::setCalcDirtyFlag  ) 
 

Set the calcDirtyFlag.

Definition at line 4779 of file kspread_cell.cc.

References cellRect(), and isFormula().

Referenced by move().

void KSpreadCell::NotifyDepending int  col,
int  row,
KSpreadSheet *  sheet,
bool  isDepending
 

Notify this cell that another cell is depending, or no longer depending on this cell's value.

Parameters:
col the column of the cell
row the row of the cell
sheet the sheet that the cell is on
isDepending true if the cell is now depending on this one, false if it is not any longer depending on it.

void KSpreadCell::setLayoutDirtyFlag bool  format = false  )  [virtual]
 

Causes the format to be recalculated when the cell is drawn next time.

This flag is for example set if the width of the column changes or if some cell specific format value like font or text change.

Definition at line 715 of file kspread_cell.cc.

Referenced by move().

void KSpreadCell::obscure KSpreadCell cell,
bool  isForcing = false
 

Tells this cell that the KSpreadCell 'cell' obscures this one.

If this cell has to be redrawn, then the obscuring cell is redrawn instead.

Parameters:
cell the obscuring cell
isForcing whether this is a forced obscuring (merged cells) or just a temporary obscure (text overlap).

Definition at line 873 of file kspread_cell.cc.

References cellRect(), and clearObscuringCells().

Referenced by makeLayout().

void KSpreadCell::unobscure KSpreadCell cell  ) 
 

Tells this cell that it is no longer obscured.

Parameters:
cell the cell that is no longer obscuring this one.

Definition at line 892 of file kspread_cell.cc.

References cellRect().

Referenced by move().

bool KSpreadCell::isObscured  )  const
 

Returns:
TRUE if this cell is obscured by another.

Definition at line 776 of file kspread_cell.cc.

Referenced by KSpreadCanvas::gotoLocation(), and paintCell().

bool KSpreadCell::isObscuringForced  )  const
 

If obscuring is forced then the marker may never reside on this cell.

Returns:
TRUE if an obscuring cell is forced to obscure this one.

Definition at line 790 of file kspread_cell.cc.

References column(), d, isForceExtraCells(), mergedYCells(), and row().

Referenced by KSpreadCanvas::gotoLocation(), and paintCell().

KSpreadCell * KSpreadCell::ultimateObscuringCell  )  const
 

Return the cell that is obscuring this one (merged cells only).

If no obscuring, return the cell itself.

Returns:
the cell that decides the format for the cell in question.

Definition at line 823 of file kspread_cell.cc.

References column(), d, isForceExtraCells(), mergedYCells(), and row().

QValueList< KSpreadCell * > KSpreadCell::obscuringCells  )  const
 

Returns:
the obscuring cell list (might be empty)

Definition at line 856 of file kspread_cell.cc.

Referenced by KSpreadCanvas::gotoLocation().

void KSpreadCell::forceExtraCells int  _col,
int  _row,
int  _x,
int  _y
 

Force the cell to occupy other cells space.

If '_x' and '_y' are 0 then the forcing is disabled.

Parameters:
_col is the column this cell is assumed to be in.
_row is the row this cell is assumed to be in.
_x tells to occupy _x additional cells in the horizontal
_y tells to occupy _y additional cells in the vertical

Definition at line 627 of file kspread_cell.cc.

References extraXCells(), and extraYCells().

Referenced by makeLayout().

bool KSpreadCell::isForceExtraCells  )  const
 

Returns:
TRUE if the cell is forced to obscure other cells.

Definition at line 6847 of file kspread_cell.cc.

Referenced by isObscuringForced(), save(), and ultimateObscuringCell().

int KSpreadCell::mergedXCells  )  const
 

Returns:
the number of obscured cells in the horizontal direction as a result of cell merging (forced obscuring)

Definition at line 4732 of file kspread_cell.cc.

int KSpreadCell::mergedYCells  )  const
 

Returns:
the number of obscured cells in the vertical direction as a result of cell merging (forced obscuring)

Definition at line 4737 of file kspread_cell.cc.

Referenced by isObscuringForced(), and ultimateObscuringCell().

int KSpreadCell::extraXCells  )  const
 

Returns:
the amount of obscured cells in the horizontal direction

Definition at line 4742 of file kspread_cell.cc.

Referenced by forceExtraCells(), makeLayout(), move(), paintCell(), save(), textDisplaying(), and ~KSpreadCell().

int KSpreadCell::extraYCells  )  const
 

Returns:
the amount of obscured cells in the vertical direction

Definition at line 4747 of file kspread_cell.cc.

Referenced by forceExtraCells(), makeLayout(), move(), paintCell(), save(), and ~KSpreadCell().

QString KSpreadCell::encodeFormula bool  _era = false,
int  _col = -1,
int  _row = -1
 

encode a formula into a text representation

Parameters:
_era encode relative references absolutely (this is used for copying a cell to make the paste operation create a formula that points to the original cells, not the cells at the same relative position)

Definition at line 905 of file kspread_cell.cc.

References row().

Referenced by save().

QString KSpreadCell::pasteOperation const QString new_text,
const QString old_text,
Operation  op
 

Merges the new_text with old_text during a paste operation.

If both texts represent doubles, then the operation is performed on both values and the result is returned. If both texts represents a formula or one a formula and the other a double value, then a formula is returned. In all other cases new_text is returned.

Returns:
the merged text.

Definition at line 6544 of file kspread_cell.cc.

References clearAllErrors().

bool KSpreadCell::hasError  )  const
 

Returns:
TRUE if the cell contains a formula that could not be evaluated. These cells usually appear with "####" on the screen.

Definition at line 6813 of file kspread_cell.cc.

Referenced by KSpread::ValueFormatter::formatText().

void KSpreadCell::clearAllErrors  ) 
 

Clear all error flags from the cell.

Definition at line 6820 of file kspread_cell.cc.

Referenced by checkTextInput(), pasteOperation(), and setValue().

void KSpreadCell::makeLayout QPainter _painter,
int  _col,
int  _row
 

Calculates the layout of the cell, i,e, determines what should be shown for this cell, m_strOutText.

Definition at line 1174 of file kspread_cell.cc.

References applyZoomedFont(), extraXCells(), extraYCells(), forceExtraCells(), height(), isDefault(), isEmpty(), obscure(), textSize(), value(), and width().

Referenced by paintCell(), and KSpreadCanvas::paintUpdates().

bool KSpreadCell::makeFormula  ) 
 

Parses the formula.

Fills dependList and formula.

Returns:
FALSE on error.

Definition at line 1921 of file kspread_cell.cc.

References clearFormula(), fullName(), KSpreadValue::setError(), and setValue().

Referenced by calc(), and setDisplayText().

QValueList< KSpreadConditional > KSpreadCell::conditionList  )  const
 

Gets a copy of the list of current conditions.

Definition at line 6793 of file kspread_cell.cc.

Referenced by copyFormat().

void KSpreadCell::setConditionList const QValueList< KSpreadConditional > &  newList  ) 
 

Replace the old set of conditions with a new one.

Definition at line 6804 of file kspread_cell.cc.

Referenced by copyFormat().

bool KSpreadCell::testValidity  )  const
 

return true if value is good else show a messagebox

Definition at line 4514 of file kspread_cell.cc.

References value().

Referenced by setCellText().

void KSpreadCell::calculateTextParameters QPainter painter,
int  _col,
int  _row
 

Calculates the text parameters stored in cell Applies font to use to.

Parameters:
painter 

Definition at line 1903 of file kspread_cell.cc.

References applyZoomedFont(), and textSize().

int KSpreadCell::defineAlignX  ) 
 

return align X when align is undefined

Definition at line 3822 of file kspread_cell.cc.

References column(), formatType(), row(), and value().

bool KSpreadCell::operator> const KSpreadCell  )  const
 

Used for comparing cells (when sorting).

Definition at line 6711 of file kspread_cell.cc.

References isDate(), isTime(), and value().

void KSpreadCell::formatChanged  )  [protected]
 

Definition at line 608 of file kspread_cell.cc.

KSpreadFormat * KSpreadCell::fallbackFormat int  col,
int  row
[protected]
 

Definition at line 614 of file kspread_cell.cc.

References sheet().

const KSpreadFormat * KSpreadCell::fallbackFormat int  col,
int  row
const [protected]
 

Definition at line 619 of file kspread_cell.cc.

References sheet().

void KSpreadCell::applyZoomedFont QPainter painter,
int  _col,
int  _row
[protected]
 

Applies the font to use to.

Parameters:
painter 

Definition at line 1846 of file kspread_cell.cc.

Referenced by calculateTextParameters(), and makeLayout().

void KSpreadCell::textSize QPainter _paint  )  [protected]
 

Called from makeFormat to determine the space needed for the text.

Definition at line 1749 of file kspread_cell.cc.

References column(), row(), and width().

Referenced by calculateTextParameters(), and makeLayout().

QString KSpreadCell::textDisplaying QPainter painter  )  [protected]
 

Called from paintCell to determine the text wich can be displaying.

Definition at line 3855 of file kspread_cell.cc.

References column(), extraXCells(), isEmpty(), row(), and value().

void KSpreadCell::clearFormula  )  [protected]
 

Cleans up formula stuff.

Call this before you store a new formula or to delete the formula.

Definition at line 1983 of file kspread_cell.cc.

Referenced by makeFormula().

void KSpreadCell::checkTextInput  )  [protected]
 

Check the input from the user, and determine the contents of the cell accordingly (in particular the data type).

This is to be called only when m_content == Text.

Input: m_strText Output: m_dataType

Definition at line 4898 of file kspread_cell.cc.

References clearAllErrors(), KSpreadValue::empty(), formatType(), locale(), setValue(), sheet(), and value().

Referenced by setDisplayText().

void KSpreadCell::checkNumberFormat  )  [protected]
 

Automatically chooses between a number format and a scientific format (if the number is too big).

Definition at line 4925 of file kspread_cell.cc.

References formatType(), and value().

Referenced by calc().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:42 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003