1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Assistant of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef COLLECTIONCONFIGURATION_H
41#define COLLECTIONCONFIGURATION_H
42
43#include <QtCore/QByteArray>
44#include <QtCore/QCoreApplication>
45#include <QtCore/QDateTime>
46#include <QtCore/QString>
47#include <QtCore/QStringList>
48
49QT_BEGIN_NAMESPACE
50
51class QHelpEngineCore;
52
53class CollectionConfiguration
54{
55public:
56 static const QString windowTitle(const QHelpEngineCore &helpEngine);
57 static void setWindowTitle(QHelpEngineCore &helpEngine,
58 const QString &windowTitle);
59
60 static const QString cacheDir(const QHelpEngineCore &helpEngine);
61 static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine);
62 static void setCacheDir(QHelpEngineCore &helpEngine,
63 const QString &cacheDir, bool relativeToCollection);
64
65 static uint creationTime(const QHelpEngineCore &helpEngine);
66 static void setCreationTime(QHelpEngineCore &helpEngine, uint time);
67
68 static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine);
69 static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine,
70 bool enabled);
71
72 static bool filterToolbarVisible(const QHelpEngineCore &helpEngine);
73 static void setFilterToolbarVisible(QHelpEngineCore &helpEngine,
74 bool visible);
75
76 static bool addressBarEnabled(const QHelpEngineCore &helpEngine);
77 static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled);
78
79 static bool addressBarVisible(const QHelpEngineCore &helpEngine);
80 static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible);
81
82
83 static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine);
84 static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine,
85 bool enabled);
86
87 static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine);
88 static void setApplicationIcon(QHelpEngineCore &helpEngine,
89 const QByteArray &icon);
90
91 // TODO: Encapsulate encoding from/to QByteArray here
92 static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine);
93 static void setAboutMenuTexts(QHelpEngineCore &helpEngine,
94 const QByteArray &texts);
95
96 static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine);
97 static void setAboutIcon(QHelpEngineCore &helpEngine,
98 const QByteArray &icon);
99
100 // TODO: Encapsulate encoding from/to QByteArray here
101 static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine);
102 static void setAboutTexts(QHelpEngineCore &helpEngine,
103 const QByteArray &texts);
104
105 static const QByteArray aboutImages(const QHelpEngineCore &helpEngine);
106 static void setAboutImages(QHelpEngineCore &helpEngine,
107 const QByteArray &images);
108
109 static const QString defaultHomePage(const QHelpEngineCore &helpEngine);
110 static void setDefaultHomePage(QHelpEngineCore &helpEngine,
111 const QString &page);
112
113 // TODO: Don't allow last pages and zoom factors to be set in isolation
114 // Perhaps also fill up missing elements automatically or assert.
115 static const QStringList lastShownPages(const QHelpEngineCore &helpEngine);
116 static void setLastShownPages(QHelpEngineCore &helpEngine,
117 const QStringList &lastShownPages);
118 static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine);
119 static void setLastZoomFactors(QHelpEngineCore &helPEngine,
120 const QStringList &lastZoomFactors);
121
122 static int lastTabPage(const QHelpEngineCore &helpEngine);
123 static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage);
124
125 static bool isNewer(const QHelpEngineCore &newer,
126 const QHelpEngineCore &older);
127 static void copyConfiguration(const QHelpEngineCore &source,
128 QHelpEngineCore &target);
129
130 /*
131 * Note that this only reflects register actions caused by the
132 * "-register" command line switch, not GUI or remote control actions.
133 */
134 static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine);
135 static void updateLastRegisterTime(QHelpEngineCore &helpEngine, QDateTime dt);
136 static void updateLastRegisterTime(QHelpEngineCore &helpEngine);
137
138 static bool fullTextSearchFallbackEnabled(const QHelpEngineCore &helpEngine);
139 static void setFullTextSearchFallbackEnabled(QHelpEngineCore &helpEngine,
140 bool on);
141
142 static const QString DefaultZoomFactor;
143 static const QString ListSeparator;
144};
145
146QT_END_NAMESPACE
147
148#endif // COLLECTIONCONFIGURATION_H
149

source code of qttools/src/assistant/shared/collectionconfiguration.h