lib
KoTextDocument Class Reference
List of all members.Detailed Description
Definition at line 45 of file KoTextDocument.h.
Public Types | |
enum | SelectionId { Standard = 0, InputMethodPreedit = 1, HighlightSelection = 2, Temp = 32000 } |
enum | DrawingFlags { DrawMisspelledLine = 1, DrawFormattingChars = 2, DrawSelections = 4, DontDrawNoteVariable = 8, TransparentBackground = 16 } |
Signals | |
void | paragraphDeleted (KoTextParag *parag) |
void | newCommand (KCommand *cmd) |
void | repaintChanged () |
Public Member Functions | |
virtual | ~KoTextDocument () |
void | setText (const QString &text, const QString &context) |
int | x () const |
int | y () const |
int | width () const |
int | height () const |
void | setWidth (int w) |
void | setY (int y) |
int | leftMargin () const |
void | setLeftMargin (int lm) |
int | rightMargin () const |
void | setRightMargin (int rm) |
KoTextParag * | firstParag () const |
KoTextParag * | lastParag () const |
void | setFirstParag (KoTextParag *p) |
void | setLastParag (KoTextParag *p) |
void | invalidate () |
void | setFormatter (KoTextFormatterBase *f) |
KoTextFormatterBase * | formatter () const |
QColor | selectionColor (int id) const |
bool | invertSelectionText (int id) const |
void | setSelectionColor (int id, const QColor &c) |
void | setInvertSelectionText (int id, bool b) |
bool | hasSelection (int id, bool visible=false) const |
bool | isSelectionSwapped (int id) |
void | setSelectionStart (int id, KoTextCursor *cursor) |
bool | setSelectionEnd (int id, KoTextCursor *cursor) |
void | selectAll (int id) |
bool | removeSelection (int id) |
void | selectionStart (int id, int ¶gId, int &index) |
KoTextCursor | selectionStartCursor (int id) |
KoTextCursor | selectionEndCursor (int id) |
void | selectionEnd (int id, int ¶gId, int &index) |
void | setFormat (int id, const KoTextFormat *f, int flags) |
KoTextParag * | selectionStart (int id) |
KoTextParag * | selectionEnd (int id) |
int | numSelections () const |
void | addSelection (int id) |
QString | selectedText (int id, bool withCustom=TRUE) const |
void | removeSelectedText (int id, KoTextCursor *cursor) |
KoTextParag * | paragAt (int i) const |
void | addCommand (KoTextDocCommand *cmd) |
KoTextCursor * | undo (KoTextCursor *c=0) |
KoTextCursor * | redo (KoTextCursor *c=0) |
KoTextDocCommandHistory * | commands () const |
KoTextFormatCollection * | formatCollection () const |
bool | find (const QString &expr, bool cs, bool wo, bool forward, int *parag, int *index, KoTextCursor *cursor) |
bool | inSelection (int selId, const QPoint &pos) const |
void | setUnderlineLinks (bool b) |
bool | underlineLinks () const |
void | setPaper (QBrush *brush) |
QBrush * | paper () const |
void | registerCustomItem (KoTextCustomItem *i, KoTextParag *p) |
void | unregisterCustomItem (KoTextCustomItem *i, KoTextParag *p) |
const QPtrList< KoTextCustomItem > & | allCustomItems () const |
void | setFlow (KoTextFlow *f) |
void | takeFlow () |
KoTextFlow * | flow () const |
bool | isPageBreakEnabled () const |
void | setPageBreakEnabled (bool b) |
void | setWithoutDoubleBuffer (bool b) |
bool | isWithoutDoubleBuffer () const |
void | setUseFormatCollection (bool b) |
bool | useFormatCollection () const |
void | setPlainText (const QString &text) |
QString | plainText () const |
int | alignment () const |
void | setAlignment (int a) |
int * | tabArray () const |
int | tabStopWidth () const |
void | setTabArray (int *a) |
void | setTabStops (int tw) |
void | setUndoDepth (int d) |
int | undoDepth () const |
int | length () const |
void | clear (bool createEmptyParag=FALSE) |
KoTextParag * | loadList (const QDomElement &list, KoOasisContext &context, KoTextParag *lastParagraph, KoStyleCollection *styleColl, KoTextParag *nextParagraph) |
KoTextParag * | loadOasisText (const QDomElement &bodyElem, KoOasisContext &context, KoTextParag *lastParagraph, KoStyleCollection *styleColl, KoTextParag *nextParagraph) |
QString | copySelection (KoXmlWriter &writer, KoSavingContext &context, int selectionId) |
void | saveOasisContent (KoXmlWriter &writer, KoSavingContext &context) const |
virtual KoTextParag * | createParag (KoTextDocument *d, KoTextParag *pr=0, KoTextParag *nx=0, bool updateIds=TRUE) |
void | setAddMargins (bool b) |
int | addMargins () const |
void | informParagraphDeleted (KoTextParag *parag) |
KoTextDocument (KoTextZoomHandler *zoomHandler, KoTextFormatCollection *fc, KoTextFormatter *formatter=0L, bool createInitialParag=true) | |
KoTextZoomHandler * | formattingZoomHandler () const |
KoTextZoomHandler * | paintingZoomHandler () const |
bool | visitSelection (int selectionId, KoParagVisitor *visitor, bool forward=true) |
bool | visitDocument (KoParagVisitor *visitor, bool forward=true) |
bool | visitFromTo (KoTextParag *firstParag, int firstIndex, KoTextParag *lastParag, int lastIndex, KoParagVisitor *visitor, bool forw=true) |
bool | isDestroying () const |
KoTextParag * | drawWYSIWYG (QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, KoTextZoomHandler *zoomHandler, bool onlyChanged=FALSE, bool drawCursor=FALSE, KoTextCursor *cursor=0, bool resetChanged=TRUE, uint drawingFlags=KoTextDocument::DrawSelections) |
void | drawParagWYSIWYG (QPainter *p, KoTextParag *parag, int cx, int cy, int cw, int ch, QPixmap *&doubleBuffer, const QColorGroup &cg, KoTextZoomHandler *zoomHandler, bool drawCursor, KoTextCursor *cursor, bool resetChanged=TRUE, uint drawingFlags=KoTextDocument::DrawSelections) |
bool | drawFormattingChars () const |
bool | drawingMissingSpellLine () const |
bool | dontDrawingNoteVariable () const |
virtual KoTextDocCommand * | deleteTextCommand (KoTextDocument *textdoc, int id, int index, const QMemArray< KoTextStringChar > &str, const CustomItemsMap &customItemsMap, const QValueList< KoParagLayout > &oldParagLayouts) |
void | emitNewCommand (KCommand *cmd) |
void | emitRepaintChanged () |
Protected Member Functions | |
void | drawWithoutDoubleBuffer (QPainter *p, const QRect &rect, const QColorGroup &cg, KoTextZoomHandler *zoomHandler, const QBrush *paper=0) |
virtual bool | loadOasisBodyTag (const QDomElement &, KoOasisContext &, KoTextParag *&, KoStyleCollection *, KoTextParag *) |
virtual bool | loadSpanTag (const QDomElement &, KoOasisContext &, KoTextParag *, uint, QString &, KoTextCustomItem *&) |
Friends | |
class | KoTextCursor |
class | KoTextParag |
Member Enumeration Documentation
|
Flags for drawWYSIWYG and drawParagWYSIWYG.
Definition at line 285 of file KoTextDocument.h. |
|
Identifiers for possible selections.
Definition at line 54 of file KoTextDocument.h. |
Constructor & Destructor Documentation
|
Construct a text document, i.e. a set of paragraphs
Definition at line 42 of file KoTextDocument.cpp. |
Member Function Documentation
|
Set by drawParagWYSIWYG, used by KoTextParag::drawParagStringInternal.
Definition at line 314 of file KoTextDocument.h. |
|
Set by drawParagWYSIWYG, used by KoTextParag::drawParagString.
Definition at line 309 of file KoTextDocument.h. |
|
Set by drawParagWYSIWYG, used by KoTextParag::drawParagStringInternal.
Definition at line 311 of file KoTextDocument.h. |
|
Draw a single paragraph (used by drawWYSIWYG and by KWTextFrameSet::drawCursor). Equivalent to KoTextDocument::draw, but modified for wysiwyg Definition at line 1254 of file KoTextDocument.cpp. |
|
The main drawing method. Equivalent to KoTextDocument::draw, but reimplemented for wysiwyg Definition at line 1069 of file KoTextDocument.cpp. |
|
Return the zoom handler associated with this document, used when formatting. Don't use for any other purpose, it might disappear. Definition at line 253 of file KoTextDocument.h. |
|
Used by ~KoTextParag to know if it should die quickly.
Definition at line 280 of file KoTextDocument.h. |
|
Called by loadOasisText. This allows to extend the loading mechanism for special tags no handled by kotext (images, textboxes, tables, etc.)
Definition at line 346 of file KoTextDocument.h. |
|
Called by KoTextParag::loadOasisSpan. This allows to extend the loading mechanism for special tags no handled by kotext (bookmarks, image, textbox, link, footnotes etc.) This method is here instead of in KoTextParag because it's easier to derive from KoTextDocument.
Definition at line 359 of file KoTextDocument.h. |
|
Emitted when a new command has been created and should be added to the main list of commands (usually in the KoDocument). KoTextObject connects (and forwards) that one. |
|
Return the zoom handler currently used for drawing. (This means, at a particular zoom level). Don't call this in a method that isn't called by drawWYSIWYG, it will be 0L ! (a different one than zoomHandler(), in case it disappears one day, to have different zoom levels in different views) Definition at line 262 of file KoTextDocument.h. |
|
Emitted when a paragraph is deleted (kotext addition).
|
|
Tell the world that we'd like some repainting to happen. KoTextObject connects (and forwards) that one. |
|
Visit all paragraphs of the document. Returns true, unless canceled. See KoParagVisitor. Definition at line 1020 of file KoTextDocument.cpp. |
|
Visit the document between those two point. Returns true, unless canceled. See KoParagVisitor. Definition at line 1025 of file KoTextDocument.cpp. |
|
Visit all the parts of a selection. Returns true, unless canceled. See KoParagVisitor. Definition at line 983 of file KoTextDocument.cpp. |
The documentation for this class was generated from the following files: