aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/help/openpagesmanager.h
blob: 8cd6478e61f56c521403aed42d753708690af5e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// 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

#pragma once

#include <QObject>

QT_BEGIN_NAMESPACE
class QAbstractItemModel;
class QComboBox;
class QListView;
class QModelIndex;
class QPoint;
class QUrl;
class QWidget;
QT_END_NAMESPACE

namespace Help {
namespace Internal {

class HelpWidget;
class HelpViewer;
class OpenPagesSwitcher;
class OpenPagesWidget;

class OpenPagesManager : public QObject
{
    Q_OBJECT

public:
    OpenPagesManager(HelpWidget *helpWidget);
    ~OpenPagesManager() override;

    QWidget *openPagesWidget() const;
    QComboBox *openPagesComboBox() const;

    void setupInitialPages();

    void closeCurrentPage();
    void closePage(const QModelIndex &index);
    void closePagesExcept(const QModelIndex &index);

    void gotoNextPage();
    void gotoPreviousPage();

private:
    void removePage(int index);
    void showTwicherOrSelectPage() const;
    void openPagesContextMenu(const QPoint &point);

    QComboBox *m_comboBox = nullptr;
    HelpWidget *m_helpWidget = nullptr;
    mutable OpenPagesWidget *m_openPagesWidget = nullptr;
    OpenPagesSwitcher *m_openPagesSwitcher = nullptr;
};

} // namespace Internal
} // namespace Help