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 <QTextDocument>
12#include <TextCustomEditor/TextEditFindBarBase>
13#include <qglobal.h>
14class QPlainTextEdit;
15class QTextEdit;
16namespace TextCustomEditor
17{
18
19namespace FindUtils
20{
21/**
22 * Replaces all occurrences of a search string provided by @p findWidget
23 * by a string provided by @p replaceWidget in a @p document
24 *
25 * @return number of replacements done
26 */
27[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
28replaceAll(QPlainTextEdit *view, const QString &str, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
29[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
30replaceAll(QTextEdit *view, const QString &str, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
31[[nodiscard]] TEXTCUSTOMEDITOR_TESTS_EXPORT int
32replaceAll(QTextDocument *document, const QRegularExpression &regExp, const QString &replaceWidget, TextEditFindBarBase::FindFlags searchOptions);
33[[nodiscard]] bool find(QPlainTextEdit *view, const QString &searchText, QTextDocument::FindFlags searchOptions);
34[[nodiscard]] bool find(QTextEdit *view, const QString &searchText, QTextDocument::FindFlags searchOptions);
35[[nodiscard]] QTextDocument::FindFlags convertTextEditFindFlags(TextEditFindBarBase::FindFlags textEditFlags);
36}
37} // namespace TextCustomEditor
QAction * find(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 3 2025 11:46:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.