1// Copyright (C) 2020 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 QHELPFILTERSETTINGS_H
5#define QHELPFILTERSETTINGS_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the help generator tools. This header file may change from version
13// to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/QSharedDataPointer>
19
20QT_BEGIN_NAMESPACE
21
22template <class K, class T>
23class QMap;
24class QHelpFilterData;
25class QHelpFilterEngine;
26class QHelpFilterSettingsPrivate;
27
28class QHelpFilterSettings final
29{
30public:
31 QHelpFilterSettings();
32 QHelpFilterSettings(const QHelpFilterSettings &other);
33 QHelpFilterSettings(QHelpFilterSettings &&other);
34 ~QHelpFilterSettings();
35
36 QHelpFilterSettings &operator=(const QHelpFilterSettings &other);
37 QHelpFilterSettings &operator=(QHelpFilterSettings &&other);
38
39 void swap(QHelpFilterSettings &other) noexcept
40 { d.swap(other&: other.d); }
41
42 void setFilter(const QString &filterName, const QHelpFilterData &filterData);
43 void removeFilter(const QString &filterName);
44 QStringList filterNames() const;
45 QHelpFilterData filterData(const QString &filterName) const;
46 QMap<QString, QHelpFilterData> filters() const;
47
48 void setCurrentFilter(const QString &filterName);
49 QString currentFilter() const;
50
51 static QHelpFilterSettings readSettings(const QHelpFilterEngine *filterEngine);
52 static bool applySettings(QHelpFilterEngine *filterEngine, const QHelpFilterSettings &settings);
53
54private:
55 QSharedDataPointer<QHelpFilterSettingsPrivate> d;
56};
57
58QT_END_NAMESPACE
59
60#endif // QHELPFILTERSETTINGS_H
61

source code of qttools/src/assistant/help/qhelpfiltersettings_p.h