kspread Library API Documentation

KSpreadDoc Class Reference

This class holds the data that makes up a spreadsheet. More...

#include <kspread_doc.h>

Collaboration diagram for KSpreadDoc:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  STYLE_PAGE = 20, STYLE_COLUMN, STYLE_ROW, STYLE_CELL,
  STYLE_PAGEMASTER, STYLE_USERSTYLE, STYLE_DEFAULTSTYLE, STYLE_NUMERIC_NUMBER
}

Public Slots

void refreshInterface ()
void flushDamages ()

Signals

void sig_updateView ()
void sig_refreshView ()
void sig_refreshLocale ()
void sig_addAreaName (const QString &)
void sig_removeAreaName (const QString &)
void damagesFlushed (const QValueList< KSpread::Damage * > &damages)

Public Member Functions

 KSpreadDoc (QWidget *parentWidget=0, const char *widgetName=0, QObject *parent=0, const char *name=0, bool singleViewMode=false)
 ~KSpreadDoc ()
virtual QCString mimeType () const
KLocale * locale () const
KSpreadMapmap () const
KSpreadStyleManager * styleManager () const
KSpread::ValueParserparser () const
KSpread::ValueFormatterformatter () const
KSpread::ValueConverterconverter () const
KSpread::ValueCalccalc () const
void addCommand (KCommand *command)
void addCommand (KSpreadUndoAction *command)
void undo ()
void redo ()
void undoLock ()
void undoUnlock ()
bool undoLocked () const
KoCommandHistory * commandHistory ()
KoUnit::Unit unit () const
KoUnit::Unit getUnit () const
void setUnit (KoUnit::Unit u)
QString unitName () const
QString getUnitName () const
int syntaxVersion () const
void setShowVerticalScrollBar (bool b)
bool showVerticalScrollBar () const
bool getShowVerticalScrollBar () const
void setShowHorizontalScrollBar (bool b)
bool showHorizontalScrollBar () const
bool getShowHorizontalScrollBar () const
void setShowColumnHeader (bool b)
bool showColumnHeader () const
void setShowColHeader (bool b)
bool getShowColHeader () const
void setShowRowHeader (bool b)
bool showRowHeader () const
bool getShowRowHeader () const
void setGridColor (const QColor &color)
QColor gridColor () const
void setIndentValue (double val)
double indentValue () const
double getIndentValue () const
void setShowStatusBar (bool b)
bool showStatusBar () const
bool getShowStatusBar () const
void setShowTabBar (bool b)
bool showTabBar () const
bool getShowTabBar () const
void setShowFormulaBar (bool b)
bool showFormulaBar () const
bool getShowFormulaBar () const
void setShowCommentIndicator (bool b)
bool showCommentIndicator () const
bool getShowCommentIndicator () const
void setShowMessageError (bool b)
bool showMessageError () const
bool getShowMessageError () const
KGlobalSettings::Completion completionMode () const
void setCompletionMode (KGlobalSettings::Completion _complMode)
KSpread::MoveTo getMoveToValue () const
void setMoveToValue (KSpread::MoveTo _moveTo)
void setTypeOfCalc (MethodOfCalc _calc)
MethodOfCalc getTypeOfCalc () const
void setKSpellConfig (KSpellConfig _kspell)
KSpellConfig * getKSpellConfig () const
bool dontCheckUpperWord () const
void setDontCheckUpperWord (bool _b)
bool dontCheckTitleCase () const
void setDontCheckTitleCase (bool _b)
QColor pageBorderColor () const
void changePageBorderColor (const QColor &_color)
virtual QDomDocument saveXML ()
virtual bool saveOasis (KoStore *store, KoXmlWriter *manifestWriter)
void saveOasisDocumentStyles (KoStore *store, KoGenStyles &mainStyles) const
virtual int supportedSpecialFormats () const
virtual bool loadXML (QIODevice *, const QDomDocument &doc)
virtual bool loadOasis (const QDomDocument &doc, KoOasisStyles &oasisStyles, const QDomDocument &settings, KoStore *)
virtual bool loadChildren (KoStore *_store)
QDomElement saveAreaName (QDomDocument &doc)
void saveOasisAreaName (KoXmlWriter &xmlWriter)
void loadAreaName (const QDomElement &element)
void loadOasisAreaName (const QDomElement &element)
void loadOasisCellValidation (const QDomElement &body)
virtual void addView (KoView *_view)
virtual bool initDoc (InitDocFlags flags, QWidget *parentWidget=0)
virtual void setZoomAndResolution (int zoom, int dpiX, int dpiY)
void newZoomAndResolution (bool updateViews, bool forPrint)
KSpreadInterpreter * interpreter () const
void resetInterpreter ()
KSContext & context ()
void enableUndo (bool _b)
void enableRedo (bool _b)
bool isLoading () const
virtual void paintContent (QPainter &painter, const QRect &rect, bool transparent=false, double zoomX=1.0, double zoomY=1.0)
void paintContent (QPainter &painter, const QRect &rect, bool transparent, KSpreadSheet *sheet, bool drawCursor=true)
bool docData (QString const &xmlTag, QDomElement &data)
void deregisterPlugin (KSpreadPlugin *plugin)
void registerPlugin (KSpreadPlugin *plugin)
void paintCellRegions (QPainter &painter, const QRect &viewRect, KSpreadView *view, QValueList< QRect > cellRegions, const KSpreadSheet *sheet, bool drawCursor)
virtual DCOPObject * dcopObject ()
void addAreaName (const QRect &_rect, const QString &name, const QString &sheetName)
const QValueList< Reference > & listArea ()
void removeArea (const QString &name)
KCompletion & completion ()
void addStringCompletion (const QString &stringCompletion)
void changeAreaSheetName (const QString &oldName, const QString &sheetName)
QRect getRectArea (const QString &_sheetName)
void insertChild (KoDocumentChild *child)
void initConfig ()
void saveConfig ()
void refreshLocale ()
void emitBeginOperation (bool waitCursor)
virtual void emitBeginOperation ()
virtual void emitEndOperation ()
void emitEndOperation (QRect const &rect)
bool delayCalculation () const
void updateBorderButton ()
void insertSheet (KSpreadSheet *sheet)
void takeSheet (KSpreadSheet *sheet)
void addIgnoreWordAll (const QString &word)
void clearIgnoreWordAll ()
void addIgnoreWordAllList (const QStringList &_lst)
QStringList spellListIgnoreAll () const
void setDisplaySheet (KSpreadSheet *_Sheet)
KSpreadSheet * displaySheet () const
KSPLoadingInfoloadingInfo () const
void increaseNumOperation ()
void decreaseNumOperation ()
void addDamage (KSpread::Damage *damage)
void loadConfigFromFile ()
bool configLoadFromFile () const

Static Public Member Functions

static QValueList< KSpreadDoc * > documents ()
static QString getAttribute (const QDomElement &element, const char *attributeName, const QString &defaultValue)
static int getAttribute (const QDomElement &element, const char *attributeName, int defaultValue)
static double getAttribute (const QDomElement &element, const char *attributeName, double defaultValue)

Protected Slots

void commandExecuted ()
void documentRestored ()

Protected Member Functions

KoView * createViewInstance (QWidget *parent, const char *name)
virtual bool completeLoading (KoStore *)
virtual bool saveChildren (KoStore *_store)
void initInterpreter ()
void destroyInterpreter ()

Protected Attributes

SavedDocParts m_savedDocParts

Properties

bool getShowRowHeader
bool getShowColHeader
double getIndentValue
bool getShowMessageError
bool dontCheckUpperWord
bool dontCheckTitleCase
int syntaxVersion
bool showVerticalScrollBar
bool showHorizontalScrollBar
bool showColumnHeader
bool showRowHeader
bool showStatusBar
bool showFormulaBar
bool showTabBar

Detailed Description

This class holds the data that makes up a spreadsheet.

Definition at line 104 of file kspread_doc.h.


Constructor & Destructor Documentation

KSpreadDoc::KSpreadDoc QWidget parentWidget = 0,
const char *  widgetName = 0,
QObject parent = 0,
const char *  name = 0,
bool  singleViewMode = false
 

Creates a new document.

Definition at line 181 of file kspread_doc.cc.

References documents(), and initInterpreter().

KSpreadDoc::~KSpreadDoc  ) 
 

Destroys the document.

Definition at line 263 of file kspread_doc.cc.

References destroyInterpreter().


Member Function Documentation

QValueList< KSpreadDoc * > KSpreadDoc::documents  )  [static]
 

Returns list of all documents.

Definition at line 290 of file kspread_doc.cc.

Referenced by KSpreadDoc().

virtual QCString KSpreadDoc::mimeType  )  const [inline, virtual]
 

Returns the MIME type of KSpread document.

Definition at line 147 of file kspread_doc.h.

void KSpreadDoc::addCommand KCommand *  command  ) 
 

Adds a command to the command history.

The command itself would not be executed.

Definition at line 1531 of file kspread_doc.cc.

void KSpreadDoc::undo  ) 
 

Undoes the last operation.

Definition at line 1542 of file kspread_doc.cc.

void KSpreadDoc::redo  ) 
 

Redoes the last undo.

Definition at line 1547 of file kspread_doc.cc.

void KSpreadDoc::undoLock  ) 
 

Locks the undo buffer.

Definition at line 1562 of file kspread_doc.cc.

void KSpreadDoc::undoUnlock  ) 
 

Releases lock of undo buffer.

Definition at line 1567 of file kspread_doc.cc.

bool KSpreadDoc::undoLocked  )  const
 

Returns true if undo buffer is locked.

Definition at line 1572 of file kspread_doc.cc.

KoCommandHistory * KSpreadDoc::commandHistory  ) 
 

Returns the command history for the document.

This is used in KSpreadView for updating the actions (i.e through signal KoCommandHistory::commandExecuted)

Definition at line 1577 of file kspread_doc.cc.

KoUnit::Unit KSpreadDoc::unit  )  const
 

Returns the unit used to display margins.

Definition at line 1413 of file kspread_doc.cc.

KoUnit::Unit KSpreadDoc::getUnit  )  const [inline]
 

Deprecated:
Use unit().

Definition at line 210 of file kspread_doc.h.

void KSpreadDoc::setUnit KoUnit::Unit  u  ) 
 

Sets the unit used to display margins.

Definition at line 1418 of file kspread_doc.cc.

QString KSpreadDoc::unitName  )  const
 

Returns the name of the unit used to display margins.

For example, if unit() returns KoUnit::U_MM, then this functions return "mm".

Definition at line 1423 of file kspread_doc.cc.

QString KSpreadDoc::getUnitName  )  const [inline]
 

Deprecated:
Use unitName().

Definition at line 227 of file kspread_doc.h.

int KSpreadDoc::syntaxVersion  )  const
 

Returns the syntax version of the currently opened file.

void KSpreadDoc::setShowVerticalScrollBar bool  b  ) 
 

If b is true, vertical scrollbar is visible, otherwise it will be hidden.

Definition at line 1235 of file kspread_doc.cc.

bool KSpreadDoc::showVerticalScrollBar  )  const
 

Returns true if vertical scroll bar is visible.

bool KSpreadDoc::getShowVerticalScrollBar  )  const [inline]
 

Deprecated:
Use showVerticalScrollBar().

Definition at line 248 of file kspread_doc.h.

void KSpreadDoc::setShowHorizontalScrollBar bool  b  ) 
 

If b is true, horizontal scrollbar is visible, otherwise it will be hidden.

Definition at line 1245 of file kspread_doc.cc.

bool KSpreadDoc::showHorizontalScrollBar  )  const
 

Returns true if horizontal scroll bar is visible.

bool KSpreadDoc::getShowHorizontalScrollBar  )  const [inline]
 

Deprecated:
Use showHorizontalScrollBar().

Definition at line 264 of file kspread_doc.h.

void KSpreadDoc::setShowColumnHeader bool  b  ) 
 

If b is true, column header is visible, otherwise it will be hidden.

Definition at line 1260 of file kspread_doc.cc.

bool KSpreadDoc::showColumnHeader  )  const
 

Returns true if column header is visible.

void KSpreadDoc::setShowColHeader bool  b  )  [inline]
 

Deprecated:
Use setShowColumnHeader().

Definition at line 280 of file kspread_doc.h.

bool KSpreadDoc::getShowColHeader  )  const [inline]
 

Deprecated:
Use showColumnHeader().

Definition at line 285 of file kspread_doc.h.

void KSpreadDoc::setShowRowHeader bool  b  ) 
 

If b is true, row header is visible, otherwise it will be hidden.

Definition at line 1270 of file kspread_doc.cc.

bool KSpreadDoc::showRowHeader  )  const
 

Returns true if row header is visible.

bool KSpreadDoc::getShowRowHeader  )  const [inline]
 

Deprecated:
Use showRowHeader().

Definition at line 301 of file kspread_doc.h.

void KSpreadDoc::setGridColor const QColor color  ) 
 

Sets the color of the grid.

Definition at line 1280 of file kspread_doc.cc.

QColor KSpreadDoc::gridColor  )  const
 

Returns the color of the grid.

Definition at line 1285 of file kspread_doc.cc.

void KSpreadDoc::setIndentValue double  val  ) 
 

Sets the indentation value.

Definition at line 1300 of file kspread_doc.cc.

double KSpreadDoc::indentValue  )  const
 

Returns the indentation value.

Definition at line 1295 of file kspread_doc.cc.

double KSpreadDoc::getIndentValue  )  const [inline]
 

Deprecated:
Use indentValue().

Definition at line 326 of file kspread_doc.h.

void KSpreadDoc::setShowStatusBar bool  b  ) 
 

If b is true, status bar is visible, otherwise it will be hidden.

Definition at line 1305 of file kspread_doc.cc.

bool KSpreadDoc::showStatusBar  )  const
 

Returns true if status bar is visible.

bool KSpreadDoc::getShowStatusBar  )  const [inline]
 

Deprecated:
Use showStatusBar().

Definition at line 342 of file kspread_doc.h.

void KSpreadDoc::setShowTabBar bool  b  ) 
 

If b is true, tab bar is visible, otherwise it will be hidden.

Definition at line 1315 of file kspread_doc.cc.

bool KSpreadDoc::showTabBar  )  const
 

Returns true if tab bar is visible.

bool KSpreadDoc::getShowTabBar  )  const [inline]
 

Deprecated:
Use showTabBar().

Definition at line 358 of file kspread_doc.h.

void KSpreadDoc::setShowFormulaBar bool  b  ) 
 

If b is true, formula bar is visible, otherwise it will be hidden.

Definition at line 1335 of file kspread_doc.cc.

bool KSpreadDoc::showFormulaBar  )  const
 

Returns true if formula bar is visible.

bool KSpreadDoc::getShowFormulaBar  )  const [inline]
 

Deprecated:
Use showFormulaBar().

Definition at line 374 of file kspread_doc.h.

void KSpreadDoc::setShowCommentIndicator bool  b  ) 
 

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

Definition at line 1325 of file kspread_doc.cc.

bool KSpreadDoc::showCommentIndicator  )  const
 

Returns true if comment indicator is visible.

Definition at line 1330 of file kspread_doc.cc.

bool KSpreadDoc::getShowCommentIndicator  )  const [inline]
 

Deprecated:
Use showCommentIndicator().

Definition at line 390 of file kspread_doc.h.

void KSpreadDoc::setShowMessageError bool  b  ) 
 

If b is true, an error message will pop up whenever error occurs.

Definition at line 1345 of file kspread_doc.cc.

bool KSpreadDoc::showMessageError  )  const
 

Returns true if error message should pop up whenever error occurs.

Definition at line 1350 of file kspread_doc.cc.

bool KSpreadDoc::getShowMessageError  )  const [inline]
 

Deprecated:
Use showMessageError().

Definition at line 405 of file kspread_doc.h.

KGlobalSettings::Completion KSpreadDoc::completionMode  )  const
 

completion mode

Definition at line 1255 of file kspread_doc.cc.

void KSpreadDoc::setTypeOfCalc MethodOfCalc  _calc  ) 
 

Method of calc.

Definition at line 1365 of file kspread_doc.cc.

void KSpreadDoc::setKSpellConfig KSpellConfig  _kspell  ) 
 

get custom kspell config

Definition at line 1375 of file kspread_doc.cc.

void KSpreadDoc::setZoomAndResolution int  zoom,
int  dpiX,
int  dpiY
[virtual]
 

Change the zoom factor to z (e.g.

150 for 150%) and/or change the resolution, given in DPI. This is done on startup and when printing. The same call combines both so that all the updating done behind the scenes is done only once, even if both zoom and DPI must be changed.

Definition at line 1463 of file kspread_doc.cc.

void KSpreadDoc::newZoomAndResolution bool  updateViews,
bool  forPrint
 

updates all properties after zoom changed

Definition at line 1468 of file kspread_doc.cc.

References sig_refreshView().

KSpreadInterpreter * KSpreadDoc::interpreter  )  const
 

Returns:
the KScript Interpreter used by this document.

Definition at line 459 of file kspread_doc.cc.

void KSpreadDoc::resetInterpreter  ) 
 

Kills the interpreter and creates a new one and reloads all scripts.

This is useful if they have been edited and the changes should take effect.

Definition at line 1448 of file kspread_doc.cc.

References destroyInterpreter(), initInterpreter(), and sig_updateView().

KSContext & KSpreadDoc::context  ) 
 

Returns:
a context that can be used for evaluating formulas. This function does remove any exception from the context.

Definition at line 479 of file kspread_doc.cc.

Referenced by initInterpreter().

bool KSpreadDoc::isLoading  )  const
 

Returns:
TRUE if the document is currently loading.

Definition at line 464 of file kspread_doc.cc.

void KSpreadDoc::paintCellRegions QPainter painter,
const QRect viewRect,
KSpreadView view,
QValueList< QRect cellRegions,
const KSpreadSheet *  sheet,
bool  drawCursor
 

Primary entry point for painting.

Use this function to paint groups of cells

Parameters:
painter the painter object to use. This should already be initialized with the world matrix. The begin and end calls should surround this function.
viewRect the document coordinates showing what is actually visible in the screen
view the view of the region -- may be NULL but no selection markers can be passed in that case.
cellRegions a list of rectangles indicating the cell ranges needing painted.
sheet the sheet which the cells in cellRegions come from
drawCursor whether or not to draw the selection rectangle and the choose marker

Definition at line 1691 of file kspread_doc.cc.

References KSpreadView::activeSheet(), KSpreadView::canvasWidget(), and KSpreadView::selectionInfo().

void KSpreadDoc::emitBeginOperation bool  waitCursor  ) 
 

Functions to begin a kspread 'operation'.

Calls to emitBeginOperation and emitEndOperation should surround each logical user operation. During the operation, the following should hold true:

  • No painting will be done to the screen
  • No cell calculation will be done (maybe there are exceptions, such as the goalseek operation needs to calculate values) During an operation, calls to KSpreadSheet::setRegionPaintDirty mark regions as needing repainted. Once the emitEndOperation function is called, those regions will be painted all at once, values being calculated as necessary. Calls to begin/endOperation may be nested. Calcualation/painting will be delayed until the outer begin/end pair has finished.

The waitCursor parameter specifies whether to put the hourglass up during the operation.

Definition at line 2316 of file kspread_doc.cc.

void KSpreadDoc::emitBeginOperation  )  [virtual]
 

default override of koDocument version.

Changes the cursor to an hourglass

Definition at line 2333 of file kspread_doc.cc.

void KSpreadDoc::emitEndOperation  )  [virtual]
 

Mark the end of an operation and triggers repaints/calculations.

See above comment to emitBeginOperation(bool).

Definition at line 2339 of file kspread_doc.cc.

References CellBinding::cellChanged().

void KSpreadDoc::emitEndOperation QRect const &  rect  ) 
 

s.a.

difference does only specified tasks and thats why it improves performance significantly. rect normally are the visible cells/the cells that need to be updated.

Definition at line 2375 of file kspread_doc.cc.

References CellBinding::cellChanged().

void KSpreadDoc::sig_updateView  )  [signal]
 

Emitted if all views have to be updated.

Referenced by resetInterpreter().

void KSpreadDoc::sig_refreshView  )  [signal]
 

Emitted if all interfaces have to be updated.

Referenced by newZoomAndResolution().

void KSpreadDoc::sig_refreshLocale  )  [signal]
 

Emitted if we update to locale system.

bool KSpreadDoc::completeLoading KoStore *   )  [protected, virtual]
 

Overloaded function of KoDocument.

Definition at line 1194 of file kspread_doc.cc.

bool KSpreadDoc::saveChildren KoStore *  _store  )  [protected, virtual]
 

Overloaded function of KoDocument.

Definition at line 502 of file kspread_doc.cc.

void KSpreadDoc::initInterpreter  )  [protected]
 

Initializes the KScript Interpreter.

Definition at line 1478 of file kspread_doc.cc.

References context().

Referenced by KSpreadDoc(), and resetInterpreter().

void KSpreadDoc::destroyInterpreter  )  [protected]
 

Destroys the interpreter.

Definition at line 1520 of file kspread_doc.cc.

Referenced by resetInterpreter(), and ~KSpreadDoc().


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:44 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003