Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ContextResolver.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "IContextInputs.h"
7#include "IContextResolver.h"
8#include "phosphorcontextresolver_export.h"
9
10namespace PhosphorContext {
11
29class PHOSPHORCONTEXTRESOLVER_EXPORT ContextResolver : public IContextResolver
30{
31public:
40 ContextResolver(IWorkspaceState* workspaceState, IModeProvider* modeProvider, IContextGateSource* gateSource);
41 ~ContextResolver() override = default;
42
43 // IContextResolver
44 ContextHandle handleFor(const QString& screenId) const override;
45 ContextHandle globalHandle() const override;
46 ContextHandle handleForMode(const QString& screenId, PhosphorZones::AssignmentEntry::Mode mode) const override;
47 ContextHandle handleForPersisted(const QString& screenId, int virtualDesktop,
48 const QString& activity) const override;
49 int currentVirtualDesktop() const override;
50 QString currentActivity() const override;
51 DisabledReason disabledReason(const ContextHandle& handle) const override;
52 bool isLocked(const ContextHandle& handle) const override;
53
54private:
55 IWorkspaceState* m_workspaceState;
56 IModeProvider* m_modeProvider;
57 IContextGateSource* m_gateSource;
58};
59
60} // namespace PhosphorContext
ContextHandle handleFor(const QString &screenId) const override
Build a frozen handle targeting screenId.
ContextResolver(IWorkspaceState *workspaceState, IModeProvider *modeProvider, IContextGateSource *gateSource)
Bind the resolver to its three adapter inputs.
ContextHandle globalHandle() const override
Build a handle without a screen scope.
DisabledReason disabledReason(const ContextHandle &handle) const override
The disable cascade — Monitor → Desktop → Activity, in priority order.
ContextHandle handleForMode(const QString &screenId, PhosphorZones::AssignmentEntry::Mode mode) const override
Build a handle that overrides the mode resolution.
int currentVirtualDesktop() const override
Live read of the workspace's current virtual desktop, equivalent to calling the bound IWorkspaceState...
bool isLocked(const ContextHandle &handle) const override
The per-context lock check.
QString currentActivity() const override
Live read of the workspace's current activity, equivalent to calling the bound IWorkspaceState::curre...
ContextHandle handleForPersisted(const QString &screenId, int virtualDesktop, const QString &activity) const override
Build a handle for a PERSISTED context (not "right now").
~ContextResolver() override=default
Disable / lock cascade adapter.
Definition IContextInputs.h:126
The single resolver façade every Phosphor consumer goes through for "what does this screen look like ...
Definition IContextResolver.h:79
Per-screen mode dispatcher adapter.
Definition IContextInputs.h:90
Adapter interfaces the concrete ContextResolver depends on.
Definition IContextInputs.h:48
Definition ContextHandle.h:10
DisabledReason
Why a context is considered disabled, in priority order.
Definition DisabledReason.h:20
Frozen snapshot of "where am I right now?" for a single resolver query.
Definition ContextHandle.h:46
Mode
Per-context engine selection.
Definition AssignmentEntry.h:213