2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-03-29 14:57:02 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-03-29 14:57:02 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-03-29 14:57:02 +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-03-29 14:57:02 +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-03-29 14:57:02 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-03-29 14:57:02 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QComboBox)
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QListView)
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QModelIndex)
|
2010-08-16 15:25:27 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QPoint)
|
2010-03-29 14:57:02 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QUrl)
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
|
|
|
|
|
|
|
|
|
namespace Help {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-03-29 19:16:23 +02:00
|
|
|
class HelpViewer;
|
2010-03-29 14:57:02 +02:00
|
|
|
class OpenPagesModel;
|
2010-04-12 16:43:23 +02:00
|
|
|
class OpenPagesSwitcher;
|
2010-04-12 14:55:41 +02:00
|
|
|
class OpenPagesWidget;
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
class OpenPagesManager : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
OpenPagesManager(QObject *parent = 0);
|
2010-04-12 14:55:41 +02:00
|
|
|
~OpenPagesManager();
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
static OpenPagesManager &instance();
|
|
|
|
|
|
2010-04-12 14:39:23 +02:00
|
|
|
QWidget *openPagesWidget() const;
|
|
|
|
|
QComboBox *openPagesComboBox() const;
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
int pageCount() const;
|
|
|
|
|
void setupInitialPages();
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
HelpViewer *createPage();
|
2014-10-31 14:20:03 +01:00
|
|
|
HelpViewer *createPage(const QUrl &url);
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
void setCurrentPage(int index);
|
|
|
|
|
void setCurrentPage(const QModelIndex &index);
|
|
|
|
|
|
|
|
|
|
void closeCurrentPage();
|
|
|
|
|
void closePage(const QModelIndex &index);
|
|
|
|
|
void closePagesExcept(const QModelIndex &index);
|
|
|
|
|
|
2010-04-12 14:55:41 +02:00
|
|
|
void gotoNextPage();
|
|
|
|
|
void gotoPreviousPage();
|
|
|
|
|
|
2010-03-29 14:57:02 +02:00
|
|
|
signals:
|
|
|
|
|
void pagesChanged();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void removePage(int index);
|
2010-04-12 14:55:41 +02:00
|
|
|
void showTwicherOrSelectPage() const;
|
2010-03-29 14:57:02 +02:00
|
|
|
|
2010-08-16 15:25:27 +02:00
|
|
|
private slots:
|
|
|
|
|
void openPagesContextMenu(const QPoint &point);
|
|
|
|
|
|
2010-03-29 14:57:02 +02:00
|
|
|
private:
|
|
|
|
|
QComboBox *m_comboBox;
|
|
|
|
|
OpenPagesModel *m_model;
|
2010-09-15 11:02:45 +02:00
|
|
|
mutable OpenPagesWidget *m_openPagesWidget;
|
2010-04-12 16:43:23 +02:00
|
|
|
OpenPagesSwitcher *m_openPagesSwitcher;
|
2010-03-29 14:57:02 +02:00
|
|
|
|
|
|
|
|
static OpenPagesManager *m_instance;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Help
|