kspread

KSpread::Sheet Class Reference

List of all members.

Detailed Description

Definition at line 180 of file kspread_sheet.h.


Public Types

enum  Direction { Right, Left, Up, Down }
enum  SortingOrder { Increase, Decrease }
enum  ChangeRef { ColumnInsert, ColumnRemove, RowInsert, RowRemove }
enum  TestType { Text, Validity, Comment, ConditionalCellAttribute }
enum  LayoutDirection { LeftToRight, RightToLeft }

Signals

void sig_refreshView ()
void sig_updateView (Sheet *_sheet)
void sig_updateView (Sheet *_sheet, const Region &)
void sig_updateView (EmbeddedObject *obj)
void sig_updateHBorder (Sheet *_sheet)
void sig_updateVBorder (Sheet *_sheet)
void sig_updateChildGeometry (EmbeddedKOfficeObject *_child)
void sig_maxColumn (int _max_column)
void sig_maxRow (int _max_row)
void sig_nameChanged (Sheet *sheet, const QString &old_name)
void sig_polygonInvalidated (const QPointArray &)
void sig_SheetHidden (Sheet *sheet)
void sig_SheetShown (Sheet *sheet)
void sig_SheetRemoved (Sheet *sheet)
void sig_SheetActivated (Sheet *)
void sig_RefreshView (Sheet *)

Public Member Functions

 Sheet (Map *map, const QString &sheetName, const char *_name=0L)
 ~Sheet ()
virtual bool isEmpty (unsigned long int x, unsigned long int y) const
QString sheetName () const
QString tableName () const
bool setSheetName (const QString &name, bool init=false, bool makeUndo=true)
Mapworkbook () const
Docdoc () const
virtual QDomElement saveXML (QDomDocument &)
virtual bool loadXML (const QDomElement &)
virtual bool loadOasis (const QDomElement &sheet, KoOasisLoadingContext &oasisContext, QDict< Style > &styleMap)
virtual bool saveOasis (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, GenValidationStyles &valStyle, KoStore *store, KoXmlWriter *manifestWriter, int &indexObj, int &partIndexObj)
void saveOasisHeaderFooter (KoXmlWriter &xmlWriter) const
void loadOasisObjects (const QDomElement &e, KoOasisLoadingContext &oasisContext)
void loadOasisSettings (const KoOasisSettings::NamedMap &settings)
void saveOasisSettings (KoXmlWriter &settingsWriter) const
void saveOasisPrintStyleLayout (KoGenStyle &style) const
virtual bool saveChildren (KoStore *_store, const QString &_path)
bool saveOasisObjects (KoStore *store, KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, int &indexObj, int &partIndexObj)
virtual bool loadChildren (KoStore *_store)
bool isLoading ()
QPtrList< EmbeddedObjectgetSelectedObjects ()
KoRect getRealRect (bool all)
KCommand * moveObject (View *_view, double diffx, double diffy)
KCommand * moveObject (View *m_view, const KoPoint &_move, bool key)
void unifyObjectName (EmbeddedObject *object)
LayoutDirection layoutDirection () const
void setLayoutDirection (LayoutDirection dir)
bool isRightToLeft () const
void password (QCString &passwd) const
bool isProtected () const
void setProtected (QCString const &passwd)
bool checkPassword (QCString const &passwd) const
void setDefaultHeight (double height)
void setDefaultWidth (double width)
const ColumnFormatcolumnFormat (int _column) const
ColumnFormatcolumnFormat (int _column)
ColumnFormatnonDefaultColumnFormat (int _column, bool force_creation=true)
const RowFormatrowFormat (int _row) const
RowFormatrowFormat (int _row)
RowFormatnonDefaultRowFormat (int _row, bool force_creation=true)
CellfirstCell () const
RowFormatfirstRow () const
ColumnFormatfirstCol () const
CellcellAt (int _column, int _row) const
CellcellAt (int _column, int _row, bool _scrollbar_update=false)
CellcellAt (const QPoint &_point, bool _scrollbar_update=false)
CellvisibleCellAt (int _column, int _row, bool _scrollbar_update=false)
CellnonDefaultCell (int _column, int _row, bool _scrollbar_update=false, Style *_style=0)
CellnonDefaultCell (QPoint const &cellRef, bool scroll=false)
CelldefaultCell () const
FormatdefaultFormat ()
const FormatdefaultFormat () const
Value value (int col, int row) const
Value valueRange (int col1, int row1, int col2, int row2) const
QRect visibleRect (Canvas const *const _canvas) const
int topRow (double _ypos, double &_top, const Canvas *_canvas=0L) const
int bottomRow (double _ypos, const Canvas *_canvas=0L) const
int leftColumn (double _xpos, double &_left, const Canvas *_canvas=0L) const
int rightColumn (double _xpos, const Canvas *_canvas=0L) const
int columnPos (int _col, const Canvas *_canvas=0L) const
double dblColumnPos (int _col, const Canvas *_canvas=0L) const
int rowPos (int _row, const Canvas *_canvas=0L) const
double dblRowPos (int _row, const Canvas *_canvas=0L) const
double sizeMaxX () const
double sizeMaxY () const
void adjustSizeMaxX (double _x)
void adjustSizeMaxY (double _y)
void setLayoutDirtyFlag ()
void setCalcDirtyFlag ()
void recalc (bool force)
void recalc ()
void valueChanged (Cell *cell)
QString guessColumnTitle (QRect &area, int col)
QString guessRowTitle (QRect &area, int row)
void setText (int row, int column, const QString &text, bool asString=false)
void setArrayFormula (Selection *selectionInfo, const QString &_text)
void setSelectionFont (Selection *selectionInfo, const char *_font=0L, int _size=-1, signed char _bold=-1, signed char _italic=-1, signed char _underline=-1, signed char _strike=-1)
void setSelectionMoneyFormat (Selection *selectionInfo, bool b)
void setSelectionAlign (Selection *selectionInfo, Format::Align _align)
void setSelectionAlignY (Selection *selectionInfo, Format::AlignY _alignY)
void setSelectionPrecision (Selection *selectionInfo, int _delta)
void setSelectionPercent (Selection *selectionInfo, bool b)
void setSelectionMultiRow (Selection *selectionInfo, bool enable)
void setSelectionStyle (Selection *selectionInfo, Style *style)
void setSelectionSize (Selection *selectionInfo, int _size)
void setSelectionUpperLower (Selection *selectionInfo, int _type)
void setSelectionfirstLetterUpper (Selection *selectionInfo)
void setSelectionVerticalText (Selection *selectionInfo, bool _b)
void setSelectionComment (Selection *selectionInfo, const QString &_comment)
void setSelectionRemoveComment (Selection *selectionInfo)
void setSelectionAngle (Selection *selectionInfo, int _value)
void setSelectionTextColor (Selection *selectionInfo, const QColor &tbColor)
void setSelectionbgColor (Selection *selectionInfo, const QColor &bg_Color)
void setSelectionBorderColor (Selection *selectionInfo, const QColor &bd_Color)
void deleteSelection (Selection *selectionInfo, bool undo=true)
void copySelection (Selection *selectionInfo)
void cutSelection (Selection *selectionInfo)
void clearTextSelection (Selection *selectionInfo)
void clearValiditySelection (Selection *selectionInfo)
void clearConditionalSelection (Selection *selectionInfo)
void fillSelection (Selection *selectionInfo, int direction)
void setWordSpelling (Selection *selectionInfo, const QString _listWord)
QString getWordSpelling (Selection *selectionInfo)
void paste (const QRect &pasteArea, bool makeUndo=true, Paste::Mode=Paste::Normal, Paste::Operation=Paste::OverWrite, bool insert=false, int insertTo=0, bool pasteFC=false, QClipboard::Mode clipboardMode=QClipboard::Clipboard)
void paste (const QByteArray &data, const QRect &pasteArea, bool makeUndo=false, Paste::Mode=Paste::Normal, Paste::Operation=Paste::OverWrite, bool insert=false, int insertTo=0, bool pasteFC=false)
void defaultSelection (Selection *selectionInfo)
void pasteTextPlain (QString &_text, QRect pasteArea)
void sortByRow (const QRect &area, int ref_row, SortingOrder)
void sortByRow (const QRect &area, int key1, int key2, int key3, SortingOrder order1, SortingOrder order2, SortingOrder order3, QStringList const *firstKey, bool copyFormat, bool headerRow, Point const &outputPoint, bool respectCase)
void sortByColumn (const QRect &area, int ref_column, SortingOrder)
void sortByColumn (const QRect &area, int key1, int key2, int key3, SortingOrder order1, SortingOrder order2, SortingOrder order3, QStringList const *firstKey, bool copyFormat, bool headerCol, Point const &outputPoint, bool respectCase)
void swapCells (int x1, int y1, int x2, int y2, bool cpFormat)
void copyCells (int x1, int y1, int x2, int y2, bool cpFormat)
void setSeries (const QPoint &_marker, double start, double end, double step, Series mode, Series type)
bool shiftRow (const QRect &_rect, bool makeUndo=true)
bool shiftColumn (const QRect &rect, bool makeUndo=true)
void unshiftColumn (const QRect &rect, bool makeUndo=true)
void unshiftRow (const QRect &rect, bool makeUndo=true)
bool insertColumn (int col, int nbCol=0, bool makeUndo=true)
bool insertRow (int row, int nbRow=0, bool makeUndo=true)
void removeColumn (int col, int nbCol=0, bool makeUndo=true)
void removeRow (int row, int nbRow=0, bool makeUndo=true)
void hideRow (const Region &)
void emitHideRow ()
void showRow (const Region &)
void hideColumn (const Region &)
void emitHideColumn ()
void showColumn (const Region &)
void adjustArea (const Region &)
void adjustColumn (const Region &)
void adjustRow (const Region &)
void borderLeft (Selection *selectionInfo, const QColor &_color)
void borderTop (Selection *selectionInfo, const QColor &_color)
void borderOutline (Selection *selectionInfo, const QColor &_color)
void borderAll (Selection *selectionInfo, const QColor &_color)
void borderRemove (Selection *selectionInfo)
void borderBottom (Selection *selectionInfo, const QColor &_color)
void borderRight (Selection *selectionInfo, const QColor &_color)
void setConditional (Selection *selectionInfo, QValueList< Conditional > const &newConditions)
void setValidity (Selection *selectionInfo, KSpread::Validity tmp)
bool getShowGrid () const
void setShowGrid (bool _showGrid)
bool getShowFormula () const
void setShowFormula (bool _showFormula)
bool getShowFormulaIndicator () const
void setShowFormulaIndicator (bool _showFormulaIndicator)
bool getShowCommentIndicator () const
void setShowCommentIndicator (bool b)
bool getLcMode () const
void setLcMode (bool _lcMode)
bool getAutoCalc () const
void setAutoCalc (bool _AutoCalc)
bool getShowColumnNumber () const
void setShowColumnNumber (bool _showColumnNumber)
bool getHideZero () const
void setHideZero (bool _hideZero)
bool getFirstLetterUpper () const
void setFirstLetterUpper (bool _firstUpper)
void changeMergedCell (int, int, int, int)
void mergeCells (const Region &region, bool hor=false, bool ver=false)
void dissociateCells (const Region &region)
void increaseIndent (Selection *selectionInfo)
void decreaseIndent (Selection *selectionInfo)
bool areaIsEmpty (const Region &area, TestType _type=Text)
void refreshPreference ()
void hideSheet (bool _hide)
void removeSheet ()
QRect selectionCellMerged (const QRect &_sel)
void changeNameCellRef (const QPoint &pos, bool fullRowOrColumn, ChangeRef ref, QString tabname, int NbCol=1, UndoInsertRemoveAction *undo=0)
void refreshRemoveAreaName (const QString &_areaName)
void refreshChangeAreaName (const QString &_areaName)
void refreshChart (const QPoint &pos, bool fullRowOrColumn, ChangeRef ref)
void refreshMergedCell ()
bool isHidden () const
void setHidden (bool hidden)
QPainter & painter ()
QWidget * widget () const
bool isShowPageBorders () const
void setShowPageBorders (bool _b)
void addCellBinding (CellBinding *_bind)
void removeCellBinding (CellBinding *_bind)
CellBindingfirstCellBinding ()
CellBindingnextCellBinding ()
bool getCellRectangle (const QRect &_range, QPtrList< Cell > &_list)
SheetfindSheet (const QString &_name)
void insertCell (Cell *_cell)
void insertColumnFormat (ColumnFormat *_l)
void insertRowFormat (RowFormat *_l)
QDomDocument saveCellRegion (const Region &, bool copy=false, bool era=false)
bool loadSelection (const QDomDocument &doc, const QRect &pasteArea, int _xshift, int _yshift, bool makeUndo, Paste::Mode=Paste::Normal, Paste::Operation=Paste::OverWrite, bool insert=false, int insertTo=0, bool paste=false)
void loadSelectionUndo (const QDomDocument &doc, const QRect &loadArea, int _xshift, int _yshift, bool insert, int insertTo)
bool testAreaPasteInsert () const
void deleteCells (const Region &region)
bool testListChoose (Selection *selectionInfo)
QString copyAsText (Selection *selection)
void autofill (QRect &src, QRect &dest)
bool insertChild (const KoRect &_geometry, KoDocumentEntry &)
bool insertChart (const KoRect &_geometry, KoDocumentEntry &, const QRect &_data)
bool insertPicture (const KoPoint &point, const KURL &file)
bool insertPicture (const KoPoint &point, const QPixmap &pixmap)
void changeChildGeometry (EmbeddedKOfficeObject *_child, const KoRect &_geometry)
const QColorGroup & colorGroup ()
int id () const
int maxColumn () const
void checkRangeHBorder (int _column)
int maxRow () const
void checkRangeVBorder (int _row)
void enableScrollBarUpdates (bool _enable)
virtual DCOPObject * dcopObject ()
void printDebug ()
void updateCell (Cell *_cell, int _col, int _row)
void updateCellArea (const Region &cellArea)
void update ()
void updateView ()
void updateView (QRect const &rect)
void updateView (Region *)
void refreshView (const Region &region)
void emit_updateRow (RowFormat *_format, int _row, bool repaint=true)
void emit_updateColumn (ColumnFormat *_format, int _column)
const QPen & emptyPen () const
const QBrush & emptyBrush () const
const QColor & emptyColor () const
void updateLocale ()
void setRegionPaintDirty (QRect const &range)
void setRegionPaintDirty (Region const &region)
void clearPaintDirtyData ()
bool cellIsPaintDirty (QPoint const &cell) const
CellgetFirstCellColumn (int col) const
CellgetLastCellColumn (int col) const
CellgetFirstCellRow (int row) const
CellgetLastCellRow (int row) const
CellgetNextCellUp (int col, int row) const
CellgetNextCellDown (int col, int row) const
CellgetNextCellLeft (int col, int row) const
CellgetNextCellRight (int col, int row) const
SheetPrintprint () const
KSpread::DependencyManagerdependencies ()
int numSelected () const

Static Public Member Functions

static Sheetfind (int _id)

Protected Types

enum  SelectionType { CompleteRows, CompleteColumns, CellRegion }

Protected Slots

void slotAreaModified (const QString &name)

Protected Member Functions

void updateAllDependencies ()
void changeCellTabName (QString const &old_name, QString const &new_name)
bool loadRowFormat (const QDomElement &row, int &rowIndex, KoOasisLoadingContext &oasisContext, QDict< Style > &styleMap)
bool loadColumnFormat (const QDomElement &row, const KoOasisStyles &oasisStyles, int &indexCol, const QDict< Style > &styleMap)
bool loadSheetStyleFormat (QDomElement *style)
void loadOasisMasterLayoutPage (KoStyleStack &styleStack)
QString saveOasisSheetStyleName (KoGenStyles &mainStyles)
void saveOasisColRowCell (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, int maxCols, int maxRows, GenValidationStyles &valStyle)
void saveOasisCells (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, int row, int maxCols, GenValidationStyles &valStyle)
void convertPart (const QString &part, KoXmlWriter &writer) const
void addText (const QString &text, KoXmlWriter &writer) const
void maxRowCols (int &maxCols, int &maxRows)
bool compareRows (int row1, int row2, int &maxCols) const
QString getPart (const QDomNode &part)
void replaceMacro (QString &text, const QString &old, const QString &newS)
void insertObject (EmbeddedObject *_obj)
void fillSequence (QPtrList< Cell > &_srcList, QPtrList< Cell > &_destList, QPtrList< AutoFillSequence > &_seqList, bool down=true)
SelectionType workOnCells (Selection *selectionInfo, CellWorker &worker)

Static Protected Attributes

static int s_id
static QIntDict< Sheet > * s_mapSheets

Properties

QString sheetName []
bool autoCalc []
bool showGrid []

Friends

class Cell

Classes

struct  CellWorker
struct  CellWorkerTypeA

Member Function Documentation

QString KSpread::Sheet::sheetName (  )  const

Return the name of this sheet.

QString KSpread::Sheet::tableName (  )  const [inline]

Deprecated:
Use sheetName().

Definition at line 212 of file kspread_sheet.h.

bool KSpread::Sheet::setSheetName ( const QString &  name,
bool  init = false,
bool  makeUndo = true 
)

Renames a sheet.

This will automatically adapt all formulas in all sheets and all cells to reflect the new name.

If the name really changed then sig_nameChanged is emitted and the GUI will reflect the change.

Parameters:
init If set to true then no formula will be changed and no signal will be emitted and no undo action created. Usually you dont want to do that.
Returns:
false if the sheet could not be renamed. Usually the reason is that this name is already used.
See also:
changeCellTabName

TabBar::renameTab

sheetName

Definition at line 8389 of file kspread_sheet.cc.

QDomElement KSpread::Sheet::saveXML ( QDomDocument &   )  [virtual]

Saves the sheet and all it's children in XML format.

Definition at line 5917 of file kspread_sheet.cc.

bool KSpread::Sheet::loadXML ( const QDomElement &   )  [virtual]

Loads the sheet and all it's children in XML format.

Definition at line 7627 of file kspread_sheet.cc.

bool KSpread::Sheet::saveChildren ( KoStore *  _store,
const QString &  _path 
) [virtual]

Saves a children.

Definition at line 8250 of file kspread_sheet.cc.

bool KSpread::Sheet::loadChildren ( KoStore *  _store  )  [virtual]

Loads a children.

Definition at line 7978 of file kspread_sheet.cc.

QPtrList< EmbeddedObject > KSpread::Sheet::getSelectedObjects (  ) 

Get a list of all selected objects.

Returns:
list of selected objets.

Definition at line 6108 of file kspread_sheet.cc.

KoRect KSpread::Sheet::getRealRect ( bool  all  ) 

get the rect for the objects

Parameters:
all true if the rect for all objects shoud be returned false if only the rect for selected objects sould be returned
Returns:
rect of the objects

Definition at line 6123 of file kspread_sheet.cc.

void KSpread::Sheet::unifyObjectName ( EmbeddedObject object  ) 

Create a uniq name for an object.

Create a uniq name for the object. If no name is set for the object a name according to its type is created. If the name already exists append ' (x)'. // FIXME: not allowed by I18N

Parameters:
object to work on

Definition at line 6222 of file kspread_sheet.cc.

Sheet::LayoutDirection KSpread::Sheet::layoutDirection (  )  const

Returns the layout direction of the sheet.

Definition at line 455 of file kspread_sheet.cc.

void KSpread::Sheet::setLayoutDirection ( LayoutDirection  dir  ) 

Sets the layout direction of the sheet.

For example, for Arabic or Hebrew documents, it is possibly to layout the sheet from right to left.

Definition at line 460 of file kspread_sheet.cc.

bool KSpread::Sheet::isRightToLeft (  )  const

Deprecated:
Use direction().

Definition at line 465 of file kspread_sheet.cc.

ColumnFormat * KSpread::Sheet::nonDefaultColumnFormat ( int  _column,
bool  force_creation = true 
)

If no special ColumnFormat exists for this column, then a new one is created.

Returns:
a non default ColumnFormat for this column.

Definition at line 1057 of file kspread_sheet.cc.

RowFormat * KSpread::Sheet::nonDefaultRowFormat ( int  _row,
bool  force_creation = true 
)

If no special RowFormat exists for this row, then a new one is created.

Returns:
a non default RowFormat for this row.

Definition at line 1072 of file kspread_sheet.cc.

Cell * KSpread::Sheet::firstCell (  )  const

Returns:
the first cell of this sheet.

Next cells can be retrieved by calling Cell::nextCell.

Definition at line 1018 of file kspread_sheet.cc.

Cell * KSpread::Sheet::cellAt ( int  _column,
int  _row,
bool  _scrollbar_update = false 
)

Parameters:
_scrollbar_update will change the scrollbar if set to true disregarding whether _column/_row are bigger than m_iMaxRow/m_iMaxColumn.

May be overruled by m_bScrollbarUpdates.

Definition at line 1042 of file kspread_sheet.cc.

Cell* KSpread::Sheet::cellAt ( const QPoint &  _point,
bool  _scrollbar_update = false 
) [inline]

A convenience function.

Definition at line 366 of file kspread_sheet.h.

Cell * KSpread::Sheet::visibleCellAt ( int  _column,
int  _row,
bool  _scrollbar_update = false 
)

Returns:
the pointer to the cell that is visible at a certain position.

That means If the cell at this position is obscured then the obscuring cell is returned.

Parameters:
_scrollbar_update will change the scrollbar if set to true disregarding whether _column/_row are bigger than m_iMaxRow/m_iMaxColumn. May be overruled by m_bScrollbarUpdates.

Definition at line 1009 of file kspread_sheet.cc.

Cell * KSpread::Sheet::nonDefaultCell ( int  _column,
int  _row,
bool  _scrollbar_update = false,
Style _style = 0 
)

If no special Cell exists for this position then a new one is created.

Parameters:
_scrollbar_update will change the scrollbar if set to true disregarding whether _column/_row are bigger than m_iMaxRow/m_iMaxColumn. May be overruled by m_bScrollbarUpdates.
Returns:
a non default Cell for the position.

Definition at line 1087 of file kspread_sheet.cc.

Value KSpread::Sheet::value ( int  col,
int  row 
) const

retrieve a value

Definition at line 648 of file kspread_sheet.cc.

Value KSpread::Sheet::valueRange ( int  col1,
int  row1,
int  col2,
int  row2 
) const

retrieve a range of values

Definition at line 657 of file kspread_sheet.cc.

int KSpread::Sheet::columnPos ( int  _col,
const Canvas _canvas = 0L 
) const

Returns:
the left corner of the column as int.

Parameters:
_canvas If not 0 then the returned position is in screen coordinates. Otherwise the point (0|0) is in the upper left corner of the sheet.

Definition at line 966 of file kspread_sheet.cc.

double KSpread::Sheet::dblColumnPos ( int  _col,
const Canvas _canvas = 0L 
) const

Returns:
the left corner of the column as double.

Use this method, when you later calculate other positions depending on this one to avoid rounding problems

Parameters:
_canvas If not 0 then the returned position is in screen coordinates. Otherwise the point (0|0) is in the upper left corner of the sheet.

Definition at line 946 of file kspread_sheet.cc.

int KSpread::Sheet::rowPos ( int  _row,
const Canvas _canvas = 0L 
) const

Returns:
the top corner of the row as int.

Parameters:
_canvas If not 0 then the returned position is in screen coordinates. Otherwise the point (0|0) is in the upper top corner of the sheet.

Definition at line 993 of file kspread_sheet.cc.

double KSpread::Sheet::dblRowPos ( int  _row,
const Canvas _canvas = 0L 
) const

Returns:
the top corner of the row as double.

Use this method, when you later calculate other positions depending on this one to avoid rounding problems

Parameters:
_canvas If not 0 then the returned position is in screen coordinates. Otherwise the point (0|0) is in the upper top corner of the sheet.

Definition at line 972 of file kspread_sheet.cc.

double KSpread::Sheet::sizeMaxX (  )  const

Returns:
the maximum size of the column range

Definition at line 724 of file kspread_sheet.cc.

double KSpread::Sheet::sizeMaxY (  )  const

Returns:
the maximum size of the row range

Definition at line 729 of file kspread_sheet.cc.

void KSpread::Sheet::adjustSizeMaxX ( double  _x  ) 

Adjusts the internal reference of the sum of the widths of all columns.

Used in resizing of columns.

Definition at line 999 of file kspread_sheet.cc.

void KSpread::Sheet::adjustSizeMaxY ( double  _y  ) 

Adjusts the internal reference of the sum of the heights of all rows.

Used in resizing of rows.

Definition at line 1004 of file kspread_sheet.cc.

void KSpread::Sheet::setLayoutDirtyFlag (  ) 

Sets the Cell::layoutDirtyFlag in all cells.

Definition at line 1191 of file kspread_sheet.cc.

void KSpread::Sheet::setCalcDirtyFlag (  ) 

Sets the Cell::calcDirtyFlag in all cells.

That means that the cells are marked dirty and will recalculate if requested. This function does only MARK, it does NOT actually calculate. Use recalc to recaculate dirty values.

Definition at line 1198 of file kspread_sheet.cc.

void KSpread::Sheet::recalc ( bool  force  ) 

Recalculates the current sheet.

If you want to recalculate EVERYTHING, then call Sheet::setCalcDirtyFlag for all sheets in the m_pMap to make sure that no invalid values in other sheets make you trouble.

Recalc will do nothing if automatic calculation is disabled (via Sheet::setAutoCalc ). unless the force flag is set to true. Automatic recalculation is enabled by default.

Parameters:
force If false, the sheet will be recalculated if automatic calculation is enabled. If true, the sheet will be recalculated regardless of the automatic calculation setting.

Definition at line 1225 of file kspread_sheet.cc.

void KSpread::Sheet::recalc (  ) 

Recalculates the current sheet, if automatic recalculation is enabled.

Definition at line 1220 of file kspread_sheet.cc.

void KSpread::Sheet::valueChanged ( Cell cell  ) 

handles the fact that a cell has been changed - updates things that need to be updated

Definition at line 1275 of file kspread_sheet.cc.

QString KSpread::Sheet::guessColumnTitle ( QRect &  area,
int  col 
)

Attempts to guess the title (or 'header') of a column, within a given area of the sheet This is used, for example, by the Data Sort dialog, to guess the names of columns within the selected area.

An empty string may be returned if guessColumnTitle does not think that column col has a title.

Parameters:
area The area within the sheet to guess from
col The column to find the title (or 'header') for.

Definition at line 4249 of file kspread_sheet.cc.

QString KSpread::Sheet::guessRowTitle ( QRect &  area,
int  row 
)

Attempts to guess the title (or 'header') of a row, within a given area of the sheet This is used, for example, by the Data Sort dialog, to guess the names of rows within the selected area.

An empty string may be returned if guessRowTitle does not think that row row has a title.

Parameters:
area The area within the sheet to guess from
row The row to find the title (or 'header') for.

Definition at line 4275 of file kspread_sheet.cc.

void KSpread::Sheet::setText ( int  row,
int  column,
const QString &  text,
bool  asString = false 
)

Sets the contents of the cell at row,column to text.

Definition at line 1116 of file kspread_sheet.cc.

void KSpread::Sheet::setSelectionSize ( Selection selectionInfo,
int  _size 
)

setSelectionSize increase or decrease font size

Definition at line 1748 of file kspread_sheet.cc.

void KSpread::Sheet::setSelectionUpperLower ( Selection selectionInfo,
int  _type 
)

change string to upper case if _type equals 1 or change string to lower if _type equals -1

Definition at line 1793 of file kspread_sheet.cc.

void KSpread::Sheet::deleteSelection ( Selection selectionInfo,
bool  undo = true 
)

Parameters:
_marker is used if there is no selection currently.

In this case the cell on which the marker is will be deleted.

Definition at line 5626 of file kspread_sheet.cc.

void KSpread::Sheet::copySelection ( Selection selectionInfo  ) 

Parameters:
_marker is used if there is no selection currently.

In this case the cell on which the marker is will be copied.

Definition at line 5075 of file kspread_sheet.cc.

void KSpread::Sheet::cutSelection ( Selection selectionInfo  ) 

Parameters:
_marker is used if there is no selection currently.

In this case the cell on which the marker is will be cut.

Definition at line 5094 of file kspread_sheet.cc.

void KSpread::Sheet::clearTextSelection ( Selection selectionInfo  ) 

Parameters:
_marker is used if there is no selection currently.

In this case the cell on which the marker is will be cleared.

Definition at line 4618 of file kspread_sheet.cc.

void KSpread::Sheet::paste ( const QRect &  pasteArea,
bool  makeUndo = true,
Paste::Mode  = Paste::Normal,
Paste::Operation  = Paste::OverWrite,
bool  insert = false,
int  insertTo = 0,
bool  pasteFC = false,
QClipboard::Mode  clipboardMode = QClipboard::Clipboard 
)

A convenience function which retrieves the data to be pasted from the clipboard.

Definition at line 5115 of file kspread_sheet.cc.

void KSpread::Sheet::pasteTextPlain ( QString &  _text,
QRect  pasteArea 
)

A function which allows to paste a text plain from the clipboard.

Definition at line 5152 of file kspread_sheet.cc.

void KSpread::Sheet::copyCells ( int  x1,
int  y1,
int  x2,
int  y2,
bool  cpFormat 
)

Parameters:
x1,y1,: values from source cell,

Parameters:
x2,y2,: values from target cell
cpFormat,: if true: cell format gets copied, too

Definition at line 3857 of file kspread_sheet.cc.

bool KSpread::Sheet::shiftRow ( const QRect &  _rect,
bool  makeUndo = true 
)

Moves all cells of the row _marker.y() which are in the column _marker.x() or right hand of that one position to the right.

Returns:
true if the shift was possible, or false otherwise. A reason for returning false is that there was a cell in the right most position.

Definition at line 2390 of file kspread_sheet.cc.

bool KSpread::Sheet::insertColumn ( int  col,
int  nbCol = 0,
bool  makeUndo = true 
)

Moves all columns which are >= col one position to the right and inserts a new and empty column.

After this the sheet is redrawn. nbCol is the number of column which are installing

Definition at line 2526 of file kspread_sheet.cc.

bool KSpread::Sheet::insertRow ( int  row,
int  nbRow = 0,
bool  makeUndo = true 
)

Moves all rows which are >= row one position down and inserts a new and empty row.

After this the sheet is redrawn.

Definition at line 2569 of file kspread_sheet.cc.

void KSpread::Sheet::removeColumn ( int  col,
int  nbCol = 0,
bool  makeUndo = true 
)

Deletes the column col and redraws the sheet.

Definition at line 2612 of file kspread_sheet.cc.

void KSpread::Sheet::removeRow ( int  row,
int  nbRow = 0,
bool  makeUndo = true 
)

Deletes the row row and redraws the sheet.

Definition at line 2649 of file kspread_sheet.cc.

void KSpread::Sheet::hideRow ( const Region  ) 

hide row

Definition at line 2686 of file kspread_sheet.cc.

void KSpread::Sheet::hideColumn ( const Region  ) 

hide column

Definition at line 2712 of file kspread_sheet.cc.

void KSpread::Sheet::adjustArea ( const Region  ) 

Adjust columns and rows of a region.

Definition at line 4572 of file kspread_sheet.cc.

void KSpread::Sheet::adjustColumn ( const Region  ) 

Adjust columns of a region.

Definition at line 4582 of file kspread_sheet.cc.

void KSpread::Sheet::adjustRow ( const Region  ) 

Adjust rows of a region.

Definition at line 4591 of file kspread_sheet.cc.

void KSpread::Sheet::borderLeft ( Selection selectionInfo,
const QColor &  _color 
)

Install borders.

Definition at line 3053 of file kspread_sheet.cc.

bool KSpread::Sheet::getShowGrid (  )  const

Returns, if the grid shall be shown on the screen.

Definition at line 480 of file kspread_sheet.cc.

void KSpread::Sheet::setShowGrid ( bool  _showGrid  ) 

Sets, if the grid shall be shown on the screen.

Definition at line 485 of file kspread_sheet.cc.

bool KSpread::Sheet::getShowFormula (  )  const

Sets, if formula shall be shown instead of the result.

Definition at line 490 of file kspread_sheet.cc.

bool KSpread::Sheet::getShowFormulaIndicator (  )  const

Sets, if indicator must be shown when the cell holds a formula.

Definition at line 500 of file kspread_sheet.cc.

bool KSpread::Sheet::getShowCommentIndicator (  )  const

Returns true if comment indicator is visible.

Definition at line 510 of file kspread_sheet.cc.

void KSpread::Sheet::setShowCommentIndicator ( bool  b  ) 

If b is true, comment indicator is visible, otherwise it will be hidden.

Definition at line 515 of file kspread_sheet.cc.

void KSpread::Sheet::mergeCells ( const Region region,
bool  hor = false,
bool  ver = false 
)

Parameters:
region the region to merge

Parameters:
hor merge horizontally
ver merge vertically

Definition at line 5719 of file kspread_sheet.cc.

void KSpread::Sheet::changeNameCellRef ( const QPoint &  pos,
bool  fullRowOrColumn,
ChangeRef  ref,
QString  tabname,
int  NbCol = 1,
UndoInsertRemoveAction undo = 0 
)

Change name of reference when the user inserts or removes a column, a row or a cell (= insertion of a row [or column] on a single column [or row]).

For example the formula =Sheet1!A1 is changed into =Sheet1!B1 if a Column is inserted before A.

Parameters:
pos the point of insertion (only one coordinate may be used, depending on the other parameters).
fullRowOrColumn if true, a whole row or column has been inserted/removed. if false, we inserted or removed a cell
ref see ChangeRef
tabname completes the pos specification by giving the sheet name
undo is the handler of the undo class in case of lost cell references

Definition at line 2796 of file kspread_sheet.cc.

void KSpread::Sheet::refreshChart ( const QPoint &  pos,
bool  fullRowOrColumn,
ChangeRef  ref 
)

Update chart when you insert or remove row or column.

Parameters:
pos the point of insertion (only one coordinate may be used, depending on the other parameters).
fullRowOrColumn if true, a whole row or column has been inserted/removed. if false, we inserted or removed a cell
ref see ChangeRef
tabname completes the pos specification by giving the sheet name

Definition at line 2738 of file kspread_sheet.cc.

void KSpread::Sheet::refreshMergedCell (  ) 

Refresh merged cell when you insert or remove row or column.

Definition at line 2785 of file kspread_sheet.cc.

bool KSpread::Sheet::isHidden (  )  const

Returns:
true if this sheet is hidden

Definition at line 470 of file kspread_sheet.cc.

void KSpread::Sheet::setHidden ( bool  hidden  ) 

Hides or shows this sheets.

Definition at line 475 of file kspread_sheet.cc.

QPainter & KSpread::Sheet::painter (  ) 

Returns:
a painter for the hidden widget ( widget ).

This function is useful while making formats where you need some QPainter related functions.

Definition at line 688 of file kspread_sheet.cc.

QWidget * KSpread::Sheet::widget (  )  const

Returns:
a hidden widget.

See also:
painter

Definition at line 693 of file kspread_sheet.cc.

bool KSpread::Sheet::isShowPageBorders (  )  const

Returns:
a flag that indicates whether the sheet should paint the page breaks.

See also:
setShowPageBorders

bShowPageBorders

Definition at line 583 of file kspread_sheet.cc.

void KSpread::Sheet::setShowPageBorders ( bool  _b  ) 

Turns the page break lines on or off.

See also:
isShowPageBorders

bShowPageBorders

Definition at line 7995 of file kspread_sheet.cc.

bool KSpread::Sheet::getCellRectangle ( const QRect &  _range,
QPtrList< Cell > &  _list 
)

Used by the 'chart' to get the sheet on which the chart is build.

The cells we are interested in are in the rectangle '_range'. The cells are stored row after row in '_list'.

Sheet * KSpread::Sheet::findSheet ( const QString &  _name  ) 

A convenience function that finds a sheet by its name.

Definition at line 8018 of file kspread_sheet.cc.

void KSpread::Sheet::insertCell ( Cell _cell  ) 

Inserts the _cell into the sheet.

All cells depending on this cell will be actualized. The border range will be actualized, when the cell is out of current range.

Definition at line 8027 of file kspread_sheet.cc.

void KSpread::Sheet::insertColumnFormat ( ColumnFormat _l  ) 

Used by Undo.

See also:
UndoDeleteColumn

Definition at line 8040 of file kspread_sheet.cc.

void KSpread::Sheet::insertRowFormat ( RowFormat _l  ) 

Used by Undo.

See also:
UndoDeleteRow

Definition at line 8045 of file kspread_sheet.cc.

QDomDocument KSpread::Sheet::saveCellRegion ( const Region ,
bool  copy = false,
bool  era = false 
)

See also:
copy

Parameters:
era set this to true if you want to encode relative references absolutely (they will be switched back to relative references during decoding) - used for cut to clipboard

Definition at line 5782 of file kspread_sheet.cc.

bool KSpread::Sheet::loadSelection ( const QDomDocument &  doc,
const QRect &  pasteArea,
int  _xshift,
int  _yshift,
bool  makeUndo,
Paste::Mode  = Paste::Normal,
Paste::Operation  = Paste::OverWrite,
bool  insert = false,
int  insertTo = 0,
bool  paste = false 
)

insertTo defined if you insert to the bottom or right insert to bottom if insertTo==1 insert to right if insertTo ==-1 insertTo used just for insert/paste an area

See also:
paste

Definition at line 5249 of file kspread_sheet.cc.

bool KSpread::Sheet::testAreaPasteInsert (  )  const

Used when you insert and paste cell return true if it's a area false if it's a column/row it's used to select if you want to insert at the bottom or right.

See also:
paste

Definition at line 5524 of file kspread_sheet.cc.

void KSpread::Sheet::deleteCells ( const Region region  ) 

Deletes all cells in the given rectangle.

The display is NOT updated by this function. This function can be used to clear an area before you paste something from the clipboard in this area.

Parameters:
region The region that contains the cells that should be deleted
See also:
loadCells

Definition at line 5559 of file kspread_sheet.cc.

bool KSpread::Sheet::testListChoose ( Selection selectionInfo  ) 

Return true if there are text value in cell so you can create list selection.

Definition at line 5750 of file kspread_sheet.cc.

QString KSpread::Sheet::copyAsText ( Selection selection  ) 

returns the text to be copied to the clipboard

Definition at line 5021 of file kspread_sheet.cc.

void Sheet::autofill ( QRect &  src,
QRect &  dest 
)

Assume that the retangle 'src' was already selected.

Then the user clicked on the lower right corner of the marker and resized the area ( left mouse button ). Once he releases the mouse we have to autofill the region 'dest'. Mention that src.left() == dest.left() and src.top() == dest.top().

See also:
mouseReleaseEvent

Definition at line 579 of file kspread_autofill.cc.

bool KSpread::Sheet::insertPicture ( const KoPoint &  point,
const KURL &  file 
)

Creates a new embedded picture object and inserts it into the sheet next to the currently selected cell.

TODO: Remove this method in future and provide a better way of opening pictures and inserting them into the sheet.

Parameters:
file The URL of the file to insert.
point The the top-left point in the sheet where the picture should be inserted.

Definition at line 8171 of file kspread_sheet.cc.

bool KSpread::Sheet::insertPicture ( const KoPoint &  point,
const QPixmap &  pixmap 
)

Creates a new embedded picture object and inserts it into the sheet at the specified position.

Parameters:
point The top-left position for the new picture object in the sheet
pixmap The source pixmap for the new picture

Definition at line 8217 of file kspread_sheet.cc.

int KSpread::Sheet::maxColumn (  )  const

Return the currently maximum defined column of the horizontal scrollbar.

It's always 10 times higher than the maximum access column. In an empty sheet it starts with 256.

Definition at line 734 of file kspread_sheet.cc.

void KSpread::Sheet::checkRangeHBorder ( int  _column  ) 

Checks if the argument _column is out of the current maximum range of the vertical border If this is the case, the current maximum value m_iMaxColumn is adjusted and the vertical border is resized.

Use this function with care, as it involves a repaint of the border, when it is out of range.

Definition at line 8343 of file kspread_sheet.cc.

int KSpread::Sheet::maxRow (  )  const

Return the currently maximum defined row of the vertical scrollbar.

It's always 10 times higher than the maximum access row. In an empty sheet it starts with 256.

Definition at line 739 of file kspread_sheet.cc.

void KSpread::Sheet::checkRangeVBorder ( int  _row  ) 

Checks if the argument _row is out of the current maximum range of the horizontal border If this is the case, the current maximum value m_iMaxRow is adjusted and the horizontal border is resized.

Use this function with care, as it involves a repaint of the border, when it is out of range.

Definition at line 8352 of file kspread_sheet.cc.

void KSpread::Sheet::updateCell ( Cell _cell,
int  _col,
int  _row 
)

Calculates the cell if necessary, makes its layout if necessary, and force redraw.

Then it sets the cell's Cell::m_bDisplayDirtyFlag to false.

Definition at line 8067 of file kspread_sheet.cc.

void KSpread::Sheet::updateCellArea ( const Region cellArea  ) 

Like updateCell except it works on a range of cells.

Use this function rather than calling updateCell(..) on several adjacent cells so there will be one paint event instead of several

Definition at line 8059 of file kspread_sheet.cc.

void KSpread::Sheet::update (  ) 

Updates every cell on the sheet.

Definition at line 8050 of file kspread_sheet.cc.

void KSpread::Sheet::updateView (  ) 

repaints all visible cells

Definition at line 5671 of file kspread_sheet.cc.

void KSpread::Sheet::updateView ( QRect const &  rect  ) 

repaints all visible cells in the given rect

Definition at line 5676 of file kspread_sheet.cc.

void KSpread::Sheet::updateView ( Region  ) 

repaints all visible cells in the given rect

Definition at line 5681 of file kspread_sheet.cc.

void KSpread::Sheet::refreshView ( const Region region  ) 

used to refresh cells when you make redodelete

Definition at line 5686 of file kspread_sheet.cc.

const QPen & KSpread::Sheet::emptyPen (  )  const

Needed for Cell::leftBorderPen and friends, since we can not have a static pen object.

The returned pen has pen style NoPen set.

Definition at line 744 of file kspread_sheet.cc.

void KSpread::Sheet::setRegionPaintDirty ( QRect const &  range  ) 

set a region of the spreadsheet to be 'paint dirty' meaning it needs repainted.

This is not a flag on the cell itself since quite often this needs set on a default cell

Definition at line 8522 of file kspread_sheet.cc.

void KSpread::Sheet::clearPaintDirtyData (  ) 

Remove all records of 'paint dirty' cells.

Definition at line 8533 of file kspread_sheet.cc.

bool KSpread::Sheet::cellIsPaintDirty ( QPoint const &  cell  )  const

Test whether a cell needs repainted.

Definition at line 8538 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getFirstCellColumn ( int  col  )  const

Retrieve the first used cell in a given column.

Can be used in conjunction with getNextCellDown to loop through a column.

Parameters:
col The column to get the first cell from
Returns:
Returns a pointer to the cell, or NULL if there are no used cells in this column

Definition at line 8435 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getLastCellColumn ( int  col  )  const

Retrieve the last used cell in a given column.

Can be used in conjunction with getNextCellUp to loop through a column.

Parameters:
col The column to get the cell from
Returns:
Returns a pointer to the cell, or NULL if there are no used cells in this column

Definition at line 8438 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getFirstCellRow ( int  row  )  const

Retrieve the first used cell in a given row.

Can be used in conjunction with getNextCellRight to loop through a row.

Parameters:
row The row to get the first cell from
Returns:
Returns a pointer to the cell, or NULL if there are no used cells in this row

Definition at line 8441 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getLastCellRow ( int  row  )  const

Retrieve the last used cell in a given row.

Can be used in conjunction with getNextCellLeft to loop through a row.

Parameters:
row The row to get the last cell from
Returns:
Returns a pointer to the cell, or NULL if there are no used cells in this row

Definition at line 8444 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getNextCellUp ( int  col,
int  row 
) const

Retrieves the next used cell above the given col/row pair.

The given col/row pair does not need to reference a used cell.

Parameters:
col column to start looking through
row the row above which to start looking.
Returns:
Returns the next used cell above this one, or NULL if there are none

Definition at line 8447 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getNextCellDown ( int  col,
int  row 
) const

Retrieves the next used cell below the given col/row pair.

The given col/row pair does not need to reference a used cell.

Parameters:
col column to start looking through
row the row below which to start looking.
Returns:
Returns the next used cell below this one, or NULL if there are none

Definition at line 8450 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getNextCellLeft ( int  col,
int  row 
) const

Retrieves the next used cell to the right of the given col/row pair.

The given col/row pair does not need to reference a used cell.

Parameters:
col the column after which should be searched
row the row to search through
Returns:
Returns the next used cell to the right of this one, or NULL if there are none

Definition at line 8453 of file kspread_sheet.cc.

Cell * KSpread::Sheet::getNextCellRight ( int  col,
int  row 
) const

Retrieves the next used cell to the left of the given col/row pair.

The given col/row pair does not need to reference a used cell.

Parameters:
col the column before which should be searched
row the row to search through
Returns:
Returns the next used cell to the left of this one, or NULL if there are none

Definition at line 8456 of file kspread_sheet.cc.

KSpread::DependencyManager * KSpread::Sheet::dependencies (  ) 

returns a pointer to the dependency manager

Definition at line 759 of file kspread_sheet.cc.

int KSpread::Sheet::numSelected (  )  const

Get the amount of selected objects that belong to this sheet.

Returns:
the amount of select objects in this sheet

Definition at line 764 of file kspread_sheet.cc.

void KSpread::Sheet::sig_nameChanged ( Sheet sheet,
const QString &  old_name 
) [signal]

See also:
setSheetName

void KSpread::Sheet::sig_polygonInvalidated ( const QPointArray &   )  [signal]

Emitted if a certain area of some sheet has to be redrawn.

That is for example the case when a new child is inserted.

void KSpread::Sheet::slotAreaModified ( const QString &  name  )  [protected, slot]

react on modification (add/remove) of a named area

Definition at line 2320 of file kspread_sheet.cc.

void KSpread::Sheet::updateAllDependencies (  )  [protected]

Updates dependencies for all cells on this sheet.

Definition at line 1208 of file kspread_sheet.cc.

void KSpread::Sheet::changeCellTabName ( QString const &  old_name,
QString const &  new_name 
) [protected]

Change the name of a sheet in all formulas.

When you change name sheet Sheet1 -> Price for all cell which refere to Sheet1, this function changes the name.

Definition at line 2365 of file kspread_sheet.cc.

bool KSpread::Sheet::loadColumnFormat ( const QDomElement &  row,
const KoOasisStyles &  oasisStyles,
int indexCol,
const QDict< Style > &  styleMap 
) [protected]

Loads the properties of a column from a table:table-column element in an OASIS XML file defaultColumnCellStyles is a map from column indicies to the default cell style for that column.

Definition at line 6701 of file kspread_sheet.cc.

void Sheet::fillSequence ( QPtrList< Cell > &  _srcList,
QPtrList< Cell > &  _destList,
QPtrList< AutoFillSequence > &  _seqList,
bool  down = true 
) [protected]

See also:
autofill

Definition at line 706 of file kspread_autofill.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys