1// qhelpsearchengine.sip generated by MetaSIP
2//
3// This file is part of the QtHelp Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QHelpSearchQuery
24{
25%TypeHeaderCode
26#include <qhelpsearchengine.h>
27%End
28
29public:
30    enum FieldName
31    {
32        DEFAULT,
33        FUZZY,
34        WITHOUT,
35        PHRASE,
36        ALL,
37        ATLEAST,
38    };
39
40    QHelpSearchQuery();
41    QHelpSearchQuery(QHelpSearchQuery::FieldName field, const QStringList &wordList);
42};
43
44class QHelpSearchEngine : QObject
45{
46%TypeHeaderCode
47#include <qhelpsearchengine.h>
48%End
49
50public:
51    QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent /TransferThis/ = 0);
52    virtual ~QHelpSearchEngine();
53    QList<QHelpSearchQuery> query() const;
54    QHelpSearchQueryWidget *queryWidget();
55    QHelpSearchResultWidget *resultWidget();
56    int hitCount() const;
57    QList<QPair<QString, QString>> hits(int start, int end) const;
58
59public slots:
60    void reindexDocumentation();
61    void cancelIndexing();
62    void search(const QList<QHelpSearchQuery> &queryList);
63    void cancelSearching();
64
65signals:
66    void indexingStarted();
67    void indexingFinished();
68    void searchingStarted();
69    void searchingFinished(int hits);
70
71public:
72%If (Qt_5_9_0 -)
73    int searchResultCount() const;
74%End
75%If (Qt_5_9_0 -)
76    QVector<QHelpSearchResult> searchResults(int start, int end) const;
77%End
78%If (Qt_5_9_0 -)
79    QString searchInput() const;
80%End
81
82public slots:
83%If (Qt_5_9_0 -)
84    void search(const QString &searchInput);
85%End
86};
87
88%If (Qt_5_9_0 -)
89
90class QHelpSearchResult
91{
92%TypeHeaderCode
93#include <qhelpsearchengine.h>
94%End
95
96public:
97    QHelpSearchResult();
98    QHelpSearchResult(const QHelpSearchResult &other);
99    QHelpSearchResult(const QUrl &url, const QString &title, const QString &snippet);
100    ~QHelpSearchResult();
101    QString title() const;
102    QUrl url() const;
103    QString snippet() const;
104};
105
106%End
107