KDEUI
kreplace.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2001, S.R.Haque <srhaque@iee.org>. 00003 Copyright (C) 2002, David Faure <david@mandrakesoft.com> 00004 This file is part of the KDE project 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2, as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 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
KDE 4.6 API Reference