1// qhelpenginecore.sip generated by MetaSIP
2//
3// This file is part of the QtHelp Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QHelpEngineCore : QObject
24{
25%TypeHeaderCode
26#include <qhelpenginecore.h>
27%End
28
29%ConvertToSubClassCode
30    static struct class_graph {
31        const char *name;
32        sipTypeDef **type;
33        int yes, no;
34    } graph[] = {
35        {sipName_QHelpContentModel, &sipType_QHelpContentModel, -1, 1},
36        {sipName_QHelpContentWidget, &sipType_QHelpContentWidget, -1, 2},
37        {sipName_QHelpEngineCore, &sipType_QHelpEngineCore, 10, 3},
38    #if QT_VERSION >= 0x050d00
39        {sipName_QHelpFilterEngine, &sipType_QHelpFilterEngine, -1, 4},
40    #else
41        {0, 0, -1, 4},
42    #endif
43    #if QT_VERSION >= 0x050f00
44        {sipName_QHelpFilterSettingsWidget, &sipType_QHelpFilterSettingsWidget, -1, 5},
45    #else
46        {0, 0, -1, 5},
47    #endif
48        {sipName_QHelpIndexModel, &sipType_QHelpIndexModel, -1, 6},
49        {sipName_QHelpIndexWidget, &sipType_QHelpIndexWidget, -1, 7},
50        {sipName_QHelpSearchEngine, &sipType_QHelpSearchEngine, -1, 8},
51        {sipName_QHelpSearchQueryWidget, &sipType_QHelpSearchQueryWidget, -1, 9},
52        {sipName_QHelpSearchResultWidget, &sipType_QHelpSearchResultWidget, -1, -1},
53        {sipName_QHelpEngine, &sipType_QHelpEngine, -1, -1},
54    };
55
56    int i = 0;
57
58    sipType = NULL;
59
60    do
61    {
62        struct class_graph *cg = &graph[i];
63
64        if (cg->name != NULL && sipCpp->inherits(cg->name))
65        {
66            sipType = *cg->type;
67            i = cg->yes;
68        }
69        else
70            i = cg->no;
71    }
72    while (i >= 0);
73%End
74
75public:
76    QHelpEngineCore(const QString &collectionFile, QObject *parent /TransferThis/ = 0);
77    virtual ~QHelpEngineCore();
78    bool setupData();
79    QString collectionFile() const;
80    void setCollectionFile(const QString &fileName);
81    bool copyCollectionFile(const QString &fileName);
82    static QString namespaceName(const QString &documentationFileName);
83    bool registerDocumentation(const QString &documentationFileName);
84    bool unregisterDocumentation(const QString &namespaceName);
85    QString documentationFileName(const QString &namespaceName);
86    QStringList customFilters() const;
87    bool removeCustomFilter(const QString &filterName);
88    bool addCustomFilter(const QString &filterName, const QStringList &attributes);
89    QStringList filterAttributes() const;
90    QStringList filterAttributes(const QString &filterName) const;
91    QString currentFilter() const;
92    void setCurrentFilter(const QString &filterName);
93    QStringList registeredDocumentations() const;
94    QList<QStringList> filterAttributeSets(const QString &namespaceName) const;
95    QList<QUrl> files(const QString namespaceName, const QStringList &filterAttributes, const QString &extensionFilter = QString());
96    QUrl findFile(const QUrl &url) const;
97    QByteArray fileData(const QUrl &url) const;
98    QMap<QString, QUrl> linksForIdentifier(const QString &id) const;
99%If (Qt_5_9_0 -)
100    QMap<QString, QUrl> linksForKeyword(const QString &keyword) const;
101%End
102    bool removeCustomValue(const QString &key);
103    QVariant customValue(const QString &key, const QVariant &defaultValue = QVariant()) const;
104    bool setCustomValue(const QString &key, const QVariant &value);
105    static QVariant metaData(const QString &documentationFileName, const QString &name);
106    QString error() const;
107    bool autoSaveFilter() const;
108    void setAutoSaveFilter(bool save);
109
110signals:
111    void setupStarted();
112    void setupFinished();
113    void currentFilterChanged(const QString &newFilter);
114    void warning(const QString &msg);
115%If (Qt_5_4_0 -)
116    void readersAboutToBeInvalidated();
117%End
118
119public:
120%If (Qt_5_13_0 -)
121    QHelpFilterEngine *filterEngine() const;
122%End
123%If (Qt_5_13_0 -)
124    QList<QUrl> files(const QString namespaceName, const QString &filterName, const QString &extensionFilter = QString());
125%End
126%If (Qt_5_13_0 -)
127    void setUsesFilterEngine(bool uses);
128%End
129%If (Qt_5_13_0 -)
130    bool usesFilterEngine() const;
131%End
132%If (Qt_5_15_0 -)
133    QList<QHelpLink> documentsForIdentifier(const QString &id) const;
134%End
135%If (Qt_5_15_0 -)
136    QList<QHelpLink> documentsForIdentifier(const QString &id, const QString &filterName) const;
137%End
138%If (Qt_5_15_0 -)
139    QList<QHelpLink> documentsForKeyword(const QString &keyword) const;
140%End
141%If (Qt_5_15_0 -)
142    QList<QHelpLink> documentsForKeyword(const QString &keyword, const QString &filterName) const;
143%End
144};
145