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 
00095 class KReplace :
00096     public KFind
00097 {
00098     Q_OBJECT
00099 
00100 public:
00101 
00106     KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent = 0);
00113     KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget* replaceDialog);
00114 
00115     virtual ~KReplace();
00116 
00123     int numReplacements() const { return m_replacements; }
00124 
00130     virtual void resetCounts();
00131 
00137     Result replace();
00138 
00146     KDialogBase* replaceNextDialog( bool create = false );
00147 
00153     void closeReplaceNextDialog();
00154 
00172     static int replace( QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength );
00173     static int replace( QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength );
00174 
00189     virtual bool shouldRestart( bool forceAsking = false, bool showNumMatches = true ) const;
00190 
00195     virtual void displayFinalDialog() const;
00196 
00197 signals:
00198 
00213     void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength);
00214 
00215 protected slots:
00216 
00217     void slotSkip();
00218     void slotReplace();
00219     void slotReplaceAll();
00220 
00221 private:
00222     KReplaceNextDialog* dialog();
00223     void doReplace();
00224     static int replace( QString &text, const QString &replacement, int index, int length );
00225 
00226     QString m_replacement;
00227     unsigned m_replacements;
00228 
00229     
00230     class KReplacePrivate;
00231     KReplacePrivate *d;
00232 };
00233 #endif
 
This file is part of the documentation for kutils Library Version 3.2.0.