KDEUI
kreplace.cpp
Go to the documentation of this file.
91KReplace::KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent) :
97KReplace::KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget *dlg) :
138 KMessageBox::information(parentWidget(), i18np("1 replacement done.", "%1 replacements done.", d->m_replacements ) );
141static int replaceHelper(QString &text, const QString &replacement, int index, long options, int length, const QRegExp* regExp)
203 d->dialog()->show(); // TODO kde5: virtual void showReplaceNextDialog(QString,QString), so that kreplacetest can skip the show()
234int KReplace::replace(QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength)
250int KReplace::replace(QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength)
299 const int replacedLength = replaceHelper(df->text, m_replacement, df->index, df->options, df->matchedLength, df->regExp);
305 kDebug() << "after replace() signal: KFind::d->index=" << df->index << " replacedLength=" << replacedLength;
313 // when replacing the empty pattern, move on. See also kjs/regexp.cpp for how this should be done for regexps.
void optionsChanged()
This signal is sent whenever one of the option checkboxes is toggled.
virtual void resetCounts()
Call this to reset the numMatches count (and the numReplacements count for a KReplace).
Definition: kfind.cpp:700
virtual bool validateMatch(const QString &text, int index, int matchedlength)
Virtual method, which allows applications to add extra checks for validating a candidate match.
Definition: kfind.cpp:705
void highlight(const QString &text, int matchingIndex, int matchedLength)
Connect to this signal to implement highlighting of found text during the find operation.
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
Display an "Information" dialog.
Definition: kmessagebox.cpp:960
static int questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
Display a simple "question" dialog.
Definition: kmessagebox.cpp:353
KDialog * replaceNextDialog(bool create=false)
Return (or create) the dialog that shows the "find next?" prompt.
Definition: kreplace.cpp:113
virtual void displayFinalDialog() const
Displays the final dialog telling the user how many replacements were made.
Definition: kreplace.cpp:133
virtual void resetCounts()
Call this to reset the numMatches & numReplacements counts.
Definition: kreplace.cpp:322
virtual bool shouldRestart(bool forceAsking=false, bool showNumMatches=true) const
Returns true if we should restart the search from scratch.
Definition: kreplace.cpp:328
#define kDebug
QString i18n(const char *text)
QString i18np(const char *sing, const char *plur, const A1 &a1)
QString i18nc(const char *ctxt, const char *text)
static int replaceHelper(QString &text, const QString &replacement, int index, long options, int length, const QRegExp *regExp)
Definition: kreplace.cpp:141
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.