Changeset View
Changeset View
Standalone View
Standalone View
src/core/loader_p.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org> | 2 | * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org> | ||
3 | * | 3 | * | ||
4 | * SPDX-License-Identifier: LGPL-2.1-or-later | 4 | * SPDX-License-Identifier: LGPL-2.1-or-later | ||
5 | */ | 5 | */ | ||
6 | #ifndef SONNET_LOADER_P_H | 6 | #ifndef SONNET_LOADER_P_H | ||
7 | #define SONNET_LOADER_P_H | 7 | #define SONNET_LOADER_P_H | ||
ervin: What's the reason for loader becoming public? If that's mostly out of convenience (it looks… | |||||
8 | 8 | | |||
9 | #include "sonnetcore_export.h" | 9 | #include "sonnetcore_export.h" | ||
10 | 10 | | |||
11 | #include <QObject> | 11 | #include <QObject> | ||
12 | #include <QStringList> | 12 | #include <QStringList> | ||
13 | #include <QString> | 13 | #include <QString> | ||
14 | #include <QSharedPointer> | 14 | #include <QSharedPointer> | ||
15 | 15 | | |||
16 | namespace Sonnet { | 16 | namespace Sonnet { | ||
17 | class Settings; | 17 | class SettingsImpl; | ||
18 | class SpellerPlugin; | 18 | class SpellerPlugin; | ||
19 | class LoaderPrivate; | 19 | class LoaderPrivate; | ||
20 | /** | 20 | /** | ||
21 | * \internal | 21 | * \internal | ||
22 | * @short Class used to deal with dictionaries | 22 | * @short Class used to deal with dictionaries | ||
23 | * | 23 | * | ||
24 | * This class manages all dictionaries. It's the top level | 24 | * This class manages all dictionaries. It's the top level | ||
25 | * Sonnet class, you can think of it as the kernel or manager | 25 | * Sonnet class, you can think of it as the kernel or manager | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 42 | public: | |||
98 | /** | 98 | /** | ||
99 | * @param langCode the dictionary name/language code, e.g. en_gb | 99 | * @param langCode the dictionary name/language code, e.g. en_gb | ||
100 | * @return the localized language name, e.g. "British English" | 100 | * @return the localized language name, e.g. "British English" | ||
101 | * @since 4.2 | 101 | * @since 4.2 | ||
102 | */ | 102 | */ | ||
103 | QString languageNameForCode(const QString &langCode) const; | 103 | QString languageNameForCode(const QString &langCode) const; | ||
104 | 104 | | |||
105 | /** | 105 | /** | ||
106 | * Returns the Settings object used by the loader. | 106 | * Returns the SettingsImpl object used by the loader. | ||
107 | */ | 107 | */ | ||
108 | Settings *settings() const; | 108 | SettingsImpl *settings() const; | ||
109 | Q_SIGNALS: | 109 | Q_SIGNALS: | ||
110 | /** | 110 | /** | ||
111 | * Signal is emitted whenever the Settings object | 111 | * Signal is emitted whenever the SettingsImpl object | ||
112 | * associated with this Loader changes. | 112 | * associated with this Loader changes. | ||
113 | */ | 113 | */ | ||
114 | void configurationChanged(); | 114 | void configurationChanged(); | ||
115 | 115 | | |||
116 | /** | 116 | /** | ||
117 | * Emitted when loading a dictionary fails, so that Ui parts can | 117 | * Emitted when loading a dictionary fails, so that Ui parts can | ||
118 | * display an appropriate error message informing the user about | 118 | * display an appropriate error message informing the user about | ||
119 | * the issue. | 119 | * the issue. | ||
120 | * @param language the name of the dictionary that failed to be loaded | 120 | * @param language the name of the dictionary that failed to be loaded | ||
121 | * @since 5.56 | 121 | * @since 5.56 | ||
122 | */ | 122 | */ | ||
123 | void loadingDictionaryFailed(const QString &language) const; | 123 | void loadingDictionaryFailed(const QString &language) const; | ||
124 | 124 | | |||
125 | protected: | 125 | protected: | ||
126 | friend class Settings; | 126 | friend class SettingsImpl; | ||
127 | void changed(); | 127 | void changed(); | ||
128 | private: | 128 | private: | ||
129 | void loadPlugins(); | 129 | void loadPlugins(); | ||
130 | void loadPlugin(const QString &pluginPath); | 130 | void loadPlugin(const QString &pluginPath); | ||
131 | private: | 131 | private: | ||
132 | LoaderPrivate *const d; | 132 | LoaderPrivate *const d; | ||
133 | }; | 133 | }; | ||
134 | } | 134 | } | ||
135 | 135 | | |||
136 | #endif // SONNET_LOADER_P_H | 136 | #endif // SONNET_LOADER_P_H |
What's the reason for loader becoming public? If that's mostly out of convenience (it looks like it is), I'd advise not turning it public, Settings and ConfigView can use it internally but let's not increase the API surface even more with Loader.