| 1 | // Copyright (C) 2024 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 QHELPSEARCHENGINECORE_H |
| 5 | #define QHELPSEARCHENGINECORE_H |
| 6 | |
| 7 | #include <QtHelp/qhelp_global.h> |
| 8 | #include <QtHelp/qhelpsearchresult.h> |
| 9 | |
| 10 | #include <QtCore/qobject.h> |
| 11 | #include <QtCore/qshareddata.h> |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class QHelpEngineCore; |
| 16 | class QHelpSearchEngineCorePrivate; |
| 17 | |
| 18 | class QHELP_EXPORT QHelpSearchEngineCore : public QObject |
| 19 | { |
| 20 | Q_OBJECT |
| 21 | Q_DECLARE_PRIVATE(QHelpSearchEngineCore) |
| 22 | |
| 23 | public: |
| 24 | explicit QHelpSearchEngineCore(QHelpEngineCore *helpEngine, QObject *parent = nullptr); |
| 25 | ~QHelpSearchEngineCore() override; |
| 26 | |
| 27 | int searchResultCount() const; |
| 28 | QList<QHelpSearchResult> searchResults(int start, int end) const; |
| 29 | QString searchInput() const; |
| 30 | |
| 31 | public Q_SLOTS: |
| 32 | void reindexDocumentation(); |
| 33 | void cancelIndexing(); |
| 34 | |
| 35 | void search(const QString &searchInput); |
| 36 | void cancelSearching(); |
| 37 | |
| 38 | void scheduleIndexDocumentation(); |
| 39 | |
| 40 | Q_SIGNALS: |
| 41 | void indexingStarted(); |
| 42 | void indexingFinished(); |
| 43 | |
| 44 | void searchingStarted(); |
| 45 | void searchingFinished(); |
| 46 | }; |
| 47 | |
| 48 | QT_END_NAMESPACE |
| 49 | |
| 50 | #endif // QHELPSEARCHENGINECORE_H |
| 51 | |