6#include <PhosphorServiceSession/phosphorservicesession_export.h>
35class PHOSPHORSERVICESESSION_EXPORT
SessionHost :
public QObject
50 Q_PROPERTY(Availability canPowerOff READ canPowerOff NOTIFY capabilitiesChanged)
51 Q_PROPERTY(Availability canReboot READ canReboot NOTIFY capabilitiesChanged)
52 Q_PROPERTY(Availability canHalt READ canHalt NOTIFY capabilitiesChanged)
53 Q_PROPERTY(Availability canSuspend READ canSuspend NOTIFY capabilitiesChanged)
54 Q_PROPERTY(Availability canHibernate READ canHibernate NOTIFY capabilitiesChanged)
55 Q_PROPERTY(Availability canHybridSleep READ canHybridSleep NOTIFY capabilitiesChanged)
56 Q_PROPERTY(Availability canSuspendThenHibernate READ canSuspendThenHibernate NOTIFY capabilitiesChanged)
62 Q_PROPERTY(
bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged)
70 SessionHost(QDBusConnection connection, QString service, QObject* parent =
nullptr);
146 void onPrepareForSleep(
bool beforeSleep);
147 void onSessionLock();
148 void onSessionUnlock();
153 std::unique_ptr<Private> d;
void aboutToSleep()
Emitted on PrepareForSleep(true) while the delay inhibitor is held: the shell should lock now,...
void capabilitiesChanged()
Emitted whenever any capability value actually changes (each async Can* reply that differs from the c...
void lockRequested()
The logind session was asked to lock / unlock (e.g.
void prepareForSleep(bool beforeSleep)
Raw logind PrepareForSleep passthrough: beforeSleep is true just before the system sleeps and false j...
void logoutRequested()
Emitted by logout() so the shell / compositor can end the session gracefully (close clients,...
void suspendThenHibernate()
void setInteractive(bool interactive)
void lock()
Lock this session (resolved via XDG_SESSION_ID / GetSession, falling back to GetSessionByPID): logind...
Availability canHibernate() const
Availability canReboot() const
Availability canHalt() const
void allowSleep()
Drop the sleep delay-inhibitor so a pending suspend proceeds.
Availability canSuspendThenHibernate() const
void refreshCapabilities()
Re-read every capability from logind.
void interactiveChanged()
Availability canPowerOff() const
Availability canHybridSleep() const
void logout()
End this session.
Availability
logind capability state, parsed from the Can* query strings.
Definition SessionHost.h:41
void suspend()
Capability-gated power actions.
SessionHost(QObject *parent=nullptr)
Whether action calls pass logind interactive=true, routing an action that needs authorization to an i...
Availability canSuspend() const
Definition QmlRegistration.h:8