6#include "phosphorcontrol_export.h"
14#include <QtCore/qtclasshelpermacros.h>
52class PHOSPHORCONTROL_EXPORT ModuleContext
55 Q_DISABLE_COPY_MOVE(ModuleContext)
61 [[nodiscard]] QString
pageId(
const QString& localPageId)
const;
176 struct PageRegistration
179 QPointer<PageController> controller;
183 struct ExtensionRegistration
186 QPointer<StagingDomain> domain;
190 struct SearchProviderRegistration
192 ISearchProvider* provider =
nullptr;
194 QPointer<QObject> object;
195 bool isObject =
false;
200 [[nodiscard]] QString registeredAs(
const StagingDomain* domain)
const;
203 const ModuleMetadata& m_metadata;
204 QList<PageRegistration> m_pages;
205 QList<ExtensionRegistration> m_extensions;
206 QSet<QString> m_registeredPages;
207 QSet<QString> m_registeredExtensions;
208 QList<SearchProviderRegistration> m_searchProviders;
209 QList<QPointer<StagingDomain>> m_domains;
210 QStringList m_errors;
Pluggable configuration backend.
Definition IBackend.h:151
Source of dynamic (content) search entries — rules, shaders, layouts, virtual screens,...
Definition ISearchProvider.h:23
QString pageId(const QString &localPageId) const
The scoped id of the module's page localPageId.
bool registerPage(const QString &localPageId, PageController *controller, const QUrl &qmlSource)
Register the controller and QML page for the metadata page localPageId.
PhosphorConfig::IBackend * configBackend(const QString &path, const ConfigBackendFactory &create)
The config backend for the file at path, an absolute path, shared by every module that opens the same...
bool registerDomain(StagingDomain *domain)
Register a staging domain that has no page of its own, so it joins Apply, Discard and the dirty flag.
const ModuleMetadata & metadata() const
bool registerExtension(const QString &localExtensionId, StagingDomain *domain, const QUrl &qmlSource)
Register the section for the extension localExtensionId the metadata declares: its staging domain and...
friend class ModuleHost
Definition ModuleContext.h:173
std::function< std::unique_ptr< PhosphorConfig::IBackend >(const QString &path)> ConfigBackendFactory
Makes the backend of a config file.
Definition ModuleContext.h:128
bool registerSearchProvider(ISearchProvider *provider)
Register a dynamic search source, for content the metadata cannot list (rules, layouts,...
Hosts control modules in an ApplicationController.
Definition ModuleHost.h:131
Base class for a settings page: a staging domain backed by a QML page that appears in the sidebar.
Definition PageController.h:24
Abstract base for anything that holds staged user changes pending an Apply.
Definition StagingDomain.h:30
Definition HostDirectory.h:19
Definition ApplicationController.h:21