1// Copyright (C) 2018 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
4#ifndef COLLECTIONCONFIGREADER_H
5#define COLLECTIONCONFIGREADER_H
6
7#include <QtCore/QMap>
8#include <QtCore/QObject>
9#include <QtCore/QXmlStreamReader>
10
11QT_USE_NAMESPACE
12
13class CollectionConfigReader : public QXmlStreamReader
14{
15public:
16 void readData(const QByteArray &contents);
17
18 QString title() const { return m_title; }
19 QString homePage() const { return m_homePage; }
20 QString startPage() const { return m_startPage; }
21 QString applicationIcon() const { return m_applicationIcon; }
22 QString currentFilter() const { return m_currentFilter; }
23 bool enableFilterFunctionality() const
24 { return m_enableFilterFunctionality; }
25 bool hideFilterFunctionality() const
26 { return m_hideFilterFunctionality; }
27 bool enableAddressBar() const { return m_enableAddressBar; }
28 bool hideAddressBar() const { return m_hideAddressBar; }
29 bool enableDocumentationManager() const
30 { return m_enableDocumentationManager; }
31
32 QMap<QString, QString> aboutMenuTexts() const
33 { return m_aboutMenuTexts; }
34 QString aboutIcon() const { return m_aboutIcon; }
35 QMap<QString, QString> aboutTextFiles() const
36 { return m_aboutTextFiles; }
37
38 QMap<QString, QString> filesToGenerate() const
39 { return m_filesToGenerate; }
40
41 QStringList filesToRegister() const { return m_filesToRegister; }
42
43 QString cacheDirectory() const { return m_cacheDirectory; }
44 bool cacheDirRelativeToCollection() const { return m_cacheDirRelativeToCollection; }
45
46 bool fullTextSearchFallbackEnabled() const {
47 return m_enableFullTextSearchFallback;
48 }
49
50private:
51 void raiseErrorWithLine();
52 void readConfig();
53 void readAssistantSettings();
54 void readMenuTexts();
55 void readAboutDialog();
56 void readDocFiles();
57 void readGenerate();
58 void readFiles();
59 void readRegister();
60
61 QMap<QString, QString> m_aboutMenuTexts;
62 QMap<QString, QString> m_aboutTextFiles;
63 QMap<QString, QString> m_filesToGenerate;
64 QStringList m_filesToRegister;
65 QString m_title;
66 QString m_homePage;
67 QString m_startPage;
68 QString m_applicationIcon;
69 QString m_currentFilter;
70 QString m_aboutIcon;
71 QString m_cacheDirectory;
72 bool m_enableFilterFunctionality;
73 bool m_hideFilterFunctionality;
74 bool m_enableAddressBar;
75 bool m_hideAddressBar;
76 bool m_enableDocumentationManager;
77 bool m_cacheDirRelativeToCollection;
78 bool m_enableFullTextSearchFallback;
79};
80
81#endif
82

source code of qttools/src/assistant/qhelpgenerator/collectionconfigreader.h