KDEUI
kreplace.cpp
Go to the documentation of this file.
91 KReplace::KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent) :
97 KReplace::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 ) );
141 static 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()
234 int KReplace::replace(QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength)
250 int 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 message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
QString i18n(const char *text)
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
QString i18np(const char *sing, const char *plur, const A1 &a1)
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 QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent=0)
Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
Definition: kreplace.cpp:91
QString i18nc(const char *ctxt, const char *text)
Definition: kreplacedialog.h:67
static int replaceHelper(QString &text, const QString &replacement, int index, long options, int length, const QRegExp *regExp)
Definition: kreplace.cpp:141
Definition: kstandardaction.h:129
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
Definition: kfind.h:139
void highlight(const QString &text, int matchingIndex, int matchedLength)
Connect to this signal to implement highlighting of found text during the find operation.
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
void optionsChanged()
This signal is sent whenever one of the option checkboxes is toggled.
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to one of the KStandardAction::StandardAction actions,...
Definition: kstandardaction.cpp:82
virtual bool shouldRestart(bool forceAsking=false, bool showNumMatches=true) const
Returns true if we should restart the search from scratch.
Definition: kreplace.cpp:328
virtual void resetCounts()
Call this to reset the numMatches count (and the numReplacements count for a KReplace).
Definition: kfind.cpp:700
Definition: kmessagebox.h:72
Definition: kfind.h:139
virtual void resetCounts()
Call this to reset the numMatches & numReplacements counts.
Definition: kreplace.cpp:322
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jan 18 2020 00:00:00 by doxygen 1.8.15 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jan 18 2020 00:00:00 by doxygen 1.8.15 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.