2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2018-08-31 16:00:32 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/helpmanager_implementation.h>
|
|
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QUrl)
|
|
|
|
|
|
|
|
|
|
#include <QFutureInterface>
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
|
|
namespace Help {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class HelpManager : public QObject, public Core::HelpManager::Implementation
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit HelpManager(QObject *parent = nullptr);
|
|
|
|
|
~HelpManager() override;
|
|
|
|
|
|
|
|
|
|
static HelpManager *instance();
|
|
|
|
|
static QString collectionFilePath();
|
|
|
|
|
|
|
|
|
|
void registerDocumentation(const QStringList &fileNames) override;
|
2019-10-04 16:01:36 +02:00
|
|
|
void unregisterDocumentation(const QStringList &fileNames) override;
|
2019-10-04 15:03:39 +02:00
|
|
|
|
|
|
|
|
static void unregisterNamespaces(const QStringList &nameSpaces);
|
2018-08-31 16:00:32 +02:00
|
|
|
|
|
|
|
|
static void registerUserDocumentation(const QStringList &filePaths);
|
|
|
|
|
static QSet<QString> userDocumentationPaths();
|
|
|
|
|
|
2019-10-16 13:28:28 +02:00
|
|
|
QMultiMap<QString, QUrl> linksForIdentifier(const QString &id) override;
|
|
|
|
|
QMultiMap<QString, QUrl> linksForKeyword(const QString &key) override;
|
2018-08-31 16:00:32 +02:00
|
|
|
|
|
|
|
|
static QUrl findFile(const QUrl &url);
|
|
|
|
|
QByteArray fileData(const QUrl &url) override;
|
|
|
|
|
|
|
|
|
|
static QStringList registeredNamespaces();
|
|
|
|
|
static QString namespaceFromFile(const QString &file);
|
|
|
|
|
static QString fileFromNamespace(const QString &nameSpace);
|
|
|
|
|
|
|
|
|
|
static void setCustomValue(const QString &key, const QVariant &value);
|
|
|
|
|
static QVariant customValue(const QString &key, const QVariant &value = QVariant());
|
|
|
|
|
|
|
|
|
|
static void aboutToShutdown();
|
|
|
|
|
|
2019-01-24 10:42:24 +01:00
|
|
|
Q_INVOKABLE void showHelpUrl(
|
2018-08-31 16:00:32 +02:00
|
|
|
const QUrl &url,
|
|
|
|
|
Core::HelpManager::HelpViewerLocation location = Core::HelpManager::HelpModeAlways) override;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void setupHelpManager();
|
|
|
|
|
static void registerDocumentationNow(QFutureInterface<bool> &futureInterface,
|
|
|
|
|
const QStringList &fileNames);
|
|
|
|
|
signals:
|
|
|
|
|
void collectionFileChanged();
|
|
|
|
|
void helpRequested(const QUrl &url, Core::HelpManager::HelpViewerLocation location);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Internal
|
|
|
|
|
} // Core
|