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
const T & at(int i) const
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
int numReplacements() const
Return the number of replacements made (i.e.
Definition: kreplace.cpp:108
QString i18nc(const char *ctxt, const char *text)
Definition: kreplacedialog.h:67
virtual bool shouldRestart(bool forceAsking=false, bool showNumMatches=true) const
Returns true if we should restart the search from scratch.
Definition: kreplace.cpp:328
static int replaceHelper(QString &text, const QString &replacement, int index, long options, int length, const QRegExp *regExp)
Definition: kreplace.cpp:141
QString number(int n, int base)
int count(const T &value) const
Definition: kstandardaction.h:129
KDialog * replaceNextDialog(bool create=false)
Return (or create) the dialog that shows the "find next?" prompt.
Definition: kreplace.cpp:113
QStringList capturedTexts() const
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.
virtual void displayFinalDialog() const
Displays the final dialog telling the user how many replacements were made.
Definition: kreplace.cpp:133
QString & replace(int position, int n, QChar after)
QString mid(int position, int n) const
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to one of the KStandardAction::StandardAction actions, which is connected to the given object and slot, and is owned by parent.
Definition: kstandardaction.cpp:82
int length() const
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 Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.