lib

#include <kformuladocument.h>

Public Member Functions

 Document (TQObject *parent=0, const char *name=0, const TQStringList &args=TQStringList())
virtual Container * createFormula (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 (const TQDomDocument &doc)
bool loadOasis (const TQDomDocument &doc)
bool loadDocumentPart (TQDomElement node)
TQDomDocument saveXML ()
TQDomElement saveDocumentPart (TQDomDocument &doc)
ContextStyle & getContextStyle (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)
KoCommandHistory * getHistory () const
const SymbolTable & getSymbolTable () const
void updateConfig ()
TQDomDocument createMathMLDomDocument ()
void setCreationStrategy (TQString strategy)
TQPtrListIterator< Container > formulas ()
SymbolType leftBracketChar ()
SymbolType rightBracketChar ()
DocumentWrapper * wrapper ()

Static Public Member Functions

static TQDomDocument createDomDocument ()

Protected Member Functions

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

Friends

class DocumentWrapper
class Container

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 68 of file kformuladocument.h.

Constructor & Destructor Documentation

◆ Document()

Document::Document ( TQObject * parent = 0,
const char * name = 0,
const TQStringList & args = TQStringList() )

Creates a formula document.

Definition at line 64 of file kformuladocument.cpp.

◆ ~Document()

Document::~Document ( )

Definition at line 74 of file kformuladocument.cpp.

Member Function Documentation

◆ activate()

void Document::activate ( Container * formula)

Sets a new formula.

Definition at line 258 of file kformuladocument.cpp.

◆ createDomDocument()

TQDomDocument Document::createDomDocument ( )
static

Return a kformula DomDocument.

Definition at line 196 of file kformuladocument.cpp.

◆ createFormula()

Container * Document::createFormula ( int pos = -1,
bool registerMe = true )
virtual

Factory method.

Definition at line 93 of file kformuladocument.cpp.

◆ createMathMLDomDocument()

TQDomDocument Document::createMathMLDomDocument ( )

Create a MathML Dom Document, deprecates KFO Dom Document for internal layout TODO: Shouldn't this go to KoDocument ?

Definition at line 206 of file kformuladocument.cpp.

◆ enableEvaluation()

virtual void Document::enableEvaluation ( bool )
inlinevirtual

Definition at line 106 of file kformuladocument.h.

◆ evaluateFormulas()

virtual void Document::evaluateFormulas ( )
inlinevirtual

Triggers the evaluation of the whole document.

This obviously required evaluation support.

Definition at line 105 of file kformuladocument.h.

◆ formulaAt()

Container * Document::formulaAt ( uint pos)
protected
Returns
the formula at position pos.

Definition at line 113 of file kformuladocument.cpp.

◆ formulaCount()

int Document::formulaCount ( )
protected
Returns
the number of formulas in this document.

Definition at line 119 of file kformuladocument.cpp.

◆ formulaPos()

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 107 of file kformuladocument.cpp.

◆ formulas()

TQPtrListIterator< Container > Document::formulas ( )
Returns
an iterator for the collection of formulas.

Definition at line 101 of file kformuladocument.cpp.

◆ getContextStyle()

ContextStyle & Document::getContextStyle ( bool edit = false)
Returns
the documents context style.

Definition at line 293 of file kformuladocument.cpp.

◆ getHistory()

KoCommandHistory * Document::getHistory ( ) const
Returns
our undo stack so the formulas can use it.

Definition at line 338 of file kformuladocument.cpp.

◆ getSymbolTable()

const SymbolTable & Document::getSymbolTable ( ) const
Returns
the documents symbol table

Definition at line 288 of file kformuladocument.cpp.

◆ getXResolution()

double Document::getXResolution ( ) const

Definition at line 279 of file kformuladocument.cpp.

◆ getYResolution()

double Document::getYResolution ( ) const

Definition at line 283 of file kformuladocument.cpp.

◆ leftBracketChar()

SymbolType Document::leftBracketChar ( )

Definition at line 321 of file kformuladocument.cpp.

◆ loadDocumentPart()

bool Document::loadDocumentPart ( TQDomElement node)

Load the document settings.

Definition at line 171 of file kformuladocument.cpp.

◆ loadOasis()

bool Document::loadOasis ( const TQDomDocument & doc)

Load a OASIS content.xml DomDocument.

Since
1.4

Definition at line 163 of file kformuladocument.cpp.

◆ loadXML()

bool Document::loadXML ( const TQDomDocument & doc)

Load a kformula DomDocument with all its formulas.

This must only be called on a virgin document.

Definition at line 125 of file kformuladocument.cpp.

◆ newZoomAndResolution()

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

Definition at line 304 of file kformuladocument.cpp.

◆ registerFormula()

void Document::registerFormula ( Container * f,
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 237 of file kformuladocument.cpp.

◆ rightBracketChar()

SymbolType Document::rightBracketChar ( )

Definition at line 326 of file kformuladocument.cpp.

◆ saveDocumentPart()

TQDomElement Document::saveDocumentPart ( TQDomDocument & doc)

Save the document settings.

Definition at line 189 of file kformuladocument.cpp.

◆ saveXML()

TQDomDocument Document::saveXML ( )

Save the document with all its formulae.

Definition at line 176 of file kformuladocument.cpp.

◆ setCreationStrategy()

void Document::setCreationStrategy ( TQString strategy)

Set formula creation strategy: old KFormula or MathML/ODF.

This tells which tags are valid during formula constructions

Parameters
strategy– "Ordinary" for old Kformula, "Oasis" for MathML/ODF

Definition at line 225 of file kformuladocument.cpp.

◆ setEnabled()

void Document::setEnabled ( bool enabled)

Enables our action according to enabled.

Definition at line 332 of file kformuladocument.cpp.

◆ setZoomAndResolution() [1/2]

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 311 of file kformuladocument.cpp.

◆ setZoomAndResolution() [2/2]

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 KoTextZoomHandler.

Definition at line 299 of file kformuladocument.cpp.

◆ sortFormulaList()

void Document::sortFormulaList ( )
protected

Sorts the list of formulas according to their screen positions.

Definition at line 264 of file kformuladocument.cpp.

◆ unregisterFormula()

void Document::unregisterFormula ( Container * f)
virtual

Removes a formula from this document.

The formula will stay alive and might be registered again.

Definition at line 250 of file kformuladocument.cpp.

◆ updateConfig()

void Document::updateConfig ( )

Gets called when the configuration changed.

(Maybe we can find a better solution.)

Definition at line 354 of file kformuladocument.cpp.

◆ wrapper()

DocumentWrapper * Document::wrapper ( )
inline

Definition at line 214 of file kformuladocument.h.

◆ Container

friend class Container
friend

Definition at line 73 of file kformuladocument.h.

◆ DocumentWrapper

friend class DocumentWrapper
friend

Definition at line 72 of file kformuladocument.h.


The documentation for this class was generated from the following files: