6#include "findbarwebengineview.h"
7#include <PimCommon/LineEditWithCompleterNg>
9#include <QWebEngineFindTextResult>
10#include <QWebEngineView>
11using namespace KSieveUi;
13class KSieveUi::FindBarWebEngineViewPrivate
16 FindBarWebEngineViewPrivate() =
default;
18 QWebEngineView *mView =
nullptr;
21FindBarWebEngineView::FindBarWebEngineView(QWebEngineView *view,
QWidget *parent)
23 , d(new KSieveUi::FindBarWebEngineViewPrivate)
28FindBarWebEngineView::~FindBarWebEngineView() =
default;
30void FindBarWebEngineView::searchText(
bool backward,
bool isAutoSearch)
32 QWebEnginePage::FindFlags searchOptions;
35 searchOptions |= QWebEnginePage::FindBackward;
38 searchOptions |= QWebEnginePage::FindCaseSensitively;
45 mLastSearchStr = searchWord;
46 d->mView->findText(mLastSearchStr, searchOptions, [
this](
const QWebEngineFindTextResult &result) {
47 setFoundMatch(result.numberOfMatches() > 0);
51void FindBarWebEngineView::updateSensitivity(
bool sensitivity)
53 QWebEnginePage::FindFlags searchOptions;
55 searchOptions |= QWebEnginePage::FindCaseSensitively;
58 d->mView->findText(
QString(), searchOptions, [
this](
const QWebEngineFindTextResult &result) {
59 setFoundMatch(result.numberOfMatches() > 0);
63void FindBarWebEngineView::clearSelections()
66 mLastSearchStr.
clear();
67 FindBarBase::clearSelections();
70#include "moc_findbarwebengineview.cpp"
bool isChecked() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const