Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhelpengineplugin.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QHELPENGINEPLUGIN_H
6#define QHELPENGINEPLUGIN_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qobject.h>
20#include <QtCore/qplugin.h>
21#include <QtHelp/qhelpenginecore.h>
22#include <QtHelp/qhelplink.h>
23
24#include <QtQmlLS/private/qqmllshelpplugininterface_p.h>
25
26#include <optional>
27#include <vector>
28
29QT_BEGIN_NAMESPACE
30
31// TODO (Qt 7.0)
32// Remove this plugin from QtTools when the QtHelp lib is split into
33// QtHelpCore and QtHelp. Then QmlLS can depend only on QtHelpCore.
34class QQmlLSHelpProvider : public QQmlLSHelpProviderBase
35{
36public:
37 QQmlLSHelpProvider(const QString &qhcFile, QObject *parent = nullptr);
38 bool registerDocumentation(const QString &documentationFileName) override;
39 [[nodiscard]] QByteArray fileData(const QUrl &url) const override;
40 [[nodiscard]] std::vector<DocumentLink> documentsForIdentifier(const QString &id) const override;
41 [[nodiscard]] std::vector<DocumentLink> documentsForIdentifier(const QString &id, const QString &filterName) const override;
42 [[nodiscard]] std::vector<DocumentLink> documentsForKeyword(const QString &keyword) const override;
43 [[nodiscard]] std::vector<DocumentLink> documentsForKeyword(const QString &keyword, const QString &filterName) const override;
44 [[nodiscard]] QStringList registeredNamespaces() const override;
45 [[nodiscard]] QString error() const override;
46
47private:
48 std::optional<QHelpEngineCore> m_helpEngine;
49};
50
52{
53 Q_OBJECT
54 Q_PLUGIN_METADATA(IID QQmlLSHelpPluginInterface_iid)
56public:
59
62};
63
64QT_END_NAMESPACE
65
66#endif // QHELPENGINEPLUGIN_H