1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef FINDDIALOG_H |
5 | #define FINDDIALOG_H |
6 | |
7 | #include "ui_finddialog.h" |
8 | #include "messagemodel.h" |
9 | |
10 | #include <QDialog> |
11 | #include <QRegularExpression> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class FindDialog : public QDialog, public Ui::FindDialog |
16 | { |
17 | Q_OBJECT |
18 | public: |
19 | enum FindOption { |
20 | MatchCase = 0x1, |
21 | IgnoreAccelerators = 0x2, |
22 | SkipObsolete = 0x4, |
23 | UseRegExp = 0x8 |
24 | }; |
25 | Q_DECLARE_FLAGS(FindOptions, FindOption) |
26 | FindDialog(QWidget *parent = 0); |
27 | QRegularExpression &getRegExp() { return m_regExp; } |
28 | |
29 | signals: |
30 | void findNext(const QString& text, DataModel::FindLocation where, |
31 | FindDialog::FindOptions options, int statusFilter); |
32 | |
33 | public slots: |
34 | void find(); |
35 | |
36 | private slots: |
37 | void emitFindNext(); |
38 | void verify(); |
39 | void statusFilterChanged(); |
40 | |
41 | private: |
42 | QRegularExpression m_regExp; |
43 | bool m_redText = false; |
44 | int m_lastStateFilter = -1; |
45 | bool m_storedSkipObsolete = false; |
46 | }; |
47 | |
48 | QT_END_NAMESPACE |
49 | |
50 | #endif |
51 |