lib

#include <KoSearchDia.h>

Public Member Functions

 KoFindReplace (TQWidget *parent, KoSearchDia *dialog, const TQValueList< KoTextObject * > &lstObject, KoTextView *textView)
 KoFindReplace (TQWidget *parent, KoReplaceDia *dialog, const TQValueList< KoTextObject * > &lstObject, KoTextView *textView)
KoTextParag * currentParag ()
bool isReplace () const
bool shouldRestart ()
bool findNext ()
bool findPrevious ()
void setActiveWindow ()
void emitUndoRedo ()
virtual void emitNewCommand (KCommand *)=0
virtual void highlightPortion (KoTextParag *parag, int index, int length, KoTextDocument *textdoc, KDialogBase *dialog)=0
bool validateMatch (const TQString &text, int index, int matchedlength)

Protected Slots

void slotFindNext ()
void optionsChanged ()
void dialogClosed ()
void highlight (const TQString &text, int matchingIndex, int matchingLength)
void replace (const TQString &text, int replacementIndex, int replacedLength, int searchLength)
void slotCurrentParagraphModified (int, int, int)

Protected Member Functions

void replaceWithAttribut (KoTextCursor *cursor, int index)
KMacroCommand * macroCommand ()
long options () const
void setOptions (long opt)
void removeHighlight ()
bool needData () const
void setData (const TQString &data, int startPos=-1)

Detailed Description

This class implements the 'find' functionality ( the "search next, prompt" loop ) and the 'replace' functionality.

Same class, to allow centralizing the findNext() code.

Definition at line 207 of file KoSearchDia.h.

Constructor & Destructor Documentation

◆ KoFindReplace() [1/2]

KoFindReplace::KoFindReplace ( TQWidget * parent,
KoSearchDia * dialog,
const TQValueList< KoTextObject * > & lstObject,
KoTextView * textView )

Definition at line 149 of file KoSearchDia.cpp.

◆ KoFindReplace() [2/2]

KoFindReplace::KoFindReplace ( TQWidget * parent,
KoReplaceDia * dialog,
const TQValueList< KoTextObject * > & lstObject,
KoTextView * textView )

Definition at line 164 of file KoSearchDia.cpp.

◆ ~KoFindReplace()

KoFindReplace::~KoFindReplace ( )

Definition at line 203 of file KoSearchDia.cpp.

Member Function Documentation

◆ currentParag()

KoTextParag * KoFindReplace::currentParag ( )
inline

Definition at line 216 of file KoSearchDia.h.

◆ dialogClosed

void KoFindReplace::dialogClosed ( )
protectedslot

Definition at line 216 of file KoSearchDia.cpp.

◆ emitUndoRedo()

void KoFindReplace::emitUndoRedo ( )

Emit undo/redo command for the last replacements made.

Definition at line 232 of file KoSearchDia.cpp.

◆ findNext()

bool KoFindReplace::findNext ( )

Look for the next match.

This whole code should be rewritten at some point: if we want to allow matches across paragraph borders, then we need to send the whole text of a textobject at once, instead of paragraph-after-paragraph.

Returns false if we're finished.

Definition at line 252 of file KoSearchDia.cpp.

◆ findPrevious()

bool KoFindReplace::findPrevious ( )

Look for the previous match.

Returns false if we're finished.

Definition at line 312 of file KoSearchDia.cpp.

◆ highlight

void KoFindReplace::highlight ( const TQString & text,
int matchingIndex,
int matchingLength )
protectedslot

Definition at line 350 of file KoSearchDia.cpp.

◆ highlightPortion()

virtual void KoFindReplace::highlightPortion ( KoTextParag * parag,
int index,
int length,
KoTextDocument * textdoc,
KDialogBase * dialog )
pure virtual

Highlight a match.

◆ isReplace()

bool KoFindReplace::isReplace ( ) const
inline

Definition at line 220 of file KoSearchDia.h.

◆ macroCommand()

KMacroCommand * KoFindReplace::macroCommand ( )
protected

Definition at line 486 of file KoSearchDia.cpp.

◆ needData()

bool KoFindReplace::needData ( ) const
inlineprotected

Definition at line 255 of file KoSearchDia.h.

◆ options()

long KoFindReplace::options ( ) const
protected

Definition at line 328 of file KoSearchDia.cpp.

◆ optionsChanged

void KoFindReplace::optionsChanged ( )
protectedslot

Definition at line 211 of file KoSearchDia.cpp.

◆ removeHighlight()

void KoFindReplace::removeHighlight ( )
protected

Definition at line 225 of file KoSearchDia.cpp.

◆ replace

void KoFindReplace::replace ( const TQString & text,
int replacementIndex,
int replacedLength,
int searchLength )
protectedslot

Definition at line 362 of file KoSearchDia.cpp.

◆ replaceWithAttribut()

void KoFindReplace::replaceWithAttribut ( KoTextCursor * cursor,
int index )
protected

Definition at line 407 of file KoSearchDia.cpp.

◆ setActiveWindow()

void KoFindReplace::setActiveWindow ( )

Bring to front (e.g.

when menuitem called twice)

Definition at line 494 of file KoSearchDia.cpp.

◆ setData()

void KoFindReplace::setData ( const TQString & data,
int startPos = -1 )
inlineprotected

Definition at line 256 of file KoSearchDia.h.

◆ setOptions()

void KoFindReplace::setOptions ( long opt)
protected

Definition at line 333 of file KoSearchDia.cpp.

◆ shouldRestart()

bool KoFindReplace::shouldRestart ( )

Definition at line 922 of file KoSearchDia.cpp.

◆ slotCurrentParagraphModified

void KoFindReplace::slotCurrentParagraphModified ( int ,
int pos,
int  )
protectedslot

Definition at line 342 of file KoSearchDia.cpp.

◆ slotFindNext

void KoFindReplace::slotFindNext ( )
protectedslot

Definition at line 306 of file KoSearchDia.cpp.

◆ validateMatch()

bool KoFindReplace::validateMatch ( const TQString & text,
int index,
int matchedlength )

For KoTextFind and KoTextReplace.

Definition at line 834 of file KoSearchDia.cpp.


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