• 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
A generic implementation of the "find" function.
Definition: kfind.h:103
KFind::KReplace
friend class KReplace
Definition: kfind.h:363
KFind::Result
Result
Definition: kfind.h:139
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::resetCounts
virtual void resetCounts()
Call this to reset the numMatches count (and the numReplacements count for a KReplace).
Definition: kfind.cpp:700
KFind::displayFinalDialog
virtual void displayFinalDialog() const
Displays the final dialog saying "no match was found", if that was the case.
Definition: kfind.cpp:599
KReplace
A generic implementation of the "replace" function.
Definition: kreplace.h:98
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
KStandardAction::replace
KAction * replace(const QObject *recvr, const char *slot, QObject *parent)
Find and replace matches.
Definition: kstandardaction.cpp:344
KStandardAction::create
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to one of the KStandardAction::StandardAction actions,...
Definition: kstandardaction.cpp:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.4 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
  • Modules
  • 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