kspread

KSpread::Doc Class Reference

#include <kspread_doc.h>

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

 STYLE_PAGE = 20
 STYLE_COLUMN
 STYLE_ROW
 STYLE_CELL_USER
 STYLE_CELL_AUTO
 STYLE_PAGEMASTER
 STYLE_NUMERIC_NUMBER
 SaveAll
 SaveSelected
enum  {
  STYLE_PAGE = 20, STYLE_COLUMN, STYLE_ROW, 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
StyleManagerstyleManager () 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)
SheetdisplaySheet () 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 []

Classes

class  SavedDocParts

Member Enumeration Documentation

anonymous enum

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

Definition at line 133 of file kspread_doc.h.


Constructor & Destructor Documentation

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

Creates a new document.

KSpread::Doc::~Doc (  ) 

Destroys the document.


Member Function Documentation

void KSpread::Doc::addCommand ( KCommand *  command  ) 

Adds a command to the command history.

The command itself would not be executed.

KoCommandHistory* KSpread::Doc::commandHistory (  ) 

Returns the command history for the document.

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

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

Overloaded function of KoDocument.

KGlobalSettings::Completion KSpread::Doc::completionMode (  )  const

completion mode

void KSpread::Doc::deleteLoadingInfo (  ) 

deletes the loading info after loading is complete

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

Returns list of all documents.

void KSpread::Doc::doNotPaint ( bool  status  ) 

Prevents painting.

Useful when importing data.

Parameters:
status switch the painting on/off

QPtrList<EmbeddedObject>& KSpread::Doc::embeddedObjects (  ) 

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

virtual void KSpread::Doc::emitBeginOperation (  )  [virtual]

default override of koDocument version.

Changes the cursor to an hourglass

void KSpread::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.

void KSpread::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.

virtual void KSpread::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).

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

Deprecated:
Use indentValue().

Definition at line 308 of file kspread_doc.h.

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

Deprecated:
Use showColumnHeader().

Definition at line 267 of file kspread_doc.h.

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

Deprecated:
Use showFormulaBar().

Definition at line 356 of file kspread_doc.h.

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

Deprecated:
Use showHorizontalScrollBar().

Definition at line 246 of file kspread_doc.h.

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

Deprecated:
Use showMessageError().

Definition at line 371 of file kspread_doc.h.

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

Deprecated:
Use showRowHeader().

Definition at line 283 of file kspread_doc.h.

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

Deprecated:
Use showStatusBar().

Definition at line 324 of file kspread_doc.h.

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

Deprecated:
Use showTabBar().

Definition at line 340 of file kspread_doc.h.

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

Deprecated:
Use showVerticalScrollBar().

Definition at line 230 of file kspread_doc.h.

QColor KSpread::Doc::gridColor (  )  const

Returns the color of the grid.

double KSpread::Doc::indentValue (  )  const

Returns the indentation value.

void KSpread::Doc::insertObject ( EmbeddedObject obj  ) 

Inserts an object to the object list.

bool KSpread::Doc::isLoading (  )  const

Returns:
true if the document is currently loading.

KSPLoadingInfo* KSpread::Doc::loadingInfo (  )  const

Returns:
the loading info

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

Returns the MIME type of KSpread document.

Definition at line 149 of file kspread_doc.h.

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

updates all properties after zoom changed

void KSpread::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

void KSpread::Doc::redo (  ) 

Redoes the last undo.

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

Overloaded function of KoDocument.

bool KSpread::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.

void KSpread::Doc::setGridColor ( const QColor &  color  ) 

Sets the color of the grid.

void KSpread::Doc::setIndentValue ( double  val  ) 

Sets the indentation value.

void KSpread::Doc::setKSpellConfig ( KSpellConfig  _kspell  ) 

get custom kspell config

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

Deprecated:
Use setShowColumnHeader().

Definition at line 262 of file kspread_doc.h.

void KSpread::Doc::setShowColumnHeader ( bool  b  ) 

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

void KSpread::Doc::setShowFormulaBar ( bool  b  ) 

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

void KSpread::Doc::setShowHorizontalScrollBar ( bool  b  ) 

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

void KSpread::Doc::setShowMessageError ( bool  b  ) 

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

void KSpread::Doc::setShowRowHeader ( bool  b  ) 

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

void KSpread::Doc::setShowStatusBar ( bool  b  ) 

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

void KSpread::Doc::setShowTabBar ( bool  b  ) 

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

void KSpread::Doc::setShowVerticalScrollBar ( bool  b  ) 

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

void KSpread::Doc::setTypeOfCalc ( MethodOfCalc  _calc  ) 

Method of calc.

virtual void KSpread::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.

bool KSpread::Doc::showColumnHeader (  )  const

Returns true if column header is visible.

bool KSpread::Doc::showFormulaBar (  )  const

Returns true if formula bar is visible.

bool KSpread::Doc::showHorizontalScrollBar (  )  const

Returns true if horizontal scroll bar is visible.

bool KSpread::Doc::showMessageError (  )  const

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

bool KSpread::Doc::showRowHeader (  )  const

Returns true if row header is visible.

bool KSpread::Doc::showStatusBar (  )  const

Returns true if status bar is visible.

bool KSpread::Doc::showTabBar (  )  const

Returns true if tab bar is visible.

bool KSpread::Doc::showVerticalScrollBar (  )  const

Returns true if vertical scroll bar is visible.

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

Emitted if we update to locale system.

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

Emitted if all interfaces have to be updated.

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

Emitted if all views have to be updated.

int KSpread::Doc::syntaxVersion (  )  const

Returns the syntax version of the currently opened file.

void KSpread::Doc::undo (  ) 

Undoes the last operation.

void KSpread::Doc::undoLock (  ) 

Locks the undo buffer.

bool KSpread::Doc::undoLocked (  )  const

Returns true if undo buffer is locked.

void KSpread::Doc::undoUnlock (  ) 

Releases lock of undo buffer.

QString KSpread::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".


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