KoTextIterator Class Reference
A convenient way to iterate over paragraphs, possibly in multiple textobjects, with many options (from cursor, backwards, in selection).General purpose paragraph iterator. More...
#include <kotextiterator.h>
Inheritance diagram for KoTextIterator:


Signals | |
void | currentParagraphModified (int modifyType, int pos, int length) |
void | currentParagraphDeleted () |
Public Member Functions | |
KoTextIterator (const QValueList< KoTextObject * > &lstObjects, KoTextView *textView, int options) | |
void | init (const QValueList< KoTextObject * > &lstObjects, KoTextView *textView, int options) |
void | restart () |
void | setOptions (int options) |
int | options () const |
void | operator++ () |
bool | atEnd () const |
bool | hasText () const |
QString | currentText () const |
KoTextParag * | currentParag () const |
KoTextObject * | currentTextObject () const |
int | currentStartIndex () const |
QPair< int, QString > | currentTextAndIndex () const |
Protected Slots | |
void | slotParagraphDeleted (KoTextParag *parag) |
void | slotParagraphModified (KoTextParag *parag, int, int pos, int length) |
Protected Member Functions | |
void | connectTextObjects () |
void | nextTextObject () |
Detailed Description
A convenient way to iterate over paragraphs, possibly in multiple textobjects, with many options (from cursor, backwards, in selection).General purpose paragraph iterator.
Definition at line 36 of file kotextiterator.h.
Constructor & Destructor Documentation
|
Definition at line 43 of file kotextiterator.h. |
Member Function Documentation
|
The search direction (forward or backward) is handled in a bit of a tricky way. m_firstParag/m_firstIndex is where the search starts, whichever the direction m_lastParag/m_lastIndex is where the search ends, whichever the direction But the list of textobjects is as given (we assume document order). So we go from the first to the last textobject, or from the last to the first textobject. Definition at line 36 of file kotextiterator.cc. References KoTextObject::textDocument(), and KoTextView::textObject(). |
|
Restart from the beginning - assumes same parameters given to init.
Definition at line 141 of file kotextiterator.cc. Referenced by KoFindReplace::findNext(), and setOptions(). |
|
Change options during iteration. ## Not sure how if all cases will be handled :} At least this is useful for the "Replace All" button during replacing, and for switching to "FindBackwards" temporarily for "find previous". Definition at line 338 of file kotextiterator.cc. References restart(). Referenced by KoFindReplace::findNext(). |
|
Return the options currently used by the iterator.
Definition at line 63 of file kotextiterator.h. Referenced by KoFindReplace::findNext(). |
|
Go to next paragraph that we must iterate over.
Definition at line 222 of file kotextiterator.cc. |
|
Definition at line 278 of file kotextiterator.cc. Referenced by KoFindReplace::findNext(). |
|
Definition at line 319 of file kotextiterator.cc. |
|
Definition at line 289 of file kotextiterator.cc. References currentTextAndIndex(). |
|
Definition at line 89 of file kotextiterator.h. |
|
Definition at line 94 of file kotextiterator.h. |
|
Where in currentParag() does currentText() start?
Definition at line 284 of file kotextiterator.cc. References currentTextAndIndex(). |
|
Definition at line 294 of file kotextiterator.cc. Referenced by currentStartIndex(), currentText(), and KoFindReplace::findNext(). |
|
Emitted when the current paragraph has been modified by the user. Apps will often want to call setData again |
|
Emitted when the current paragraph has been deleted by the user. When this happens, the iterator automatically moves to the next paragraph (if any). |
The documentation for this class was generated from the following files: