1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef OPENPAGESMODEL_H |
5 | #define OPENPAGESMODEL_H |
6 | |
7 | #include "openpagesmanager.h" |
8 | |
9 | #include <QtCore/QAbstractTableModel> |
10 | #include <QtCore/QList> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | class HelpViewer; |
15 | class QUrl; |
16 | |
17 | class OpenPagesModel : public QAbstractTableModel |
18 | { |
19 | Q_OBJECT |
20 | friend class OpenPagesManager; |
21 | public: |
22 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
23 | int columnCount(const QModelIndex &parent = QModelIndex()) const override; |
24 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; |
25 | |
26 | HelpViewer *addPage(const QUrl &url, qreal zoom = 0); |
27 | void removePage(int index); |
28 | HelpViewer *pageAt(int index) const; |
29 | |
30 | private slots: |
31 | void handleTitleChanged(); |
32 | |
33 | private: |
34 | OpenPagesModel(QObject *parent); |
35 | |
36 | private: |
37 | QList<HelpViewer *> m_pages; |
38 | }; |
39 | |
40 | QT_END_NAMESPACE |
41 | |
42 | #endif // OPENPAGESMODEL_H |
43 |