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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QHELPENGINECORE_H
#define QHELPENGINECORE_H
#include <QtHelp/qhelp_global.h>
#include <QtHelp/qhelpcontentitem.h>
#if QT_CONFIG(future)
#include <QtCore/qfuture.h>
#endif
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
QT_BEGIN_NAMESPACE
class QHelpEngineCorePrivate;
class QHelpFilterEngine;
struct QHelpLink;
class QHELP_EXPORT QHelpEngineCore : public QObject
{
Q_OBJECT
Q_PROPERTY(bool autoSaveFilter READ autoSaveFilter WRITE setAutoSaveFilter)
Q_PROPERTY(QString collectionFile READ collectionFile WRITE setCollectionFile)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
#if QT_DEPRECATED_SINCE(5, 15)
Q_PROPERTY(QString currentFilter READ currentFilter WRITE setCurrentFilter)
#endif
public:
explicit QHelpEngineCore(const QString &collectionFile, QObject *parent = nullptr);
virtual ~QHelpEngineCore();
bool isReadOnly() const;
void setReadOnly(bool enable);
QHelpFilterEngine *filterEngine() const;
bool setupData();
QString collectionFile() const;
void setCollectionFile(const QString &fileName);
bool copyCollectionFile(const QString &fileName);
static QString namespaceName(const QString &documentationFileName);
bool registerDocumentation(const QString &documentationFileName);
bool unregisterDocumentation(const QString &namespaceName);
QString documentationFileName(const QString &namespaceName);
QStringList registeredDocumentations() const;
QByteArray fileData(const QUrl &url) const;
// #if QT_DEPRECATED_SINCE(5,13)
QStringList customFilters() const;
bool removeCustomFilter(const QString &filterName);
bool addCustomFilter(const QString &filterName,
const QStringList &attributes);
QStringList filterAttributes() const;
QStringList filterAttributes(const QString &filterName) const;
QString currentFilter() const;
void setCurrentFilter(const QString &filterName);
QList<QStringList> filterAttributeSets(const QString &namespaceName) const;
QList<QUrl> files(const QString namespaceName, const QStringList &filterAttributes,
const QString &extensionFilter = {});
// #endif
QList<QUrl> files(const QString namespaceName, const QString &filterName,
const QString &extensionFilter = {});
QUrl findFile(const QUrl &url) const;
QList<QHelpLink> documentsForIdentifier(const QString &id) const;
QList<QHelpLink> documentsForIdentifier(const QString &id, const QString &filterName) const;
QList<QHelpLink> documentsForKeyword(const QString &keyword) const;
QList<QHelpLink> documentsForKeyword(const QString &keyword, const QString &filterName) const;
bool removeCustomValue(const QString &key);
QVariant customValue(const QString &key, const QVariant &defaultValue = {}) const;
bool setCustomValue(const QString &key, const QVariant &value);
static QVariant metaData(const QString &documentationFileName, const QString &name);
QString error() const;
void setAutoSaveFilter(bool save);
bool autoSaveFilter() const;
void setUsesFilterEngine(bool uses);
bool usesFilterEngine() const;
#if QT_CONFIG(future)
QFuture<std::shared_ptr<QHelpContentItem>> provideContentForCurrentFilter() const;
QFuture<std::shared_ptr<QHelpContentItem>> provideContent(const QString &filter) const;
QFuture<QStringList> provideIndexForCurrentFilter() const;
QFuture<QStringList> provideIndex(const QString &filter) const;
#endif
Q_SIGNALS:
void setupStarted();
void setupFinished();
void warning(const QString &msg);
// #if QT_DEPRECATED_SINCE(5,13)
void currentFilterChanged(const QString &newFilter);
void readersAboutToBeInvalidated();
// #endif
protected:
#if QT_DEPRECATED_SINCE(6, 8)
QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, QObject *parent);
#endif
private:
QHelpEngineCorePrivate *d;
};
QT_END_NAMESPACE
#endif // QHELPENGINECORE_H
|