kspread

KSpread::Doc Class Reference

#include <kspread_doc.h>

Inherits KoDocument, and KoZoomHandler.

List of all members.


Detailed Description

This class holds the data that makes up a spreadsheet.

Definition at line 97 of file kspread_doc.h.


Public Types

enum  {
  STYLE_PAGE = 20, STYLE_COLUMN_USER, STYLE_COLUMN_AUTO, STYLE_ROW_USER,
  STYLE_ROW_AUTO, STYLE_CELL_USER, STYLE_CELL_AUTO, STYLE_PAGEMASTER,
  STYLE_NUMERIC_NUMBER
}
enum  SaveFlag { SaveAll, SaveSelected }

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< Damage * > &damages)

Public Member Functions

 Doc (QWidget *parentWidget=0, const char *widgetName=0, QObject *parent=0, const char *name=0, bool singleViewMode=false)
 ~Doc ()
virtual QCString mimeType () const
KLocale * locale () const
Mapmap () const
StyleManager * styleManager () const
ValueParserparser () const
ValueFormatterformatter () const
ValueConverterconverter () const
ValueCalccalc () const
void addCommand (KCommand *command)
void addCommand (UndoAction *command)
void undo ()
void redo ()
void undoLock ()
void undoUnlock ()
bool undoLocked () const
KoCommandHistory * commandHistory ()
QString unitName () 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 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 ()
bool dontCheckUpperWord () const
void setDontCheckUpperWord (bool _b)
bool dontCheckTitleCase () const
void setDontCheckTitleCase (bool _b)
QColor pageBorderColor () const
void changePageBorderColor (const QColor &_color)
virtual bool completeSaving (KoStore *_store)
virtual QDomDocument saveXML ()
bool savingWholeDocument ()
bool saveOasisHelper (KoStore *store, KoXmlWriter *manifestWriter, SaveFlag saveFlag, QString *plainText=0, KoPicture *picture=0)
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)
void enableUndo (bool _b)
void enableRedo (bool _b)
bool isLoading () const
void doNotPaint (bool status)
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, Sheet *sheet, bool drawCursor=true)
bool docData (QString const &xmlTag, QDomElement &data)
void deregisterPlugin (Plugin *plugin)
void registerPlugin (Plugin *plugin)
void paintCellRegions (QPainter &painter, const QRect &viewRect, View *view, QValueList< QRect > cellRegions, const Sheet *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 insertObject (EmbeddedObject *obj)
QPtrList< EmbeddedObject > & embeddedObjects ()
KoPictureCollection * pictureCollection ()
void initConfig ()
void saveConfig ()
void refreshLocale ()
void emitBeginOperation (bool waitCursor)
virtual void emitBeginOperation ()
virtual void emitEndOperation ()
void emitEndOperation (const Region &region)
bool delayCalculation () const
void updateBorderButton ()
void insertSheet (Sheet *sheet)
void takeSheet (Sheet *sheet)
void addIgnoreWordAll (const QString &word)
void clearIgnoreWordAll ()
void addIgnoreWordAllList (const QStringList &_lst)
QStringList spellListIgnoreAll () const
void setDisplaySheet (Sheet *_Sheet)
Sheet * displaySheet () const
KSPLoadingInfoloadingInfo () const
void deleteLoadingInfo ()
void increaseNumOperation ()
void decreaseNumOperation ()
void addDamage (Damage *damage)
void loadConfigFromFile ()
bool configLoadFromFile () const
void repaint (const QRect &)
void repaint (EmbeddedObject *)
void repaint (const KoRect &)
virtual void addShell (KoMainWindow *shell)
int undoRedoLimit () const
void setUndoRedoLimit (int _val)

Static Public Member Functions

static QValueList< Doc * > 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 ()
virtual void openTemplate (const QString &file)
virtual void initEmpty ()

Protected Member Functions

KoView * createViewInstance (QWidget *parent, const char *name)
void makeUsedPixmapList ()
void insertPixmapKey (KoPictureKey key)
virtual bool completeLoading (KoStore *)
virtual bool saveChildren (KoStore *_store)

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
int undoRedoLimit

Member Enumeration Documentation

anonymous enum

Possible values for the "type" argument of the KoGenStyle constructor.

Enumerator:
STYLE_COLUMN_USER  commmon column styles
STYLE_COLUMN_AUTO  auto column styles
STYLE_ROW_USER  common row styles
STYLE_ROW_AUTO  auto row styles

Definition at line 133 of file kspread_doc.h.


Constructor & Destructor Documentation

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

Creates a new document.

Definition at line 172 of file kspread_doc.cc.

Doc::~Doc (  ) 

Destroys the document.

Definition at line 248 of file kspread_doc.cc.


Member Function Documentation

QValueList< Doc * > Doc::documents (  )  [static]

Returns list of all documents.

Definition at line 274 of file kspread_doc.cc.

virtual QCString KSpread::Doc::mimeType (  )  const [inline, virtual]

Returns the MIME type of KSpread document.

Definition at line 151 of file kspread_doc.h.

void Doc::addCommand ( KCommand *  command  ) 

Adds a command to the command history.

The command itself would not be executed.

Definition at line 1560 of file kspread_doc.cc.

void Doc::undo (  ) 

Undoes the last operation.

Definition at line 1575 of file kspread_doc.cc.

void Doc::redo (  ) 

Redoes the last undo.

Definition at line 1582 of file kspread_doc.cc.

void Doc::undoLock (  ) 

Locks the undo buffer.

Definition at line 1599 of file kspread_doc.cc.

void Doc::undoUnlock (  ) 

Releases lock of undo buffer.

Definition at line 1604 of file kspread_doc.cc.

bool Doc::undoLocked (  )  const

Returns true if undo buffer is locked.

Definition at line 1609 of file kspread_doc.cc.

KoCommandHistory * Doc::commandHistory (  ) 

Returns the command history for the document.

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

Definition at line 1614 of file kspread_doc.cc.

QString Doc::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 1520 of file kspread_doc.cc.

int KSpread::Doc::syntaxVersion (  )  const

Returns the syntax version of the currently opened file.

void Doc::setShowVerticalScrollBar ( bool  b  ) 

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

Definition at line 1332 of file kspread_doc.cc.

bool KSpread::Doc::showVerticalScrollBar (  )  const

Returns true if vertical scroll bar is visible.

bool KSpread::Doc::getShowVerticalScrollBar (  )  const [inline]

Deprecated:
Use showVerticalScrollBar().

Definition at line 232 of file kspread_doc.h.

void Doc::setShowHorizontalScrollBar ( bool  b  ) 

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

Definition at line 1342 of file kspread_doc.cc.

bool KSpread::Doc::showHorizontalScrollBar (  )  const

Returns true if horizontal scroll bar is visible.

bool KSpread::Doc::getShowHorizontalScrollBar (  )  const [inline]

Deprecated:
Use showHorizontalScrollBar().

Definition at line 248 of file kspread_doc.h.

void Doc::setShowColumnHeader ( bool  b  ) 

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

Definition at line 1357 of file kspread_doc.cc.

bool KSpread::Doc::showColumnHeader (  )  const

Returns true if column header is visible.

void KSpread::Doc::setShowColHeader ( bool  b  )  [inline]

Deprecated:
Use setShowColumnHeader().

Definition at line 264 of file kspread_doc.h.

bool KSpread::Doc::getShowColHeader (  )  const [inline]

Deprecated:
Use showColumnHeader().

Definition at line 269 of file kspread_doc.h.

void Doc::setShowRowHeader ( bool  b  ) 

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

Definition at line 1367 of file kspread_doc.cc.

bool KSpread::Doc::showRowHeader (  )  const

Returns true if row header is visible.

bool KSpread::Doc::getShowRowHeader (  )  const [inline]

Deprecated:
Use showRowHeader().

Definition at line 285 of file kspread_doc.h.

void Doc::setGridColor ( const QColor &  color  ) 

Sets the color of the grid.

Definition at line 1377 of file kspread_doc.cc.

QColor Doc::gridColor (  )  const

Returns the color of the grid.

Definition at line 1382 of file kspread_doc.cc.

void Doc::setIndentValue ( double  val  ) 

Sets the indentation value.

Definition at line 1397 of file kspread_doc.cc.

double Doc::indentValue (  )  const

Returns the indentation value.

Definition at line 1392 of file kspread_doc.cc.

double KSpread::Doc::getIndentValue (  )  const [inline]

Deprecated:
Use indentValue().

Definition at line 310 of file kspread_doc.h.

void Doc::setShowStatusBar ( bool  b  ) 

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

Definition at line 1402 of file kspread_doc.cc.

bool KSpread::Doc::showStatusBar (  )  const

Returns true if status bar is visible.

bool KSpread::Doc::getShowStatusBar (  )  const [inline]

Deprecated:
Use showStatusBar().

Definition at line 326 of file kspread_doc.h.

void Doc::setShowTabBar ( bool  b  ) 

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

Definition at line 1412 of file kspread_doc.cc.

bool KSpread::Doc::showTabBar (  )  const

Returns true if tab bar is visible.

bool KSpread::Doc::getShowTabBar (  )  const [inline]

Deprecated:
Use showTabBar().

Definition at line 342 of file kspread_doc.h.

void Doc::setShowFormulaBar ( bool  b  ) 

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

Definition at line 1422 of file kspread_doc.cc.

bool KSpread::Doc::showFormulaBar (  )  const

Returns true if formula bar is visible.

bool KSpread::Doc::getShowFormulaBar (  )  const [inline]

Deprecated:
Use showFormulaBar().

Definition at line 358 of file kspread_doc.h.

void Doc::setShowMessageError ( bool  b  ) 

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

Definition at line 1432 of file kspread_doc.cc.

bool Doc::showMessageError (  )  const

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

Definition at line 1437 of file kspread_doc.cc.

bool KSpread::Doc::getShowMessageError (  )  const [inline]

Deprecated:
Use showMessageError().

Definition at line 373 of file kspread_doc.h.

KGlobalSettings::Completion Doc::completionMode (  )  const

completion mode

Definition at line 1352 of file kspread_doc.cc.

void Doc::setTypeOfCalc ( MethodOfCalc  _calc  ) 

Method of calc.

Definition at line 1452 of file kspread_doc.cc.

void Doc::setKSpellConfig ( KSpellConfig  _kspell  ) 

get custom kspell config

Definition at line 1462 of file kspread_doc.cc.

bool Doc::saveOasisHelper ( KoStore *  store,
KoXmlWriter *  manifestWriter,
SaveFlag  saveFlag,
QString *  plainText = 0,
KoPicture *  picture = 0 
)

Save the whole document, or just the selection, into OASIS format When saving the selection, also return the data as plain text and/or plain picture, which are used to insert into the KMultipleDrag drag object.

Parameters:
store the KoStore to save into
manifestWriter pointer to a koxmlwriter to add entries to the manifest
saveFlag either the whole document, or only the selected text/objects.
plainText must be set when saveFlag==SaveSelected. It returns the plain text format of the saved data, when available.
picture must be set when saveFlag==SaveSelected. It returns the selected picture, when exactly one picture was selected.

Definition at line 619 of file kspread_doc.cc.

void Doc::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 1545 of file kspread_doc.cc.

void Doc::newZoomAndResolution ( bool  updateViews,
bool  forPrint 
)

updates all properties after zoom changed

Definition at line 1550 of file kspread_doc.cc.

bool Doc::isLoading (  )  const

Returns:
true if the document is currently loading.

Definition at line 477 of file kspread_doc.cc.

void Doc::doNotPaint ( bool  status  ) 

Prevents painting.

Useful when importing data.

Parameters:
status switch the painting on/off

Definition at line 482 of file kspread_doc.cc.

void Doc::paintCellRegions ( QPainter &  painter,
const QRect &  viewRect,
View view,
QValueList< QRect >  cellRegions,
const Sheet *  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 1728 of file kspread_doc.cc.

void Doc::insertObject ( EmbeddedObject obj  ) 

Inserts an object to the object list.

Definition at line 2357 of file kspread_doc.cc.

QPtrList< EmbeddedObject > & Doc::embeddedObjects (  ) 

Returns:
the list of all embedded objects (charts, pictures and koffice objects) Use insertObject to add an object to the list.

Definition at line 2372 of file kspread_doc.cc.

void Doc::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 Sheet::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 2186 of file kspread_doc.cc.

void Doc::emitBeginOperation ( void   )  [virtual]

default override of koDocument version.

Changes the cursor to an hourglass

Definition at line 2211 of file kspread_doc.cc.

void Doc::emitEndOperation (  )  [virtual]

Mark the end of an operation and triggers a repaint of any cells or regions of cells which have been marked as 'dirty' via calls to Sheet::setRegionPaintDirty See above comment to emitBeginOperation(bool).

Definition at line 2217 of file kspread_doc.cc.

void Doc::emitEndOperation ( const Region region  ) 

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.

TODO: This is essentially redundant now since emitEndOperation behaviour has been fixed to only update cells that were already in the paint dirty list.

Definition at line 2240 of file kspread_doc.cc.

KSPLoadingInfo * Doc::loadingInfo (  )  const

Returns:
the loading info

Definition at line 2305 of file kspread_doc.cc.

void Doc::deleteLoadingInfo (  ) 

deletes the loading info after loading is complete

Definition at line 2310 of file kspread_doc.cc.

void KSpread::Doc::sig_updateView (  )  [signal]

Emitted if all views have to be updated.

void KSpread::Doc::sig_refreshView (  )  [signal]

Emitted if all interfaces have to be updated.

void KSpread::Doc::sig_refreshLocale (  )  [signal]

Emitted if we update to locale system.

bool Doc::completeLoading ( KoStore *   )  [protected, virtual]

Overloaded function of KoDocument.

Definition at line 1291 of file kspread_doc.cc.

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

Overloaded function of KoDocument.

Definition at line 515 of file kspread_doc.cc.


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