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
4#ifndef QHELPENGINEPLUGIN_H
5#define QHELPENGINEPLUGIN_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 purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19#include <QtCore/qplugin.h>
20#include <QtHelp/qhelpenginecore.h>
21#include <QtHelp/qhelplink.h>
22
23#include <QtQmlLS/private/qqmllshelpplugininterface_p.h>
24
25#include <optional>
26#include <vector>
27
28QT_BEGIN_NAMESPACE
29
30// TODO (Qt 7.0)
31// Remove this plugin from QtTools when the QtHelp lib is split into
32// QtHelpCore and QtHelp. Then QmlLS can depend only on QtHelpCore.
33class QQmlLSHelpProvider : public QQmlLSHelpProviderBase
34{
35public:
36 QQmlLSHelpProvider(const QString &qhcFile, QObject *parent = nullptr);
37 bool registerDocumentation(const QString &documentationFileName) override;
38 [[nodiscard]] QByteArray fileData(const QUrl &url) const override;
39 [[nodiscard]] std::vector<DocumentLink> documentsForIdentifier(const QString &id) const override;
40 [[nodiscard]] std::vector<DocumentLink> documentsForIdentifier(const QString &id, const QString &filterName) const override;
41 [[nodiscard]] std::vector<DocumentLink> documentsForKeyword(const QString &keyword) const override;
42 [[nodiscard]] std::vector<DocumentLink> documentsForKeyword(const QString &keyword, const QString &filterName) const override;
43 [[nodiscard]] QStringList registeredNamespaces() const override;
44 [[nodiscard]] QString error() const override;
45
46private:
47 std::optional<QHelpEngineCore> m_helpEngine;
48};
49
51{
52 Q_OBJECT
53 Q_PLUGIN_METADATA(IID QQmlLSHelpPluginInterface_iid)
55public:
58
61};
62
63QT_END_NAMESPACE
64
65#endif // QHELPENGINEPLUGIN_H