2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-06-11 13:11:37 +02:00
|
|
|
|
|
|
|
|
#include "core_global.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
#include <QMap>
|
|
|
|
|
#include <QHash>
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2010-09-16 12:26:28 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QUrl)
|
2010-06-11 13:11:37 +02:00
|
|
|
|
|
|
|
|
namespace Core {
|
2010-09-16 12:26:28 +02:00
|
|
|
struct HelpManagerPrivate;
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2012-02-02 10:47:33 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
class CorePlugin;
|
2013-06-25 13:37:21 +02:00
|
|
|
class MainWindow;
|
2012-02-02 10:47:33 +01:00
|
|
|
}
|
|
|
|
|
|
2010-06-11 13:11:37 +02:00
|
|
|
class CORE_EXPORT HelpManager : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2014-06-20 17:24:18 +02:00
|
|
|
enum HelpViewerLocation {
|
|
|
|
|
SideBySideIfPossible = 0,
|
|
|
|
|
SideBySideAlways = 1,
|
|
|
|
|
HelpModeAlways = 2,
|
|
|
|
|
ExternalHelpAlways = 3
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-02 16:30:56 +02:00
|
|
|
typedef QHash<QString, QStringList> Filters;
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2014-12-11 18:10:25 +01:00
|
|
|
static HelpManager *instance();
|
2010-06-11 13:11:37 +02:00
|
|
|
static QString collectionFilePath();
|
|
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static void registerDocumentation(const QStringList &fileNames);
|
|
|
|
|
static void unregisterDocumentation(const QStringList &nameSpaces);
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2014-12-02 17:51:14 +01:00
|
|
|
static void registerUserDocumentation(const QStringList &filePaths);
|
|
|
|
|
static QSet<QString> userDocumentationPaths();
|
|
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static QMap<QString, QUrl> linksForKeyword(const QString &key);
|
|
|
|
|
static QMap<QString, QUrl> linksForIdentifier(const QString &id);
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static QUrl findFile(const QUrl &url);
|
|
|
|
|
static QByteArray fileData(const QUrl &url);
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static QStringList registeredNamespaces();
|
|
|
|
|
static QString namespaceFromFile(const QString &file);
|
|
|
|
|
static QString fileFromNamespace(const QString &nameSpace);
|
2010-06-11 13:11:37 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static void setCustomValue(const QString &key, const QVariant &value);
|
|
|
|
|
static QVariant customValue(const QString &key, const QVariant &value = QVariant());
|
2010-08-02 16:30:56 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static Filters filters();
|
|
|
|
|
static Filters fixedFilters();
|
2010-08-02 16:30:56 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static Filters userDefinedFilters();
|
|
|
|
|
static void removeUserDefinedFilter(const QString &filter);
|
|
|
|
|
static void addUserDefinedFilter(const QString &filter, const QStringList &attr);
|
2010-08-02 16:30:56 +02:00
|
|
|
|
2011-02-24 14:58:37 +01:00
|
|
|
public slots:
|
2014-06-20 17:24:18 +02:00
|
|
|
static void handleHelpRequest(const QUrl &url,
|
|
|
|
|
Core::HelpManager::HelpViewerLocation location = HelpModeAlways);
|
|
|
|
|
static void handleHelpRequest(const QString &url,
|
|
|
|
|
Core::HelpManager::HelpViewerLocation location = HelpModeAlways);
|
2011-02-24 14:58:37 +01:00
|
|
|
|
2010-06-11 13:11:37 +02:00
|
|
|
signals:
|
|
|
|
|
void setupFinished();
|
|
|
|
|
void documentationChanged();
|
2010-08-02 16:30:56 +02:00
|
|
|
void collectionFileChanged();
|
2014-06-20 17:24:18 +02:00
|
|
|
void helpRequested(const QUrl &url, Core::HelpManager::HelpViewerLocation location);
|
2010-06-11 13:11:37 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-06-25 13:37:21 +02:00
|
|
|
explicit HelpManager(QObject *parent = 0);
|
2013-08-29 19:00:34 +02:00
|
|
|
~HelpManager();
|
2013-06-25 13:37:21 +02:00
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static void setupHelpManager();
|
2013-06-25 13:37:21 +02:00
|
|
|
friend class Core::Internal::CorePlugin; // setupHelpManager
|
|
|
|
|
friend class Core::Internal::MainWindow; // constructor/destructor
|
2010-06-11 13:11:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Core
|