BibleTime
btfindwidget.h
Go to the documentation of this file.
1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, https://bibletime.info/
6*
7* Copyright 1999-2025 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13#pragma once
14
15#include <QWidget>
16
17#include <QObject>
18#include <QString>
19
20
21class QCheckBox;
22class QLineEdit;
23class QToolButton;
24
25class BtFindWidget final: public QWidget {
26
27 Q_OBJECT
28
29private: /* Types: */
30
32 QString text;
34
35 friend bool operator==(HighlightState const & lhs,
36 HighlightState const & rhs) noexcept
37 {
38 return (lhs.text == rhs.text)
39 && (lhs.caseSensitive == rhs.caseSensitive);
40 }
41
42 friend bool operator!=(HighlightState const & lhs,
43 HighlightState const & rhs) noexcept
44 {
45 return (lhs.text != rhs.text)
46 || (lhs.caseSensitive != rhs.caseSensitive);
47 }
48 };
49
50public: // methods:
51
52 BtFindWidget(QWidget * parent = nullptr);
53
54 void showAndSelect();
55
56protected: // Methods:
57
58 void timerEvent(QTimerEvent * const event) final override;
59
60private: // methods:
61
62 void queueHighlight();
64 void retranslateUi();
65
66Q_SIGNALS:
67
69 void findNext();
70 void highlightText(QString const & text, bool caseSensitive);
71
72private: // fields:
73
77 QCheckBox * m_caseCheckBox;
80
81};
HighlightState m_lastHighlightState
void findPrevious()
void highlightImmediately()
void showAndSelect()
QLineEdit * m_textEditor
void findNext()
QToolButton * m_previousButton
QToolButton * m_nextButton
int m_throttleTimerId
void highlightText(QString const &text, bool caseSensitive)
void timerEvent(QTimerEvent *const event) final override
QCheckBox * m_caseCheckBox
void queueHighlight()
friend bool operator==(HighlightState const &lhs, HighlightState const &rhs) noexcept
friend bool operator!=(HighlightState const &lhs, HighlightState const &rhs) noexcept