KDEUI
kreplace.h
Go to the documentation of this file.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 class KReplacePrivate;
00028
00096 class KDEUI_EXPORT KReplace :
00097 public KFind
00098 {
00099 Q_OBJECT
00100
00101 public:
00102
00107 KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent = 0);
00114 KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget* replaceDialog);
00115
00116 virtual ~KReplace();
00117
00124 int numReplacements() const;
00125
00131 virtual void resetCounts();
00132
00138 Result replace();
00139
00147 KDialog* replaceNextDialog( bool create = false );
00148
00154 void closeReplaceNextDialog();
00155
00173 static int replace( QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength );
00174 static int replace( QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength );
00175
00190 virtual bool shouldRestart( bool forceAsking = false, bool showNumMatches = true ) const;
00191
00196 virtual void displayFinalDialog() const;
00197
00198 Q_SIGNALS:
00199
00214 void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength);
00215
00216 private:
00217 friend class KReplacePrivate;
00218 KReplacePrivate * const d;
00219
00220 Q_PRIVATE_SLOT( d, void _k_slotSkip() )
00221 Q_PRIVATE_SLOT( d, void _k_slotReplace() )
00222 Q_PRIVATE_SLOT( d, void _k_slotReplaceAll() )
00223 };
00224 #endif