#pragma once #include class VisibilityController; // Session-bus remote control, e.g. for a global shortcut: // qdbus org.sloposk.Keyboard /Keyboard org.sloposk.Keyboard.Toggle class DBusControl : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.sloposk.Keyboard") public: explicit DBusControl(VisibilityController &visibility, QObject *parent = nullptr); // False if the bus is unavailable or another instance owns the name. bool registerOnSessionBus(); public Q_SLOTS: Q_SCRIPTABLE void Show(); Q_SCRIPTABLE void Hide(); Q_SCRIPTABLE void Toggle(); private: VisibilityController &m_visibility; };