| 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 | |
| 4 | #ifndef COLLECTIONCONFIGURATION_H |
| 5 | #define COLLECTIONCONFIGURATION_H |
| 6 | |
| 7 | #include <QtCore/QByteArray> |
| 8 | #include <QtCore/QCoreApplication> |
| 9 | #include <QtCore/QDateTime> |
| 10 | #include <QtCore/QString> |
| 11 | #include <QtCore/QStringList> |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | class QHelpEngineCore; |
| 16 | |
| 17 | class CollectionConfiguration |
| 18 | { |
| 19 | public: |
| 20 | static const QString windowTitle(const QHelpEngineCore &helpEngine); |
| 21 | static void setWindowTitle(QHelpEngineCore &helpEngine, |
| 22 | const QString &windowTitle); |
| 23 | |
| 24 | static const QString cacheDir(const QHelpEngineCore &helpEngine); |
| 25 | static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); |
| 26 | static void setCacheDir(QHelpEngineCore &helpEngine, |
| 27 | const QString &cacheDir, bool relativeToCollection); |
| 28 | |
| 29 | static uint creationTime(const QHelpEngineCore &helpEngine); |
| 30 | static void setCreationTime(QHelpEngineCore &helpEngine, uint time); |
| 31 | |
| 32 | static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); |
| 33 | static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, |
| 34 | bool enabled); |
| 35 | |
| 36 | static bool filterToolbarVisible(const QHelpEngineCore &helpEngine); |
| 37 | static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, |
| 38 | bool visible); |
| 39 | |
| 40 | static bool addressBarEnabled(const QHelpEngineCore &helpEngine); |
| 41 | static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled); |
| 42 | |
| 43 | static bool addressBarVisible(const QHelpEngineCore &helpEngine); |
| 44 | static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); |
| 45 | |
| 46 | |
| 47 | static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); |
| 48 | static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, |
| 49 | bool enabled); |
| 50 | |
| 51 | static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine); |
| 52 | static void setApplicationIcon(QHelpEngineCore &helpEngine, |
| 53 | const QByteArray &icon); |
| 54 | |
| 55 | // TODO: Encapsulate encoding from/to QByteArray here |
| 56 | static const QByteArray (const QHelpEngineCore &helpEngine); |
| 57 | static void (QHelpEngineCore &helpEngine, |
| 58 | const QByteArray &texts); |
| 59 | |
| 60 | static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine); |
| 61 | static void setAboutIcon(QHelpEngineCore &helpEngine, |
| 62 | const QByteArray &icon); |
| 63 | |
| 64 | // TODO: Encapsulate encoding from/to QByteArray here |
| 65 | static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine); |
| 66 | static void setAboutTexts(QHelpEngineCore &helpEngine, |
| 67 | const QByteArray &texts); |
| 68 | |
| 69 | static const QByteArray aboutImages(const QHelpEngineCore &helpEngine); |
| 70 | static void setAboutImages(QHelpEngineCore &helpEngine, |
| 71 | const QByteArray &images); |
| 72 | |
| 73 | static const QString defaultHomePage(const QHelpEngineCore &helpEngine); |
| 74 | static void setDefaultHomePage(QHelpEngineCore &helpEngine, |
| 75 | const QString &page); |
| 76 | |
| 77 | // TODO: Don't allow last pages and zoom factors to be set in isolation |
| 78 | // Perhaps also fill up missing elements automatically or assert. |
| 79 | static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); |
| 80 | static void setLastShownPages(QHelpEngineCore &helpEngine, |
| 81 | const QStringList &lastShownPages); |
| 82 | static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); |
| 83 | static void setLastZoomFactors(QHelpEngineCore &helPEngine, |
| 84 | const QStringList &lastZoomFactors); |
| 85 | |
| 86 | static int lastTabPage(const QHelpEngineCore &helpEngine); |
| 87 | static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); |
| 88 | |
| 89 | static bool isNewer(const QHelpEngineCore &newer, |
| 90 | const QHelpEngineCore &older); |
| 91 | static void copyConfiguration(const QHelpEngineCore &source, |
| 92 | QHelpEngineCore &target); |
| 93 | |
| 94 | /* |
| 95 | * Note that this only reflects register actions caused by the |
| 96 | * "-register" command line switch, not GUI or remote control actions. |
| 97 | */ |
| 98 | static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine); |
| 99 | static void updateLastRegisterTime(QHelpEngineCore &helpEngine, QDateTime dt); |
| 100 | static void updateLastRegisterTime(QHelpEngineCore &helpEngine); |
| 101 | |
| 102 | static bool fullTextSearchFallbackEnabled(const QHelpEngineCore &helpEngine); |
| 103 | static void setFullTextSearchFallbackEnabled(QHelpEngineCore &helpEngine, |
| 104 | bool on); |
| 105 | |
| 106 | static const QString DefaultZoomFactor; |
| 107 | static const QString ListSeparator; |
| 108 | }; |
| 109 | |
| 110 | QT_END_NAMESPACE |
| 111 | |
| 112 | #endif // COLLECTIONCONFIGURATION_H |
| 113 | |