KTextWidgets 5.109.0
kreplacedialog.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2001 S.R. Haque <srhaque@iee.org>.
4 SPDX-FileCopyrightText: 2002 David Faure <david@mandrakesoft.com>
5
6 SPDX-License-Identifier: LGPL-2.0-only
7*/
8
9#ifndef KREPLACEDIALOG_H
10#define KREPLACEDIALOG_H
11
12#include "ktextwidgets_export.h"
13
14#include "kfinddialog.h"
15
16class KReplaceDialogPrivate;
17
45class KTEXTWIDGETS_EXPORT KReplaceDialog : public KFindDialog
46{
47 Q_OBJECT
48
49public:
51
52 enum Options {
54 PromptOnReplace = 256,
55 BackReference = 512,
56 };
57
69 explicit KReplaceDialog(QWidget *parent = nullptr,
70 long options = 0,
71 const QStringList &findStrings = QStringList(),
72 const QStringList &replaceStrings = QStringList(),
73 bool hasSelection = true);
74
78 ~KReplaceDialog() override;
79
88 void setReplacementHistory(const QStringList &history);
89
95 QStringList replacementHistory() const;
96
102 void setOptions(long options);
103
110 long options() const;
111
115 QString replacement() const;
116
123 QWidget *replaceExtension() const;
124
125protected:
126 void showEvent(QShowEvent *) override;
127
128private:
129 Q_DECLARE_PRIVATE_D(KFindDialog::d, KReplaceDialog)
130#if KTEXTWIDGETS_BUILD_DEPRECATED_SINCE(5, 79)
131 QT_WARNING_PUSH
132 QT_WARNING_DISABLE_CLANG("-Wunused-private-field")
133 // Unused, kept for ABI compatibility
134 const void *__ktextwidgets_d_do_not_use;
135 QT_WARNING_POP
136#endif
137};
138
139#endif // KREPLACEDIALOG_H
A generic "find" dialog.
Definition kfinddialog.h:66
A generic "replace" dialog.
Definition kreplacedialog.h:46
QWidget * replaceExtension() const
Returns an empty widget which the user may fill with additional UI elements as required.
~KReplaceDialog() override
Destructor.
QStringList replacementHistory() const
Returns the list of history items.
long options() const
Returns the state of the options.
void setReplacementHistory(const QStringList &history)
Provide the list of strings to be displayed as the history of replacement strings.
void setOptions(long options)
Set the options which are enabled.
KReplaceDialog(QWidget *parent=nullptr, long options=0, const QStringList &findStrings=QStringList(), const QStringList &replaceStrings=QStringList(), bool hasSelection=true)
Construct a replace dialog.read-only or rather select-only combo box with a parent object and a name.
QString replacement() const
Returns the replacement string.
Options
Options.
Definition kreplacedialog.h:52