Warning: That file was not part of the compilation database. It may have many parsing errors.

1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Assistant of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QHELPSEARCHENGINE_H
41#define QHELPSEARCHENGINE_H
42
43#include <QtHelp/qhelp_global.h>
44
45#include <QtCore/QMap>
46#include <QtCore/QUrl>
47#include <QtCore/QObject>
48#include <QtCore/QSharedDataPointer>
49#include <QtCore/QString>
50#include <QtCore/QStringList>
51
52QT_BEGIN_NAMESPACE
53
54class QHelpEngineCore;
55class QHelpSearchQueryWidget;
56class QHelpSearchEnginePrivate;
57class QHelpSearchResultData;
58class QHelpSearchResultWidget;
59
60class QHELP_EXPORT QHelpSearchQuery
61{
62public:
63 enum FieldName { DEFAULT = 0, FUZZY, WITHOUT, PHRASE, ALL, ATLEAST };
64
65 QHelpSearchQuery()
66 : fieldName(DEFAULT) { wordList.clear(); }
67 QHelpSearchQuery(FieldName field, const QStringList &wordList_)
68 : fieldName(field), wordList(wordList_) {}
69
70 FieldName fieldName;
71 QStringList wordList;
72};
73
74class QHELP_EXPORT QHelpSearchResult
75{
76public:
77 QHelpSearchResult();
78 QHelpSearchResult(const QHelpSearchResult &other);
79 QHelpSearchResult(const QUrl &url, const QString &title, const QString &snippet);
80 ~QHelpSearchResult();
81
82 QHelpSearchResult &operator=(const QHelpSearchResult &other);
83
84 QString title() const;
85 QUrl url() const;
86 QString snippet() const;
87
88private:
89 QSharedDataPointer<QHelpSearchResultData> d;
90};
91
92class QHELP_EXPORT QHelpSearchEngine : public QObject
93{
94 Q_OBJECT
95
96public:
97 explicit QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent = nullptr);
98 ~QHelpSearchEngine();
99
100 QHelpSearchQueryWidget* queryWidget();
101 QHelpSearchResultWidget* resultWidget();
102
103#if QT_DEPRECATED_SINCE(5, 9)
104 typedef QPair<QString, QString> SearchHit;
105
106 QT_DEPRECATED int hitsCount() const;
107 QT_DEPRECATED int hitCount() const;
108 QT_DEPRECATED QList<SearchHit> hits(int start, int end) const;
109 QT_DEPRECATED QList<QHelpSearchQuery> query() const;
110#endif
111
112 int searchResultCount() const;
113 QVector<QHelpSearchResult> searchResults(int start, int end) const;
114 QString searchInput() const;
115
116public Q_SLOTS:
117 void reindexDocumentation();
118 void cancelIndexing();
119
120#if QT_DEPRECATED_SINCE(5, 9)
121 QT_DEPRECATED void search(const QList<QHelpSearchQuery> &queryList);
122#endif
123
124 void search(const QString &searchInput);
125 void cancelSearching();
126
127 void scheduleIndexDocumentation();
128
129Q_SIGNALS:
130 void indexingStarted();
131 void indexingFinished();
132
133 void searchingStarted();
134 void searchingFinished(int searchResultCount);
135
136private Q_SLOTS:
137 void indexDocumentation();
138
139private:
140 QHelpSearchEnginePrivate *d;
141};
142
143QT_END_NAMESPACE
144
145#endif // QHELPSEARCHENGINE_H
146

Warning: That file was not part of the compilation database. It may have many parsing errors.

source code of qttools/src/assistant/help/qhelpsearchengine.h