| 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 QHELPDATAINTERFACE_H |
| 5 | #define QHELPDATAINTERFACE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of the help generator tools. This header file may change from version |
| 13 | // to version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtCore/QSharedData> |
| 19 | #include <QtCore/QStringList> |
| 20 | #include <QtCore/QVariant> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QHelpDataContentItem |
| 25 | { |
| 26 | public: |
| 27 | QHelpDataContentItem(QHelpDataContentItem *parent, const QString &title, |
| 28 | const QString &reference); |
| 29 | ~QHelpDataContentItem(); |
| 30 | |
| 31 | QString title() const; |
| 32 | QString reference() const; |
| 33 | QList<QHelpDataContentItem*> children() const; |
| 34 | |
| 35 | private: |
| 36 | QString m_title; |
| 37 | QString m_reference; |
| 38 | QList<QHelpDataContentItem*> m_children; |
| 39 | }; |
| 40 | |
| 41 | struct QHelpDataIndexItem { |
| 42 | QHelpDataIndexItem() {} |
| 43 | QHelpDataIndexItem(const QString &n, const QString &id, const QString &r) |
| 44 | : name(n), identifier(id), reference(r) {} |
| 45 | |
| 46 | QString name; |
| 47 | QString identifier; |
| 48 | QString reference; |
| 49 | |
| 50 | bool operator==(const QHelpDataIndexItem & other) const; |
| 51 | }; |
| 52 | |
| 53 | class QHelpDataFilterSectionData : public QSharedData |
| 54 | { |
| 55 | public: |
| 56 | ~QHelpDataFilterSectionData() |
| 57 | { |
| 58 | qDeleteAll(c: contents); |
| 59 | } |
| 60 | |
| 61 | QStringList filterAttributes; |
| 62 | QList<QHelpDataIndexItem> indices; |
| 63 | QList<QHelpDataContentItem*> contents; |
| 64 | QStringList files; |
| 65 | }; |
| 66 | |
| 67 | class QHelpDataFilterSection |
| 68 | { |
| 69 | public: |
| 70 | QHelpDataFilterSection(); |
| 71 | |
| 72 | void addFilterAttribute(const QString &filter); |
| 73 | QStringList filterAttributes() const; |
| 74 | |
| 75 | void addIndex(const QHelpDataIndexItem &index); |
| 76 | void setIndices(const QList<QHelpDataIndexItem> &indices); |
| 77 | QList<QHelpDataIndexItem> indices() const; |
| 78 | |
| 79 | void addContent(QHelpDataContentItem *content); |
| 80 | void setContents(const QList<QHelpDataContentItem*> &contents); |
| 81 | QList<QHelpDataContentItem*> contents() const; |
| 82 | |
| 83 | void addFile(const QString &file); |
| 84 | void setFiles(const QStringList &files); |
| 85 | QStringList files() const; |
| 86 | |
| 87 | private: |
| 88 | QSharedDataPointer<QHelpDataFilterSectionData> d; |
| 89 | }; |
| 90 | |
| 91 | struct QHelpDataCustomFilter { |
| 92 | QStringList filterAttributes; |
| 93 | QString name; |
| 94 | }; |
| 95 | |
| 96 | QT_END_NAMESPACE |
| 97 | |
| 98 | #endif // QHELPDATAINTERFACE_H |
| 99 |
