1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QHELPSEARCHINDEXREADERDEFAULT_H |
5 | #define QHELPSEARCHINDEXREADERDEFAULT_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists for the convenience |
12 | // of the help generator tools. This header file may change from version |
13 | // to version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include "qhelpsearchindexreader_p.h" |
19 | |
20 | QT_FORWARD_DECLARE_CLASS(QSqlDatabase) |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | namespace fulltextsearch { |
25 | namespace qt { |
26 | |
27 | class Reader |
28 | { |
29 | public: |
30 | void setIndexPath(const QString &path); |
31 | void addNamespaceAttributes(const QString &namespaceName, const QStringList &attributes); |
32 | void setFilterEngineNamespaceList(const QStringList &namespaceList); |
33 | |
34 | void searchInDB(const QString &term); |
35 | QList<QHelpSearchResult> searchResults() const; |
36 | |
37 | private: |
38 | QList<QHelpSearchResult> queryTable(const QSqlDatabase &db, |
39 | const QString &tableName, |
40 | const QString &searchInput) const; |
41 | |
42 | QMultiMap<QString, QStringList> m_namespaceAttributes; |
43 | QStringList m_filterEngineNamespaceList; |
44 | QList<QHelpSearchResult> m_searchResults; |
45 | QString m_indexPath; |
46 | bool m_useFilterEngine = false; |
47 | }; |
48 | |
49 | |
50 | class QHelpSearchIndexReaderDefault : public QHelpSearchIndexReader |
51 | { |
52 | Q_OBJECT |
53 | |
54 | private: |
55 | void run() override; |
56 | |
57 | private: |
58 | Reader m_reader; |
59 | }; |
60 | |
61 | } // namespace std |
62 | } // namespace fulltextsearch |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QHELPSEARCHINDEXREADERDEFAULT_H |
67 |