Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhelpenginecore.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QHELPENGINECORE_H
6#define QHELPENGINECORE_H
7
8#include <QtHelp/qhelp_global.h>
9#include <QtHelp/qhelpcontentitem.h>
10
11#if QT_CONFIG(future)
12#include <QtCore/qfuture.h>
13#endif
14
15#include <QtCore/qobject.h>
16#include <QtCore/qurl.h>
17#include <QtCore/qvariant.h>
18
20
22class QHelpFilterEngine;
23struct QHelpLink;
24
25class QHELP_EXPORT QHelpEngineCore : public QObject
26{
27 Q_OBJECT
28 Q_PROPERTY(bool autoSaveFilter READ autoSaveFilter WRITE setAutoSaveFilter)
29 Q_PROPERTY(QString collectionFile READ collectionFile WRITE setCollectionFile)
30 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
31#if QT_DEPRECATED_SINCE(5, 15)
32 Q_PROPERTY(QString currentFilter READ currentFilter WRITE setCurrentFilter)
33#endif
34
35public:
36 explicit QHelpEngineCore(const QString &collectionFile, QObject *parent = nullptr);
37 virtual ~QHelpEngineCore();
38
39 bool isReadOnly() const;
40 void setReadOnly(bool enable);
41
42 QHelpFilterEngine *filterEngine() const;
43
44 bool setupData();
45
46 QString collectionFile() const;
47 void setCollectionFile(const QString &fileName);
48
49 bool copyCollectionFile(const QString &fileName);
50
51 static QString namespaceName(const QString &documentationFileName);
52 bool registerDocumentation(const QString &documentationFileName);
53 bool unregisterDocumentation(const QString &namespaceName);
54 QString documentationFileName(const QString &namespaceName);
55 QStringList registeredDocumentations() const;
56 QByteArray fileData(const QUrl &url) const;
57
58// #if QT_DEPRECATED_SINCE(5,13)
59 QStringList customFilters() const;
60 bool removeCustomFilter(const QString &filterName);
61 bool addCustomFilter(const QString &filterName,
62 const QStringList &attributes);
63
64 QStringList filterAttributes() const;
65 QStringList filterAttributes(const QString &filterName) const;
66
67 QString currentFilter() const;
68 void setCurrentFilter(const QString &filterName);
69
70 QList<QStringList> filterAttributeSets(const QString &namespaceName) const;
71 QList<QUrl> files(const QString namespaceName, const QStringList &filterAttributes,
72 const QString &extensionFilter = {});
73// #endif
74
75 QList<QUrl> files(const QString namespaceName, const QString &filterName,
76 const QString &extensionFilter = {});
77 QUrl findFile(const QUrl &url) const;
78
79 QList<QHelpLink> documentsForIdentifier(const QString &id) const;
80 QList<QHelpLink> documentsForIdentifier(const QString &id, const QString &filterName) const;
81 QList<QHelpLink> documentsForKeyword(const QString &keyword) const;
82 QList<QHelpLink> documentsForKeyword(const QString &keyword, const QString &filterName) const;
83
84 bool removeCustomValue(const QString &key);
85 QVariant customValue(const QString &key, const QVariant &defaultValue = {}) const;
86 bool setCustomValue(const QString &key, const QVariant &value);
87
88 static QVariant metaData(const QString &documentationFileName, const QString &name);
89
90 QString error() const;
91
92 void setAutoSaveFilter(bool save);
93 bool autoSaveFilter() const;
94
95 void setUsesFilterEngine(bool uses);
96 bool usesFilterEngine() const;
97
98#if QT_CONFIG(future)
99 QFuture<std::shared_ptr<QHelpContentItem>> requestContentForCurrentFilter() const;
100 QFuture<std::shared_ptr<QHelpContentItem>> requestContent(const QString &filter) const;
101
102 QFuture<QStringList> requestIndexForCurrentFilter() const;
103 QFuture<QStringList> requestIndex(const QString &filter) const;
104#endif
105
106Q_SIGNALS:
107 void setupStarted();
108 void setupFinished();
109 void warning(const QString &msg);
110
111// #if QT_DEPRECATED_SINCE(5,13)
112 void currentFilterChanged(const QString &newFilter);
113 void readersAboutToBeInvalidated();
114// #endif
115
116protected:
117#if QT_DEPRECATED_SINCE(6, 8)
118 QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, QObject *parent);
119#endif
120
121private:
122 QHelpEngineCorePrivate *d;
123};
124
125QT_END_NAMESPACE
126
127#endif // QHELPENGINECORE_H
std::shared_ptr< QHelpContentItem > rootItem
\inmodule QtHelp
The QHelpEngineCore class provides the core functionality of the help system.
Combined button and popup list for selecting options.