13#include "phosphorshortcuts_export.h"
31class PHOSPHORSHORTCUTS_EXPORT
IBackend :
public QObject
83 virtual void registerShortcut(
const QString&
id,
const QKeySequence& defaultSeq,
const QKeySequence& currentSeq,
84 const QString& description,
bool persistent =
true) = 0;
103 virtual void updateShortcut(
const QString&
id,
const QKeySequence& defaultSeq,
const QKeySequence& newTrigger) = 0;
274 const QList<QKeySequence>& sequences)
276 Q_UNUSED(componentName);
277 Q_UNUSED(actionName);
306 const QString& actionName)
const
308 Q_UNUSED(componentName);
309 Q_UNUSED(actionName);
virtual std::optional< QStringList > currentTriggers(const QString &id) const
The key sequence(s) the backend believes are EFFECTIVELY bound for an id right now — i....
Definition IBackend.h:255
virtual std::optional< QStringList > storedShortcutIds() const
Every id the platform holds a persistent record for under this process's component,...
Definition IBackend.h:186
void ready()
Emitted after flush() completes.
void activated(QString id)
Emitted when the backend observes the user triggering a registered shortcut.
virtual bool suspendReleasesGrab() const
Whether suspendShortcut() and unregisterShortcut() actually release the key grab.
Definition IBackend.h:198
IBackend(QObject *parent=nullptr)
Definition IBackend.h:35
virtual void registerShortcut(const QString &id, const QKeySequence &defaultSeq, const QKeySequence ¤tSeq, const QString &description, bool persistent=true)=0
Register a new shortcut id.
virtual void suspendShortcut(const QString &id)
Release the key grab for an id WITHOUT destroying whatever the platform persists about it.
Definition IBackend.h:140
virtual bool setForeignShortcuts(const QString &componentName, const QString &actionName, const QList< QKeySequence > &sequences)
Rebind ANOTHER component's global shortcut (kglobalaccel's setForeignShortcutKeys,...
Definition IBackend.h:273
virtual void storeShortcut(const QString &id, const QKeySequence &seq)
Write seq into the platform's persistent record for an id that this backend does not currently hold (...
Definition IBackend.h:159
virtual bool registersUnboundIds() const
Whether an id with an empty current sequence must still be registered.
Definition IBackend.h:210
virtual void forgetShortcut(const QString &id)
Delete the platform's persistent record for an id, releasing any grab that record still holds.
Definition IBackend.h:175
virtual std::optional< QList< QKeySequence > > foreignShortcuts(const QString &componentName, const QString &actionName) const
The current bindings of another component's action, every sequence it answers to, in the order the bi...
Definition IBackend.h:305
virtual void updateShortcut(const QString &id, const QKeySequence &defaultSeq, const QKeySequence &newTrigger)=0
Change the active binding for an already-registered id.
virtual void unregisterShortcut(const QString &id)=0
Release the key grab for an id.
virtual void flush()=0
Commit any queued register/update ops.
void triggersChanged(QString id)
Emitted when the effective binding for an id changes outside the register/update flow — e....
~IBackend() override=default