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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • 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 
26 class KReplaceNextDialog;
27 class KReplacePrivate;
28 
96 class KDEUI_EXPORT KReplace :
97  public KFind
98 {
99  Q_OBJECT
100 
101 public:
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 
198 Q_SIGNALS:
199 
214  void replace(const QString &text, int replacementIndex, int replacedLength, int matchedLength);
215 
216 private:
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
QWidget
KDialog
A dialog base class with standard buttons and predefined layouts.
Definition: kdialog.h:128
kfind.h
QRegExp
KReplace
A generic implementation of the "replace" function.
Definition: kreplace.h:96
KFind::displayFinalDialog
virtual void displayFinalDialog() const
Displays the final dialog saying "no match was found", if that was the case.
Definition: kfind.cpp:599
QString
KFind::Result
Result
Definition: kfind.h:139
KFind
A generic implementation of the "find" function.
Definition: kfind.h:101
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
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, which is connected to the given object and slot, and is owned by parent.
Definition: kstandardaction.cpp:82
KFind::resetCounts
virtual void resetCounts()
Call this to reset the numMatches count (and the numReplacements count for a KReplace).
Definition: kfind.cpp:700
KFind::KReplace
friend class KReplace
Definition: kfind.h:363
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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