lib Library API Documentation

Document Class Reference

A document that can contain a lot of formulas (container). More...

#include <kformuladocument.h>

Inheritance diagram for Document:

QObject List of all members.

Public Member Functions

 Document (QObject *parent=0, const char *name=0, const QStringList &args=QStringList())
virtual ContainercreateFormula (int pos=-1, bool registerMe=true)
virtual void registerFormula (Container *, int pos=-1)
virtual void unregisterFormula (Container *)
virtual void evaluateFormulas ()
virtual void enableEvaluation (bool)
bool loadXML (QDomDocument doc)
bool loadDocumentPart (QDomElement node)
QDomDocument saveXML ()
QDomElement saveDocumentPart (QDomDocument doc)
ContextStylegetContextStyle (bool edit=false)
void setZoomAndResolution (int zoom, int dpiX, int dpiY)
void newZoomAndResolution (bool updateViews, bool forPrint)
void setZoomAndResolution (int zoom, double zoomX, double zoomY, bool updateViews=false, bool forPrint=false)
double getXResolution () const
double getYResolution () const
void activate (Container *formula)
void setEnabled (bool enabled)
KoCommandHistorygetHistory () const
const SymbolTablegetSymbolTable () const
void updateConfig ()
QPtrListIterator< Containerformulas ()
SymbolType leftBracketChar ()
SymbolType rightBracketChar ()
DocumentWrapperwrapper ()

Static Public Member Functions

QDomDocument createDomDocument ()

Protected Member Functions

int formulaPos (Container *formula)
ContainerformulaAt (uint pos)
int formulaCount ()
void sortFormulaList ()

Detailed Description

A document that can contain a lot of formulas (container).

The relationship between the document and its formulas is an open one. The document sure owns the formulas and when it vanishes the formulas will be destroyed, too. But the user will most often work with those formulas directly and not bother to ask the document. It's legal to directly create or destroy a Container object.

Definition at line 66 of file kformuladocument.h.


Constructor & Destructor Documentation

Document::Document QObject parent = 0,
const char *  name = 0,
const QStringList args = QStringList()
 

Creates a formula document.

Definition at line 69 of file kformuladocument.cc.

References Document().

Referenced by Document().


Member Function Documentation

Container * Document::createFormula int  pos = -1,
bool  registerMe = true
[virtual]
 

Factory method.

Definition at line 98 of file kformuladocument.cc.

References createFormula(), and Container::initialize().

Referenced by createFormula().

void Document::registerFormula Container ,
int  pos = -1
[virtual]
 

Registers a new formula to be part of this document.

Each formula must be part of exactly one document.

Definition at line 197 of file kformuladocument.cc.

References registerFormula().

Referenced by registerFormula(), and Container::registerFormula().

void Document::unregisterFormula Container  )  [virtual]
 

Removes a formula from this document.

The formula will stay alive and might be registered again.

Definition at line 210 of file kformuladocument.cc.

References unregisterFormula().

Referenced by unregisterFormula().

virtual void Document::evaluateFormulas  )  [inline, virtual]
 

Triggers the evaluation of the whole document.

This obviously required evaluation support.

Definition at line 102 of file kformuladocument.h.

bool Document::loadXML QDomDocument  doc  ) 
 

Load a kformula DomDocument with all its formulas.

This must only be called on a virgin document.

Definition at line 130 of file kformuladocument.cc.

References Container::load(), loadDocumentPart(), and loadXML().

Referenced by loadXML().

bool Document::loadDocumentPart QDomElement  node  ) 
 

Load the document settings.

Definition at line 166 of file kformuladocument.cc.

References loadDocumentPart().

Referenced by loadDocumentPart(), and loadXML().

QDomDocument Document::saveXML  ) 
 

Save the document with all its formulae.

Definition at line 171 of file kformuladocument.cc.

References createDomDocument(), and saveDocumentPart().

QDomElement Document::saveDocumentPart QDomDocument  doc  ) 
 

Save the document settings.

Definition at line 184 of file kformuladocument.cc.

References saveDocumentPart().

Referenced by saveDocumentPart(), and saveXML().

ContextStyle & Document::getContextStyle bool  edit = false  ) 
 

Returns:
the documents context style.

Definition at line 253 of file kformuladocument.cc.

References getContextStyle(), and ContextStyle::setEdit().

Referenced by Container::baseline(), Container::baseSizeChanged(), Container::boundingRect(), Container::coveredRect(), Container::draw(), Container::drawImage(), getContextStyle(), Container::loadMathML(), Container::moveTo(), and setZoomAndResolution().

void Document::setZoomAndResolution int  zoom,
int  dpiX,
int  dpiY
 

Change the zoom factor to z (e.g.

150 for 150%) and/or change the resolution, given in DPI. Uses the KoZoomHandler.

Definition at line 259 of file kformuladocument.cc.

References ContextStyle::setZoomAndResolution(), and setZoomAndResolution().

Referenced by setZoomAndResolution().

void Document::setZoomAndResolution int  zoom,
double  zoomX,
double  zoomY,
bool  updateViews = false,
bool  forPrint = false
 

Sets the zoom by hand.

This is to be used in paintContent.

Definition at line 271 of file kformuladocument.cc.

References getContextStyle(), ContextStyle::setZoomAndResolution(), and setZoomAndResolution().

void Document::activate Container formula  ) 
 

Sets a new formula.

Definition at line 218 of file kformuladocument.cc.

References activate().

Referenced by activate(), and Container::setActiveCursor().

void Document::setEnabled bool  enabled  ) 
 

Enables our action according to enabled.

Definition at line 292 of file kformuladocument.cc.

References DocumentWrapper::getAddAbsAction(), DocumentWrapper::getAddBracketAction(), DocumentWrapper::getAddCBracketAction(), DocumentWrapper::getAddFractionAction(), DocumentWrapper::getAddGenericLowerAction(), DocumentWrapper::getAddGenericUpperAction(), DocumentWrapper::getAddIntegralAction(), DocumentWrapper::getAddLowerLeftAction(), DocumentWrapper::getAddLowerRightAction(), DocumentWrapper::getAddMatrixAction(), DocumentWrapper::getAddMediumSpaceAction(), DocumentWrapper::getAddNegThinSpaceAction(), DocumentWrapper::getAddOneByTwoMatrixAction(), DocumentWrapper::getAddOverlineAction(), DocumentWrapper::getAddProductAction(), DocumentWrapper::getAddQuadSpaceAction(), DocumentWrapper::getAddRootAction(), DocumentWrapper::getAddSBracketAction(), DocumentWrapper::getAddSumAction(), DocumentWrapper::getAddThickSpaceAction(), DocumentWrapper::getAddThinSpaceAction(), DocumentWrapper::getAddUnderlineAction(), DocumentWrapper::getAddUpperLeftAction(), DocumentWrapper::getAddUpperRightAction(), DocumentWrapper::getAppendColumnAction(), DocumentWrapper::getAppendRowAction(), DocumentWrapper::getInsertColumnAction(), DocumentWrapper::getInsertRowAction(), DocumentWrapper::getInsertSymbolAction(), DocumentWrapper::getMakeGreekAction(), DocumentWrapper::getRemoveColumnAction(), DocumentWrapper::getRemoveEnclosingAction(), DocumentWrapper::getRemoveRowAction(), and setEnabled().

Referenced by setEnabled().

KoCommandHistory * Document::getHistory  )  const
 

Returns:
our undo stack so the formulas can use it.

Definition at line 351 of file kformuladocument.cc.

References DocumentWrapper::getHistory().

const SymbolTable & Document::getSymbolTable  )  const
 

Returns:
the documents symbol table

Definition at line 248 of file kformuladocument.cc.

References ContextStyle::symbolTable().

Referenced by SequenceElement::buildCommand().

void Document::updateConfig  ) 
 

Gets called when the configuration changed.

(Maybe we can find a better solution.)

Definition at line 367 of file kformuladocument.cc.

References DocumentWrapper::updateConfig().

QDomDocument Document::createDomDocument  )  [static]
 

Return a kformula DomDocument.

Definition at line 191 of file kformuladocument.cc.

Referenced by Container::copy(), and saveXML().

QPtrListIterator< Container > Document::formulas  ) 
 

Returns:
an iterator for the collection of formulas.

Definition at line 106 of file kformuladocument.cc.

int Document::formulaPos Container formula  )  [protected]
 

Returns:
the internal position of this formula or -1 if it doesn't belong to us.

Definition at line 112 of file kformuladocument.cc.

References formulaPos().

Referenced by formulaPos().

Container * Document::formulaAt uint  pos  )  [protected]
 

Returns:
the formula at position pos.

Definition at line 118 of file kformuladocument.cc.

References formulaAt().

Referenced by formulaAt().

int Document::formulaCount  )  [protected]
 

Returns:
the number of formulas in this document.

Definition at line 124 of file kformuladocument.cc.

void Document::sortFormulaList  )  [protected]
 

Sorts the list of formulas according to their screen positions.

Definition at line 224 of file kformuladocument.cc.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003