#include <KoTextObject.h>
Classes | |
| struct | UndoRedoInfo |
Public Types | |
| enum | InsertFlag { DefaultInsertFlags = 0 , CheckNewLine = 1 , OverwriteMode = 2 , DoNotRemoveSelected = 4 , DoNotRepaint = 8 } |
| enum | KeyboardAction { ActionBackspace , ActionDelete , ActionReturn , ActionKill } |
| enum | ParagModifyType { AddChar = 0 , RemoveChar = 1 , ChangeFormat = 2 } |
Public Slots | |
| bool | formatMore (int count=10, bool emitAfterFormatting=true) |
| void | emitRepaintChanged () |
Signals | |
| void | availableHeightNeeded () |
| void | afterFormatting (int bottom, KoTextParag *m_lastFormatted, bool *abort) |
| void | chapterParagraphFormatted (KoTextParag *parag) |
| void | formattingFirstParag () |
| void | newCommand (KCommand *cmd) |
| void | repaintChanged (KoTextObject *) |
| void | hideCursor () |
| void | showCursor () |
| void | setCursor (KoTextCursor *cursor) |
| void | updateUI (bool updateFormat, bool force=false) |
| void | showCurrentFormat () |
| void | ensureCursorVisible () |
| void | selectionChanged (bool hasSelection) |
| void | showFormatObject (const KoTextFormat &) |
| void | paragraphCreated (KoTextParag *parag) |
| void | paragraphModified (KoTextParag *parag, int, int pos, int length) |
| void | paragraphDeleted (KoTextParag *parag) |
Public Member Functions | |
| KoTextObject (KoTextZoomHandler *zh, const TQFont &defaultFont, const TQString &defaultLanguage, bool defaultHyphenation, KoParagStyle *defaultStyle, int tabStopWidth=-1, TQObject *parent=0, const char *name=0) | |
| KoTextObject (KoTextDocument *textdoc, KoParagStyle *defaultStyle, TQObject *parent=0, const char *name=0) | |
| void | setNeedSpellCheck (bool b) |
| bool | needSpellCheck () const |
| void | setProtectContent (bool b) |
| bool | protectContent () const |
| KoTextDocument * | textDocument () const |
| void | setAvailableHeight (int avail) |
| int | availableHeight () const |
| void | undo () |
| void | redo () |
| void | clearUndoRedoInfo () |
| bool | hasSelection () const |
| TQString | selectedText (KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) const |
| bool | selectionHasCustomItems (KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) const |
| void | insert (KoTextCursor *cursor, KoTextFormat *currentFormat, const TQString &text, const TQString &commandName, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard, int insertFlags=DefaultInsertFlags, CustomItemsMap customItemsMap=CustomItemsMap()) |
| void | removeSelectedText (KoTextCursor *cursor, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard, const TQString &cmdName=TQString(), bool createUndoRedo=true) |
| KCommand * | replaceSelectionCommand (KoTextCursor *cursor, const TQString &replacement, const TQString &cmdName, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard, int insertFlags=DefaultInsertFlags, CustomItemsMap customItemsMap=CustomItemsMap()) |
| KCommand * | removeSelectedTextCommand (KoTextCursor *cursor, KoTextDocument::SelectionId selectionId, bool repaint=true) |
| KCommand * | insertParagraphCommand (KoTextCursor *cursor) |
| void | pasteText (KoTextCursor *cursor, const TQString &text, KoTextFormat *currentFormat, bool removeSelected) |
| void | selectAll (bool select) |
| void | highlightPortion (KoTextParag *parag, int index, int length, bool repaint) |
| void | removeHighlight (bool repaint) |
| KCommand * | setFormatCommand (const KoTextFormat *format, int flags, bool zoomFont=false) |
| KCommand * | setFormatCommand (KoTextCursor *cursor, KoTextFormat **currentFormat, const KoTextFormat *format, int flags, bool zoomFont=false, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| void | doKeyboardAction (KoTextCursor *cursor, KoTextFormat *¤tFormat, KeyboardAction action) |
| KCommand * | setCounterCommand (KoTextCursor *cursor, const KoParagCounter &counter, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setAlignCommand (KoTextCursor *cursor, int align, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setLineSpacingCommand (KoTextCursor *cursor, double spacing, KoParagLayout::SpacingType _type, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setBordersCommand (KoTextCursor *cursor, const KoBorder &leftBorder, const KoBorder &rightBorder, const KoBorder &topBorder, const KoBorder &bottomBorder, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setJoinBordersCommand (KoTextCursor *cursor, bool join, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setMarginCommand (KoTextCursor *cursor, TQStyleSheetItem::Margin m, double margin, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setTabListCommand (KoTextCursor *cursor, const KoTabulatorList &tabList, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setBackgroundColorCommand (KoTextCursor *cursor, const TQColor &color, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| KCommand * | setParagDirectionCommand (KoTextCursor *cursor, TQChar::Direction d, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| void | applyStyle (KoTextCursor *cursor, const KoParagStyle *style, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard, int paragLayoutFlags=KoParagLayout::All, int formatFlags=KoTextFormat::Format, bool createUndoRedo=true, bool interactive=true) |
| KCommand * | applyStyleCommand (KoTextCursor *cursor, const KoParagStyle *style, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard, int paragLayoutFlags=KoParagLayout::All, int formatFlags=KoTextFormat::Format, bool createUndoRedo=true, bool interactive=true) |
| void | applyStyleChange (KoStyleChangeDefMap changed) |
| void | setFormat (KoTextCursor *cursor, KoTextFormat **currentFormat, KoTextFormat *format, int flags, bool zoomFont=false) |
| virtual KoTextFormat * | currentFormat () const |
| virtual const KoParagLayout * | currentParagLayoutFormat () const |
| virtual bool | rtl () const |
| virtual KCommand * | setParagLayoutFormatCommand (KoParagLayout *newLayout, int flags, int marginIndex=-1) |
| KCommand * | setParagLayoutCommand (KoTextCursor *cursor, const KoParagLayout ¶gLayout, KoTextDocument::SelectionId selectionId, int paragLayoutFlags, int marginIndex, bool createUndoRedo) |
| virtual void | setFormat (KoTextFormat *newFormat, int flags, bool zoomFont=false) |
| int | docFontSize (KoTextFormat *format) const |
| int | zoomedFontSize (int docFontSize) const |
| void | setViewArea (TQWidget *w, int maxY) |
| void | ensureFormatted (KoTextParag *parag, bool emitAfterFormatting=true) |
| void | setLastFormattedParag (KoTextParag *parag) |
| void | emitHideCursor () |
| void | emitShowCursor () |
| void | emitEnsureCursorVisible () |
| void | emitUpdateUI (bool updateFormat, bool force=false) |
| void | typingStarted () |
| void | typingDone () |
| void | abortFormatting () |
| void | selectionChangedNotify (bool enableActions=true) |
| void | emitNewCommand (KCommand *cmd) |
| virtual KCommand * | setChangeCaseOfTextCommand (KoChangeCaseDia::TypeOfCase _type) |
| KCommand * | changeCaseOfText (KoTextCursor *cursor, KoChangeCaseDia::TypeOfCase _type) |
| TQString | textChangedCase (const TQString &_text, KoChangeCaseDia::TypeOfCase _type) |
| KCommand * | changeCaseOfTextParag (int cursorPosStart, int cursorPosEnd, KoChangeCaseDia::TypeOfCase _type, KoTextCursor *cursor, KoTextParag *parag) |
| void | loadOasisContent (const TQDomElement &bodyElem, KoOasisContext &context, KoStyleCollection *styleColl) |
| void | saveOasisContent (KoXmlWriter &writer, KoSavingContext &context) const |
| KoTextCursor | pasteOasisText (const TQDomElement &bodyElem, KoOasisContext &context, KoTextCursor &cursor, KoStyleCollection *styleColl) |
| void | printRTDebug (int) |
| bool | statistics (TQProgressDialog *progress, ulong &charsWithSpace, ulong &charsWithoutSpace, ulong &words, ulong &sentences, ulong &syllables, ulong &lines, bool selected) |
| int | numberOfparagraphLineSelected (KoTextParag *parag) |
| KoVariable * | variableAtPoint (const TQPoint &iPoint) const |
| KoVariable * | variableAtPosition (KoTextParag *parag, int index) const |
| void | storeParagUndoRedoInfo (KoTextCursor *cursor, KoTextDocument::SelectionId selectionId=KoTextDocument::Standard) |
| void | copyCharFormatting (KoTextParag *parag, int position, int index, bool moveCustomItems) |
| void | readFormats (KoTextCursor &c1, KoTextCursor &c2, bool copyParagLayouts=false, bool moveCustomItems=false) |
| void | newPlaceHolderCommand (const TQString &name) |
| void | checkUndoRedoInfo (KoTextCursor *cursor, UndoRedoInfo::Type t) |
| UndoRedoInfo & | undoRedoInfoStruct () |
| void | setVisible (bool vis) |
| bool | isVisible () const |
Public Member Functions inherited from KoTextFormatInterface | |
| KoTextDocCommand * | deleteTextCommand (KoTextDocument *textdoc, int id, int index, const TQMemArray< KoTextStringChar > &str, const CustomItemsMap &customItemsMap, const TQValueList< KoParagLayout > &oldParagLayouts) |
| void | setParagLayoutFormat (KoParagLayout *newLayout, int flags, int marginIndex=-1) |
| void | setFormat (KoTextFormat *newFormat, int flags, bool zoomFont=false) |
| KCommand * | setBoldCommand (bool on) |
| KCommand * | setItalicCommand (bool on) |
| KCommand * | setUnderlineCommand (bool on) |
| KCommand * | setDoubleUnderlineCommand (bool on) |
| KCommand * | setUnderlineColorCommand (const TQColor &color) |
| KCommand * | setStrikeOutCommand (bool on) |
| KCommand * | setTextColorCommand (const TQColor &color) |
| KCommand * | setPointSizeCommand (int s) |
| KCommand * | setFamilyCommand (const TQString &font) |
| KCommand * | setTextSubScriptCommand (bool on) |
| KCommand * | setTextSuperScriptCommand (bool on) |
| KCommand * | setDefaultFormatCommand () |
| KCommand * | setTextBackgroundColorCommand (const TQColor &) |
| KCommand * | setAlignCommand (int align) |
| KCommand * | setMarginCommand (TQStyleSheetItem::Margin m, double margin) |
| KCommand * | setTabListCommand (const KoTabulatorList &tabList) |
| KCommand * | setBackgroundColorCommand (const TQColor &color) |
| KCommand * | setCounterCommand (const KoParagCounter &counter) |
| KCommand * | setLanguageCommand (const TQString &) |
| KCommand * | setShadowTextCommand (double shadowDistanceX, double shadowDistanceY, const TQColor &shadowColor) |
| KCommand * | setHyphenationCommand (bool _b) |
| KCommand * | setFontAttributeCommand (KoTextFormat::AttributeStyle _att) |
| KCommand * | setRelativeTextSizeCommand (double _size) |
| KCommand * | setOffsetFromBaseLineCommand (int _offset) |
| KCommand * | setWordByWordCommand (bool _b) |
| TQColor | textColor () const |
| TQFont | textFont () const |
| TQString | textFontFamily () const |
| TQString | language () const |
| TQColor | textBackgroundColor () const |
| TQColor | textUnderlineColor () const |
| KoTextFormat::UnderlineType | underlineType () const |
| KoTextFormat::StrikeOutType | strikeOutType () const |
| KoTextFormat::UnderlineStyle | underlineStyle () const |
| KoTextFormat::StrikeOutStyle | strikeOutStyle () const |
| bool | textUnderline () const |
| bool | textDoubleUnderline () const |
| bool | textBold () const |
| bool | textStrikeOut () const |
| bool | textItalic () const |
| bool | textSubScript () const |
| bool | textSuperScript () const |
| double | shadowDistanceX () const |
| double | shadowDistanceY () const |
| TQColor | shadowColor () const |
| KoTextFormat::AttributeStyle | fontAttribute () const |
| double | relativeTextSize () const |
| int | offsetFromBaseLine () const |
| bool | wordByWord () const |
| bool | hyphenation () const |
Static Public Member Functions | |
| static const char * | acceptSelectionMimeType () |
| static TQCString | providesOasis (TQMimeSource *mime) |
| static TQChar | customItemChar () |
Detailed Description
The KoTextObject is the high-level object that contains a KoTextDocument (the list of paragraphs), and takes care of the operations on it (particularly the undo/redo commands).
Editing the text isn't done by KoTextObject but by KoTextView (document/view design).
Definition at line 181 of file KoTextObject.h.
Member Enumeration Documentation
◆ InsertFlag
| Enumerator | |
|---|---|
| OverwriteMode | < if true, the text to be inserted is checked for '\n' (as a paragraph delimiter) |
| DoNotRemoveSelected | whether to remove selected text before |
| DoNotRepaint | usually we repaint in insert(), this allows to turn it off |
Definition at line 249 of file KoTextObject.h.
◆ KeyboardAction
| enum KoTextObject::KeyboardAction |
Definition at line 321 of file KoTextObject.h.
◆ ParagModifyType
| enum KoTextObject::ParagModifyType |
Definition at line 475 of file KoTextObject.h.
Constructor & Destructor Documentation
◆ KoTextObject() [1/2]
| KoTextObject::KoTextObject | ( | KoTextZoomHandler * | zh, |
| const TQFont & | defaultFont, | ||
| const TQString & | defaultLanguage, | ||
| bool | defaultHyphenation, | ||
| KoParagStyle * | defaultStyle, | ||
| int | tabStopWidth = -1, |
||
| TQObject * | parent = 0, |
||
| const char * | name = 0 |
||
| ) |
Constructor.
This constructor creates the contained KoTextDocument automatically.
- Parameters
-
zh the zoom handler (to be passed to the KoTextDocument ctor) defaultFont the font to use by default (see KoTextFormatCollection) defaultLanguage the language to use by default (see KoTextFormatCollection) defaultHyphenation the default setting for hyphenation (see KoTextFormatCollection) defaultStyle the style to use by default (initial pararaph, and when deleting a used style) tabStopWidth the global value for the tabstop width parent parent widget for this object name name for this object
Definition at line 60 of file KoTextObject.cpp.
◆ KoTextObject() [2/2]
| KoTextObject::KoTextObject | ( | KoTextDocument * | textdoc, |
| KoParagStyle * | defaultStyle, | ||
| TQObject * | parent = 0, |
||
| const char * | name = 0 |
||
| ) |
Alternative constructor.
This constructor allows to use a derived class from KoTextDocument.
- Parameters
-
textdoc the text document to use in this text object. Ownership is transferred to the text object. defaultStyle the style to use by default (initial pararaph, and when deleting a used style) parent parent widget for this object name name for this object
Definition at line 72 of file KoTextObject.cpp.
◆ ~KoTextObject()
|
virtual |
Definition at line 117 of file KoTextObject.cpp.
Member Function Documentation
◆ abortFormatting()
| void KoTextObject::abortFormatting | ( | ) |
Abort the current formatMore() loop, or prevent the next one from starting.
Use with care. This is e.g. for KWFootNoteVariable, so that it can do a frame layout before formatting the main text again. It is important to make sure that formatMore will be called again ;)
Definition at line 1882 of file KoTextObject.cpp.
◆ acceptSelectionMimeType()
|
static |
Definition at line 2425 of file KoTextObject.cpp.
◆ afterFormatting
|
signal |
Emitted by formatMore() after formatting a bunch of paragraphs.
KWord uses this signal to check for things like 'I need to create a new page'
◆ applyStyle()
| void KoTextObject::applyStyle | ( | KoTextCursor * | cursor, |
| const KoParagStyle * | style, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard, |
||
| int | paragLayoutFlags = KoParagLayout::All, |
||
| int | formatFlags = KoTextFormat::Format, |
||
| bool | createUndoRedo = true, |
||
| bool | interactive = true |
||
| ) |
Apply a KoParagStyle to a selection.
- Parameters
-
cursor the current cursor; used if there is no selection. Can be 0L if there is one. style the KoParagStyle to apply selectionId the id of the selection, usually Standard or Temp paragLayoutFlags which settings from the paragraph layout to apply formatFlags which settings from the text format to apply createUndoRedo if true, an undo/redo command will be created and emitted interactive if true, the text will be reformatted/repainted to show the new style
Definition at line 816 of file KoTextObject.cpp.
◆ applyStyleChange()
| void KoTextObject::applyStyleChange | ( | KoStyleChangeDefMap | changed | ) |
Update the paragraph that use the given style, after this style was changed.
The flags tell which changes should be applied.
- Parameters
-
changed map of styles that have changed
Definition at line 939 of file KoTextObject.cpp.
◆ applyStyleCommand()
| KCommand * KoTextObject::applyStyleCommand | ( | KoTextCursor * | cursor, |
| const KoParagStyle * | style, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard, |
||
| int | paragLayoutFlags = KoParagLayout::All, |
||
| int | formatFlags = KoTextFormat::Format, |
||
| bool | createUndoRedo = true, |
||
| bool | interactive = true |
||
| ) |
Helper for applyStyle.
Can also be called directly, so that the command isn't emitted, e.g. to put it into a macro-command.
- Returns
- the command for 'apply style', or 0L if createUndoRedo is false.
Applying a style is three distinct operations : 1 - Changing the paragraph settings (setParagLayout) 2 - Changing the character formatting for each char in the paragraph (setFormat(indices)) 3 - Changing the character formatting for the whole paragraph (setFormat()) [just in case] -> We need a macro command to hold the 3 commands
Definition at line 830 of file KoTextObject.cpp.
◆ availableHeight()
| int KoTextObject::availableHeight | ( | ) | const |
Definition at line 126 of file KoTextObject.cpp.
◆ availableHeightNeeded
|
signal |
Emitted by availableHeight() when the available height hasn't been calculated yet or is invalid.
Connect to a slot that calls setAvailableHeight()
◆ changeCaseOfText()
| KCommand * KoTextObject::changeCaseOfText | ( | KoTextCursor * | cursor, |
| KoChangeCaseDia::TypeOfCase | _type | ||
| ) |
Definition at line 1991 of file KoTextObject.cpp.
◆ changeCaseOfTextParag()
| KCommand * KoTextObject::changeCaseOfTextParag | ( | int | cursorPosStart, |
| int | cursorPosEnd, | ||
| KoChangeCaseDia::TypeOfCase | _type, | ||
| KoTextCursor * | cursor, | ||
| KoTextParag * | parag | ||
| ) |
Definition at line 1907 of file KoTextObject.cpp.
◆ chapterParagraphFormatted
|
signal |
Emitted by formatMore() when formatting a "Head 1" paragraph.
Used for the Section variable
◆ checkUndoRedoInfo()
| void KoTextObject::checkUndoRedoInfo | ( | KoTextCursor * | cursor, |
| UndoRedoInfo::Type | t | ||
| ) |
Definition at line 208 of file KoTextObject.cpp.
◆ clearUndoRedoInfo()
| void KoTextObject::clearUndoRedoInfo | ( | ) |
Terminate our current undo/redo info, to start with a new one.
Definition at line 202 of file KoTextObject.cpp.
◆ copyCharFormatting()
| void KoTextObject::copyCharFormatting | ( | KoTextParag * | parag, |
| int | position, | ||
| int | index, | ||
| bool | moveCustomItems | ||
| ) |
Copies a formatted char, <parag, position>, into undoRedoInfo.text, at position index.
Definition at line 329 of file KoTextObject.cpp.
◆ currentFormat()
|
virtual |
Support for treating the whole textobject as a single object Use this format for displaying the properties (font/color/...) of the object.
Interface for accessing the current format
Implements KoTextFormatInterface.
Definition at line 2086 of file KoTextObject.cpp.
◆ currentParagLayoutFormat()
|
virtual |
Use this format for displaying the properties (Align/counter/...) of the object.
Implements KoTextFormatInterface.
Definition at line 2094 of file KoTextObject.cpp.
◆ customItemChar()
|
inlinestatic |
Definition at line 418 of file KoTextObject.h.
◆ docFontSize()
| int KoTextObject::docFontSize | ( | KoTextFormat * | format | ) | const |
Return the user-visible font size for this format (i.e.
LU to pt conversion)
Definition at line 155 of file KoTextObject.cpp.
◆ doKeyboardAction()
| void KoTextObject::doKeyboardAction | ( | KoTextCursor * | cursor, |
| KoTextFormat *& | currentFormat, | ||
| KeyboardAction | action | ||
| ) |
Executes keyboard action action.
This is normally called by a key event handler.
Definition at line 427 of file KoTextObject.cpp.
◆ emitEnsureCursorVisible()
|
inline |
Definition at line 423 of file KoTextObject.h.
◆ emitHideCursor()
|
inline |
Definition at line 421 of file KoTextObject.h.
◆ emitNewCommand()
| void KoTextObject::emitNewCommand | ( | KCommand * | cmd | ) |
Definition at line 1088 of file KoTextObject.cpp.
◆ emitRepaintChanged
|
inlineslot |
Definition at line 532 of file KoTextObject.h.
◆ emitShowCursor()
|
inline |
Definition at line 422 of file KoTextObject.h.
◆ emitUpdateUI()
|
inline |
Definition at line 424 of file KoTextObject.h.
◆ ensureCursorVisible
|
signal |
The views should make sure the cursor is visible.
◆ ensureFormatted()
| void KoTextObject::ensureFormatted | ( | KoTextParag * | parag, |
| bool | emitAfterFormatting = true |
||
| ) |
Make sure that parag is formatted.
Definition at line 1714 of file KoTextObject.cpp.
◆ formatMore
|
slot |
Definition at line 1738 of file KoTextObject.cpp.
◆ formattingFirstParag
|
signal |
Emitted by formatMore() when formatting the first paragraph.
◆ hasSelection()
|
inline |
return true if some text is selected
Definition at line 241 of file KoTextObject.h.
◆ highlightPortion()
| void KoTextObject::highlightPortion | ( | KoTextParag * | parag, |
| int | index, | ||
| int | length, | ||
| bool | repaint | ||
| ) |
Highlighting support (for search/replace, spellchecking etc.).
Don't forget to ensure the paragraph is visible.
Definition at line 1649 of file KoTextObject.cpp.
◆ insert()
| void KoTextObject::insert | ( | KoTextCursor * | cursor, |
| KoTextFormat * | currentFormat, | ||
| const TQString & | text, | ||
| const TQString & | commandName, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard, |
||
| int | insertFlags = DefaultInsertFlags, |
||
| CustomItemsMap | customItemsMap = CustomItemsMap() |
||
| ) |
The main "insert" method, including undo/redo creation/update.
- Parameters
-
cursor the insertion point currentFormat the current textformat, to apply to the inserted text text the text to be inserted insertFlags flags, see InsertFlag commandName the name to give the undo/redo command if we haven't created it already customItemsMap the map of custom items to include in the new text selectionId which selection to use (See KoTextDocument::SelectionId)
Definition at line 598 of file KoTextObject.cpp.
◆ insertParagraphCommand()
| KCommand * KoTextObject::insertParagraphCommand | ( | KoTextCursor * | cursor | ) |
Definition at line 1642 of file KoTextObject.cpp.
◆ isVisible()
|
inline |
Definition at line 586 of file KoTextObject.h.
◆ loadOasisContent()
| void KoTextObject::loadOasisContent | ( | const TQDomElement & | bodyElem, |
| KoOasisContext & | context, | ||
| KoStyleCollection * | styleColl | ||
| ) |
Definition at line 2105 of file KoTextObject.cpp.
◆ needSpellCheck()
|
inline |
Definition at line 224 of file KoTextObject.h.
◆ newCommand
|
signal |
Emitted when a new command has been created and should be added to the main list of commands (usually in the KoDocument).
Make sure to connect to that one, otherwise the commands will just leak away...
◆ newPlaceHolderCommand()
| void KoTextObject::newPlaceHolderCommand | ( | const TQString & | name | ) |
Creates a place holder for a command that will be completed later on.
This is used for the insert and delete text commands, which are build delayed (see the UndoRedoInfo structure), in order to have an entry in the undo/redo history asap.
Definition at line 393 of file KoTextObject.cpp.
◆ numberOfparagraphLineSelected()
| int KoTextObject::numberOfparagraphLineSelected | ( | KoTextParag * | parag | ) |
Definition at line 2394 of file KoTextObject.cpp.
◆ pasteOasisText()
| KoTextCursor KoTextObject::pasteOasisText | ( | const TQDomElement & | bodyElem, |
| KoOasisContext & | context, | ||
| KoTextCursor & | cursor, | ||
| KoStyleCollection * | styleColl | ||
| ) |
Definition at line 2124 of file KoTextObject.cpp.
◆ pasteText()
| void KoTextObject::pasteText | ( | KoTextCursor * | cursor, |
| const TQString & | text, | ||
| KoTextFormat * | currentFormat, | ||
| bool | removeSelected | ||
| ) |
Paste plain text at the given cursor.
- Parameters
-
cursor location to paste text text the text to paste currentFormat format to apply to the pasted text removeSelected truewhen pasting with the keyboard, butfalsewhen dropping text.
- Todo:
Can currentFormat be NULL?
Besides saying when removeSelected is
true, perhaps explain what it does (presumably, removes the selection and replaces it with the pasted text).
Definition at line 745 of file KoTextObject.cpp.
◆ printRTDebug()
| void KoTextObject::printRTDebug | ( | int | info | ) |
Definition at line 2445 of file KoTextObject.cpp.
◆ protectContent()
|
inline |
Definition at line 226 of file KoTextObject.h.
◆ providesOasis()
|
static |
Check if the mimesource mime provides one of the OASIS mimetypes, and if so, return it.
Otherwise return an empty string.
Definition at line 2430 of file KoTextObject.cpp.
◆ readFormats()
| void KoTextObject::readFormats | ( | KoTextCursor & | c1, |
| KoTextCursor & | c2, | ||
| bool | copyParagLayouts = false, |
||
| bool | moveCustomItems = false |
||
| ) |
Definition at line 349 of file KoTextObject.cpp.
◆ redo()
| void KoTextObject::redo | ( | ) |
Definition at line 237 of file KoTextObject.cpp.
◆ removeHighlight()
| void KoTextObject::removeHighlight | ( | bool | repaint | ) |
Definition at line 1673 of file KoTextObject.cpp.
◆ removeSelectedText()
| void KoTextObject::removeSelectedText | ( | KoTextCursor * | cursor, |
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard, |
||
| const TQString & | cmdName = TQString(), |
||
| bool | createUndoRedo = true |
||
| ) |
Remove the text currently selected, including undo/redo creation/update.
- Parameters
-
cursor the caret position selectionId which selection to remove (usually Standard) cmdName the name to give the undo/redo command, if we haven't created it already createUndoRedo create an undo history entry for this removal
Definition at line 1518 of file KoTextObject.cpp.
◆ removeSelectedTextCommand()
| KCommand * KoTextObject::removeSelectedTextCommand | ( | KoTextCursor * | cursor, |
| KoTextDocument::SelectionId | selectionId, | ||
| bool | repaint = true |
||
| ) |
Definition at line 1551 of file KoTextObject.cpp.
◆ repaintChanged
|
signal |
Tell the world that we'd like some repainting to happen.
◆ replaceSelectionCommand()
| KCommand * KoTextObject::replaceSelectionCommand | ( | KoTextCursor * | cursor, |
| const TQString & | replacement, | ||
| const TQString & | cmdName, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard, |
||
| int | insertFlags = DefaultInsertFlags, |
||
| CustomItemsMap | customItemsMap = CustomItemsMap() |
||
| ) |
Definition at line 1587 of file KoTextObject.cpp.
◆ rtl()
|
virtual |
Implements KoTextFormatInterface.
Definition at line 2100 of file KoTextObject.cpp.
◆ saveOasisContent()
| void KoTextObject::saveOasisContent | ( | KoXmlWriter & | writer, |
| KoSavingContext & | context | ||
| ) | const |
Definition at line 2206 of file KoTextObject.cpp.
◆ selectAll()
| void KoTextObject::selectAll | ( | bool | select | ) |
Definition at line 1685 of file KoTextObject.cpp.
◆ selectedText()
|
inline |
returns the selected text [without formatting] if hasSelection()
Definition at line 243 of file KoTextObject.h.
◆ selectionChanged
|
signal |
Tell the views that the selection changed (for cut/copy...)
◆ selectionChangedNotify()
| void KoTextObject::selectionChangedNotify | ( | bool | enableActions = true | ) |
Definition at line 1694 of file KoTextObject.cpp.
◆ selectionHasCustomItems()
| bool KoTextObject::selectionHasCustomItems | ( | KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard | ) | const |
returns true if the given selection has any custom item in it
Definition at line 186 of file KoTextObject.cpp.
◆ setAlignCommand()
| KCommand * KoTextObject::setAlignCommand | ( | KoTextCursor * | cursor, |
| int | align, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1145 of file KoTextObject.cpp.
◆ setAvailableHeight()
|
inline |
Definition at line 232 of file KoTextObject.h.
◆ setBackgroundColorCommand()
| KCommand * KoTextObject::setBackgroundColorCommand | ( | KoTextCursor * | cursor, |
| const TQColor & | color, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1226 of file KoTextObject.cpp.
◆ setBordersCommand()
| KCommand * KoTextObject::setBordersCommand | ( | KoTextCursor * | cursor, |
| const KoBorder & | leftBorder, | ||
| const KoBorder & | rightBorder, | ||
| const KoBorder & | topBorder, | ||
| const KoBorder & | bottomBorder, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1317 of file KoTextObject.cpp.
◆ setChangeCaseOfTextCommand()
|
virtual |
Implements KoTextFormatInterface.
Definition at line 2241 of file KoTextObject.cpp.
◆ setCounterCommand()
| KCommand * KoTextObject::setCounterCommand | ( | KoTextCursor * | cursor, |
| const KoParagCounter & | counter, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1094 of file KoTextObject.cpp.
◆ setCursor
|
signal |
Special hack for undo/redo - used by KoTextView.
◆ setFormat() [1/2]
| void KoTextObject::setFormat | ( | KoTextCursor * | cursor, |
| KoTextFormat ** | currentFormat, | ||
| KoTextFormat * | format, | ||
| int | flags, | ||
| bool | zoomFont = false |
||
| ) |
Set format changes on selection or current cursor.
Creates a command if the format was applied to a selection
Definition at line 1079 of file KoTextObject.cpp.
◆ setFormat() [2/2]
|
virtual |
Support for changing the format in the whole textobject.
Definition at line 2224 of file KoTextObject.cpp.
◆ setFormatCommand() [1/2]
|
virtual |
Implementation of setFormatCommand from KoTextFormatInterface - apply change to the whole document.
Implements KoTextFormatInterface.
Definition at line 986 of file KoTextObject.cpp.
◆ setFormatCommand() [2/2]
| KCommand * KoTextObject::setFormatCommand | ( | KoTextCursor * | cursor, |
| KoTextFormat ** | currentFormat, | ||
| const KoTextFormat * | format, | ||
| int | flags, | ||
| bool | zoomFont = false, |
||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Set format changes on selection or current cursor.
Returns a command if the format was applied to a selection
Definition at line 994 of file KoTextObject.cpp.
◆ setJoinBordersCommand()
| KCommand * KoTextObject::setJoinBordersCommand | ( | KoTextCursor * | cursor, |
| bool | join, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1380 of file KoTextObject.cpp.
◆ setLastFormattedParag()
| void KoTextObject::setLastFormattedParag | ( | KoTextParag * | parag | ) |
Definition at line 1706 of file KoTextObject.cpp.
◆ setLineSpacingCommand()
| KCommand * KoTextObject::setLineSpacingCommand | ( | KoTextCursor * | cursor, |
| double | spacing, | ||
| KoParagLayout::SpacingType | _type, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1270 of file KoTextObject.cpp.
◆ setMarginCommand()
| KCommand * KoTextObject::setMarginCommand | ( | KoTextCursor * | cursor, |
| TQStyleSheetItem::Margin | m, | ||
| double | margin, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1181 of file KoTextObject.cpp.
◆ setNeedSpellCheck()
| void KoTextObject::setNeedSpellCheck | ( | bool | b | ) |
Definition at line 2253 of file KoTextObject.cpp.
◆ setParagDirectionCommand()
| KCommand * KoTextObject::setParagDirectionCommand | ( | KoTextCursor * | cursor, |
| TQChar::Direction | d, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1473 of file KoTextObject.cpp.
◆ setParagLayoutCommand()
| KCommand * KoTextObject::setParagLayoutCommand | ( | KoTextCursor * | cursor, |
| const KoParagLayout & | paragLayout, | ||
| KoTextDocument::SelectionId | selectionId, | ||
| int | paragLayoutFlags, | ||
| int | marginIndex, | ||
| bool | createUndoRedo | ||
| ) |
Definition at line 771 of file KoTextObject.cpp.
◆ setParagLayoutFormatCommand()
|
virtual |
Support for changing the format in the whole textobject.
Implements KoTextFormatInterface.
Definition at line 2211 of file KoTextObject.cpp.
◆ setProtectContent()
|
inline |
Definition at line 225 of file KoTextObject.h.
◆ setTabListCommand()
| KCommand * KoTextObject::setTabListCommand | ( | KoTextCursor * | cursor, |
| const KoTabulatorList & | tabList, | ||
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
Definition at line 1435 of file KoTextObject.cpp.
◆ setViewArea()
| void KoTextObject::setViewArea | ( | TQWidget * | w, |
| int | maxY | ||
| ) |
Set the bottom of the view - in LU.
Definition at line 1701 of file KoTextObject.cpp.
◆ setVisible()
|
inline |
Definition at line 585 of file KoTextObject.h.
◆ showCurrentFormat
|
signal |
Same thing, when the current format (of the edit object) was changed.
◆ statistics()
| bool KoTextObject::statistics | ( | TQProgressDialog * | progress, |
| ulong & | charsWithSpace, | ||
| ulong & | charsWithoutSpace, | ||
| ulong & | words, | ||
| ulong & | sentences, | ||
| ulong & | syllables, | ||
| ulong & | lines, | ||
| bool | selected | ||
| ) |
Definition at line 2260 of file KoTextObject.cpp.
◆ storeParagUndoRedoInfo()
| void KoTextObject::storeParagUndoRedoInfo | ( | KoTextCursor * | cursor, |
| KoTextDocument::SelectionId | selectionId = KoTextDocument::Standard |
||
| ) |
This prepares undoRedoInfo for a paragraph formatting change If this does too much, we could pass an enum flag to it.
But the main point is to avoid too much duplicated code
Definition at line 401 of file KoTextObject.cpp.
◆ textChangedCase()
| TQString KoTextObject::textChangedCase | ( | const TQString & | _text, |
| KoChangeCaseDia::TypeOfCase | _type | ||
| ) |
Definition at line 2031 of file KoTextObject.cpp.
◆ textDocument()
|
inline |
Return the text document contained in this KoTextObject.
Definition at line 230 of file KoTextObject.h.
◆ typingDone()
| void KoTextObject::typingDone | ( | ) |
Definition at line 1900 of file KoTextObject.cpp.
◆ typingStarted()
| void KoTextObject::typingStarted | ( | ) |
Definition at line 1893 of file KoTextObject.cpp.
◆ undo()
| void KoTextObject::undo | ( | ) |
Definition at line 217 of file KoTextObject.cpp.
◆ undoRedoInfoStruct()
|
inline |
for KWTextFrameSet
Definition at line 583 of file KoTextObject.h.
◆ updateUI
|
signal |
Emitted when the formatting under the cursor may have changed.
The Edit object should re-read settings and update the UI.
◆ variableAtPoint()
| KoVariable * KoTextObject::variableAtPoint | ( | const TQPoint & | iPoint | ) | const |
Return the variable at the given point (in document coordinates), if any.
Definition at line 2407 of file KoTextObject.cpp.
◆ variableAtPosition()
| KoVariable * KoTextObject::variableAtPosition | ( | KoTextParag * | parag, |
| int | index | ||
| ) | const |
Return the variable at the given position, if any.
Passing KoTextView's m_cursor here is usually wrong, index must come from the variablePosition value returned by KoTextCursor::place().
Definition at line 2417 of file KoTextObject.cpp.
◆ zoomedFontSize()
| int KoTextObject::zoomedFontSize | ( | int | docFontSize | ) | const |
Return the font size in LU, for this user-visible font size in pt.
Definition at line 161 of file KoTextObject.cpp.
The documentation for this class was generated from the following files:

Public Member Functions inherited from