Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
Phosphor::Shortcuts::Integration::IAdhocRegistrar Class Referenceabstract

Reduced-surface registrar interface for subsystems that need to bind a transient shortcut while a specific UI state is active (e.g. More...

#include <phosphor-shortcuts/include/PhosphorShortcuts/IAdhocRegistrar.h>

Public Member Functions

virtual ~IAdhocRegistrar ()=default
 
virtual void registerAdhocShortcut (const QString &id, const QKeySequence &sequence, const QString &description, std::function< void()> callback)=0
 Register an ad-hoc shortcut that lives outside any settings-driven binding table.
 
virtual void unregisterAdhocShortcut (const QString &id)=0
 Release a shortcut previously bound via registerAdhocShortcut().
 

Detailed Description

Reduced-surface registrar interface for subsystems that need to bind a transient shortcut while a specific UI state is active (e.g.

an Escape cancel grab held only during a window drag) without taking a hard dependency on the concrete shortcut-manager type that owns the Registry.

Lives in the Integration sub-namespace rather than directly under Phosphor::Shortcuts to make the split explicit: the library (Registry, IBackend, the concrete backends) is the shortcut machinery itself; Integration is the set of contracts consumers implement to plug their own glue into that machinery. The library provides no implementation of IAdhocRegistrar — each consumer wires its own "shortcut manager" object to the underlying Registry, with whatever bind-flow + flush ordering its app needs (the PlasmaZones implementation, for example, queues adhoc registrations that arrive during the initial settings-driven batch and drains them once the Portal BindShortcuts Response lands).

Pure abstract C++; no QObject inheritance, no Qt signals — keeps the interface usable from non-QObject consumers.

Constructor & Destructor Documentation

◆ ~IAdhocRegistrar()

virtual Phosphor::Shortcuts::Integration::IAdhocRegistrar::~IAdhocRegistrar ( )
virtualdefault

Member Function Documentation

◆ registerAdhocShortcut()

virtual void Phosphor::Shortcuts::Integration::IAdhocRegistrar::registerAdhocShortcut ( const QString &  id,
const QKeySequence &  sequence,
const QString &  description,
std::function< void()>  callback 
)
pure virtual

Register an ad-hoc shortcut that lives outside any settings-driven binding table.

Implementations forward this to a Registry::bind() with persistent=false (so the binding is excluded from KCM-style enumerations) followed by an immediate flush().

Idempotent — a second call with the same id should replace the callback and description in place.

◆ unregisterAdhocShortcut()

virtual void Phosphor::Shortcuts::Integration::IAdhocRegistrar::unregisterAdhocShortcut ( const QString &  id)
pure virtual

Release a shortcut previously bound via registerAdhocShortcut().

Idempotent — unknown ids are silently ignored.

Subject to the per-backend release semantics documented on IBackend::unregisterShortcut (Portal cannot release a single id; KGlobalAccel and DBusTrigger release cleanly).


The documentation for this class was generated from the following file: