2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2010-06-11 13:11:37 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-06-11 13:11:37 +02:00
|
|
|
|
|
|
|
|
#ifndef HELPMANAGER_H
|
|
|
|
|
#define HELPMANAGER_H
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static QObject *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
|
|
|
|
2013-08-29 19:00:34 +02:00
|
|
|
static QMap<QString, QUrl> linksForKeyword(const QString &key);
|
|
|
|
|
static QMap<QString, QUrl> linksForIdentifier(const QString &id);
|
|
|
|
|
static QStringList findKeywords(const QString &key,
|
2013-08-01 10:14:10 +02:00
|
|
|
Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive,
|
2013-08-29 19:00:34 +02:00
|
|
|
int maxHits = INT_MAX);
|
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();
|
|
|
|
|
static void verifyDocumenation();
|
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
|
|
|
|
|
|
|
|
|
|
#endif // HELPMANAGER_H
|