KTextAddons

findutils.h
1/*
2 SPDX-FileCopyrightText: 2020 Igor Poboiko <igor.poboiko@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textcustomeditor_private_export.h"
10#include <QChar>
11#include <QStringView>
12#include <QTextDocument>
13#include <TextCustomEditor/TextEditFindBarBase>
14#include <qglobal.h>
15class QPlainTextEdit;
16class QTextEdit;
17namespace TextCustomEditor
18{
19
20namespace FindUtils
21{
22/**
23 * Replaces all occurrences of a search string provided by @p findWidget
24 * by a string provided by @p replaceWidget in a @p document
25 *
26 * @return number of replacements done
27 */
28[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
29replaceAll(QPlainTextEdit *view, const QString &str, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
30[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
31replaceAll(QTextEdit *view, const QString &str, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
32[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
33replaceAll(QTextDocument *document, const QRegularExpression &regExp, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
34[[nodiscard]] bool find(QPlainTextEdit *view, const QString &searchText, QTextDocument::FindFlags searchOptions);
35[[nodiscard]] bool find(QTextEdit *view, const QString &searchText, QTextDocument::FindFlags searchOptions);
36[[nodiscard]] QTextDocument::FindFlags convertTextEditFindFlags(TextEditFindBarBase::FindFlags textEditFlags);
37}
38} // namespace TextCustomEditor
KGuiItem find()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.