• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • findreplace
kreplace.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2001, S.R.Haque <srhaque@iee.org>.
3 Copyright (C) 2002, David Faure <david@mandrakesoft.com>
4 This file is part of the KDE project
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2, as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KREPLACE_H
22#define KREPLACE_H
23
24#include "kfind.h"
25
26class KReplaceNextDialog;
27class KReplacePrivate;
28
96class KDEUI_EXPORT KReplace :
97 public KFind
98{
99 Q_OBJECT
100
101public:
102
107 KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent = 0);
114 KReplace(const QString &pattern, const QString &replacement, long options, QWidget *parent, QWidget* replaceDialog);
115
116 virtual ~KReplace();
117
124 int numReplacements() const;
125
131 virtual void resetCounts();
132
138 Result replace();
139
147 KDialog* replaceNextDialog( bool create = false );
148
154 void closeReplaceNextDialog();
155
173 static int replace( QString &text, const QString &pattern, const QString &replacement, int index, long options, int *replacedLength );
174 static int replace( QString &text, const QRegExp &pattern, const QString &replacement, int index, long options, int *replacedLength );
175
190 virtual bool shouldRestart( bool forceAsking = false, bool showNumMatches = true ) const;
191
196 virtual void displayFinalDialog() const;
197
198Q_SIGNALS:
199
214 void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength);
215
216private:
217 friend class KReplacePrivate;
218 KReplacePrivate * const d;
219
220 Q_PRIVATE_SLOT( d, void _k_slotSkip() )
221 Q_PRIVATE_SLOT( d, void _k_slotReplace() )
222 Q_PRIVATE_SLOT( d, void _k_slotReplaceAll() )
223};
224#endif
KDialog
A dialog base class with standard buttons and predefined layouts.
Definition kdialog.h:129
KFind::KReplace
friend class KReplace
Definition kfind.h:363
KFind::Result
Result
Definition kfind.h:139
KFind::index
int index() const
Definition kfind.cpp:676
KFind::shouldRestart
virtual bool shouldRestart(bool forceAsking=false, bool showNumMatches=true) const
Returns true if we should restart the search from scratch.
Definition kfind.cpp:609
KFind::pattern
QString pattern() const
Definition kfind.cpp:681
KFind::resetCounts
virtual void resetCounts()
Call this to reset the numMatches count (and the numReplacements count for a KReplace).
Definition kfind.cpp:700
KFind::KFind
KFind(const QString &pattern, long options, QWidget *parent)
Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
Definition kfind.cpp:61
KFind::displayFinalDialog
virtual void displayFinalDialog() const
Displays the final dialog saying "no match was found", if that was the case.
Definition kfind.cpp:599
KFind::options
long options() const
Return the current options.
Definition kfind.cpp:650
KReplace::KReplace
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
KReplace::replaceNextDialog
KDialog * replaceNextDialog(bool create=false)
Return (or create) the dialog that shows the "find next?" prompt.
Definition kreplace.cpp:113
KReplace::KReplacePrivate
friend class KReplacePrivate
Definition kreplace.h:217
KReplace::replace
Result replace()
Walk the text fragment (e.g.
Definition kreplace.cpp:162
KReplace::numReplacements
int numReplacements() const
Return the number of replacements made (i.e.
Definition kreplace.cpp:108
KReplace::closeReplaceNextDialog
void closeReplaceNextDialog()
Close the "replace next?" dialog.
Definition kreplace.cpp:369
KReplace::replace
void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength)
Connect to this slot to implement updating of replaced text during the replace operation.
QWidget
kfind.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal