Messagelib

findbarbase.h
1 /* SPDX-FileCopyrightText: 2010 Torgny Nyblom <[email protected]>
2  * SPDX-FileCopyrightText: 2010-2023 Laurent Montel <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #pragma once
8 
9 #include "webengineviewer_export.h"
10 #include <QWidget>
11 class QAction;
12 class QPushButton;
13 class QMenu;
14 class QLabel;
15 namespace PimCommon
16 {
17 class LineEditWithCompleterNg;
18 }
19 namespace WebEngineViewer
20 {
21 /**
22  * @brief The FindBarBase class
23  */
24 class WEBENGINEVIEWER_EXPORT FindBarBase : public QWidget
25 {
26  Q_OBJECT
27 public:
28  explicit FindBarBase(QWidget *parent = nullptr);
29  ~FindBarBase() override;
30 
31  Q_REQUIRED_RESULT QString text() const;
32  void setText(const QString &text);
33  void focusAndSetCursor();
34 
35 protected:
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  QMenu *optionsMenu() const;
44 
45 public 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 
52 Q_SIGNALS:
53  void hideFindBar();
54 
55 protected Q_SLOTS:
56  void caseSensitivityChanged(bool);
57  void slotHighlightAllChanged(bool);
58  void slotClearSearch();
59 
60 protected:
61  void updatePalette();
62  QString mNotFoundString;
63  QString mPositiveBackground;
64  QString mNegativeBackground;
65  QString mLastSearchStr;
66  PimCommon::LineEditWithCompleterNg *mSearch = nullptr;
67  QAction *mCaseSensitiveAct = nullptr;
68 
69  QPushButton *mFindPrevBtn = nullptr;
70  QPushButton *mFindNextBtn = nullptr;
71  QMenu *mOptionsMenu = nullptr;
72  QLabel *mStatus = nullptr;
73  void addToCompletion(const QString &text);
74 };
75 }
The FindBarBase class.
Definition: findbarbase.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:08:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.