KTextAddons

textfindreplacewidget.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textcustomeditor_private_export.h"
10#include "texteditfindbarbase.h"
11#include <QWidget>
12
13class QAction;
14class QLineEdit;
15class QPushButton;
16namespace TextCustomEditor
17{
18class TEXTCUSTOMEDITOR_TESTS_EXPORT TextFindWidget : public QWidget
19{
20 Q_OBJECT
21public:
22 explicit TextFindWidget(QWidget *parent = nullptr);
23 ~TextFindWidget() override;
24
25 [[nodiscard]] TextEditFindBarBase::FindFlags searchOptions() const;
26
27 QLineEdit *searchLineEdit() const;
28
29 void setFoundMatch(bool match);
30
31 [[nodiscard]] bool isRegularExpression() const;
32 [[nodiscard]] QRegularExpression searchRegularExpression() const;
33
34 [[nodiscard]] QString searchText() const;
35
36Q_SIGNALS:
37 void findNext();
38 void findPrev();
39 void clearSearch();
40 void autoSearch(const QString &);
41 void updateSearchOptions();
42 void searchStringEmpty(bool);
43
44private:
45 void slotAutoSearch(const QString &str);
46 void slotRegularExpressionChanged(bool b);
47 QLineEdit *const mSearch;
48 QAction *mCaseSensitiveAct = nullptr;
49 QAction *mWholeWordAct = nullptr;
50 QAction *mRegularExpressionAct = nullptr;
51 QAction *mRespectDiacriticAct = nullptr;
52
53 QPushButton *const mFindPrevBtn;
54 QPushButton *const mFindNextBtn;
55};
56
57class TEXTCUSTOMEDITOR_TESTS_EXPORT TextReplaceWidget : public QWidget
58{
59 Q_OBJECT
60public:
61 explicit TextReplaceWidget(QWidget *parent = nullptr);
62 ~TextReplaceWidget() override;
63
64 QLineEdit *replaceLineEdit() const;
65
66public Q_SLOTS:
67 void slotSearchStringEmpty(bool);
68
69Q_SIGNALS:
70 void replaceText();
71 void replaceAllText();
72
73private:
74 QLineEdit *const mReplace;
75 QPushButton *const mReplaceBtn;
76 QPushButton *const mReplaceAllBtn;
77};
78}
QAction * findPrev(const QObject *recvr, const char *slot, QObject *parent)
QAction * findNext(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.