Messagelib

findbarbase.h
1/* SPDX-FileCopyrightText: 2010 Torgny Nyblom <nyblom@kde.org>
2 * SPDX-FileCopyrightText: 2010-2024 Laurent Montel <montel@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "webengineviewer_export.h"
10#include <QWidget>
11class QAction;
12class QPushButton;
13class QMenu;
14class QLabel;
15namespace PimCommon
16{
17class LineEditWithCompleterNg;
18}
19namespace WebEngineViewer
20{
21/**
22 * @brief The FindBarBase class
23 */
24class WEBENGINEVIEWER_EXPORT FindBarBase : public QWidget
25{
26 Q_OBJECT
27public:
28 explicit FindBarBase(QWidget *parent = nullptr);
29 ~FindBarBase() override;
30
31 [[nodiscard]] QString text() const;
32 void setText(const QString &text);
33 void focusAndSetCursor();
34
35protected:
36 bool event(QEvent *e) override;
37 virtual void clearSelections();
38 virtual void updateHighLight(bool);
39 virtual void searchText(bool backward, bool isAutoSearch);
40 virtual void updateSensitivity(bool);
41
42 void setFoundMatch(bool match);
43 [[nodiscard]] QMenu *optionsMenu() const;
44
45public Q_SLOTS:
46 void findNext();
47 void findPrev();
48 void autoSearch(const QString &str);
49 void slotSearchText(bool backward = false, bool isAutoSearch = true);
50 void closeBar();
51
52Q_SIGNALS:
53 void hideFindBar();
54
55protected Q_SLOTS:
56 void caseSensitivityChanged(bool);
57 void slotHighlightAllChanged(bool);
58 void slotClearSearch();
59
60protected:
61 void updatePalette();
62 void addToCompletion(const QString &text);
63 QString mNotFoundString;
64 QString mPositiveBackground;
65 QString mNegativeBackground;
66 QString mLastSearchStr;
67 PimCommon::LineEditWithCompleterNg *mSearch = nullptr;
68 QAction *mCaseSensitiveAct = nullptr;
69
70 QPushButton *mFindPrevBtn = nullptr;
71 QPushButton *mFindNextBtn = nullptr;
72 QMenu *mOptionsMenu = nullptr;
73 QLabel *mStatus = nullptr;
74};
75}
The FindBarBase class.
Definition findbarbase.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.