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 [[nodiscard]] bool event(QEvent *e) override;
37 [[nodiscard]] bool eventFilter(QObject *obj, QEvent *event) override;
38 virtual void clearSelections();
39 virtual void updateHighLight(bool);
40 virtual void searchText(bool backward, bool isAutoSearch);
41 virtual void updateSensitivity(bool);
42
43 void setFoundMatch(bool match);
44 [[nodiscard]] QMenu *optionsMenu() const;
45
46public Q_SLOTS:
47 void findNext();
48 void findPrev();
49 void autoSearch(const QString &str);
50 void slotSearchText(bool backward = false, bool isAutoSearch = true);
51 void closeBar();
52
53Q_SIGNALS:
54 void hideFindBar();
55
56protected Q_SLOTS:
57 void caseSensitivityChanged(bool);
58 void slotHighlightAllChanged(bool);
59 void slotClearSearch();
60
61protected:
62 void updatePalette();
63 void addToCompletion(const QString &text);
64 QString mNotFoundString;
65 QString mPositiveBackground;
66 QString mNegativeBackground;
67 QString mLastSearchStr;
68 PimCommon::LineEditWithCompleterNg *mSearch = nullptr;
69 QAction *mCaseSensitiveAct = nullptr;
70
71 QPushButton *mFindPrevBtn = nullptr;
72 QPushButton *mFindNextBtn = nullptr;
73 QMenu *mOptionsMenu = nullptr;
74 QLabel *mStatus = nullptr;
75};
76}
The FindBarBase class.
Definition findbarbase.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:56:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.