kreplace.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KREPLACE_H
00022 #define KREPLACE_H
00023
00024 #include "kfind.h"
00025
00026 class KReplaceNextDialog;
00027
00096 class KReplace :
00097 public KFind
00098 {
00099 Q_OBJECT
00100
00101 public:
00102
00104 KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent = 0);
00105 virtual ~KReplace();
00106
00113 int numReplacements() const { return m_replacements; }
00114
00120 virtual void resetCounts();
00121
00127 Result replace();
00128
00136 KDialogBase* replaceNextDialog( bool create = false );
00137
00143 void closeReplaceNextDialog();
00144
00162 static int replace( QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength );
00163 static int replace( QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength );
00164
00179 virtual bool shouldRestart( bool forceAsking = false, bool showNumMatches = true ) const;
00180
00185 virtual void displayFinalDialog() const;
00186
00187 signals:
00188
00203 void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength);
00204
00205 protected slots:
00206
00207 void slotSkip();
00208 void slotReplace();
00209 void slotReplaceAll();
00210
00211 private:
00212 KReplaceNextDialog* dialog();
00213 void doReplace();
00214 static int replace( QString &text, const QString &replacement, int index, int length );
00215
00216 QString m_replacement;
00217 unsigned m_replacements;
00218
00219
00220 class KReplacePrivate;
00221 KReplacePrivate *d;
00222 };
00223 #endif
This file is part of the documentation for kdelibs Version 3.1.0.