6#include "phosphorworkspaces_export.h"
96 virtual void setDesktopName(
const QString& desktopId,
const QString& name) = 0;
103 void desktopCreated(
const QString& desktopId,
int position,
const QString& name);
std::function< void(std::optional< Snapshot > snapshot)> SnapshotCallback
Definition IVirtualDesktopBackend.h:56
void currentChanged(const QString &desktopId)
void desktopCreatedUnreadable(const QString &desktopId)
A desktop was created but its data could not be read.
void desktopCreated(const QString &desktopId, int position, const QString &name)
void countChanged(int count)
The desktop count, which closes a create, a remove or a resize: every desktop signal of the change we...
virtual void removeDesktop(const QString &desktopId, AnswerCallback done)=0
Remove a desktop. done as for createDesktop.
virtual void setCurrentDesktop(const QString &desktopId)=0
Switch to the desktop with this id, without waiting for the switch: it arrives as currentChanged.
void desktopRemoved(const QString &desktopId)
virtual void setDesktopName(const QString &desktopId, const QString &name)=0
Rename a desktop. The new name arrives as desktopDataChanged.
std::function< void(bool answered)> AnswerCallback
answered is false for an error or a timeout: a stall, not a refusal.
Definition IVirtualDesktopBackend.h:58
void desktopDataChanged(const QString &desktopId, int position, const QString &name)
A desktop was renamed or moved; position is its new one.
virtual void createDesktop(uint position, const QString &name, AnswerCallback done)=0
Create a desktop at a 0-based position.
virtual void readSnapshotAsync(SnapshotCallback done)=0
Read the whole list without blocking.
void rowsChanged(int rows)
The grid's row count changed (a reshape moves no desktop).
void desktopDataChangedUnreadable()
A desktop's data changed but could not be read.
virtual void subscribe()=0
Start and stop emitting the change signals.
virtual bool connectToSource()=0
Reach the compositor's desktops.
IVirtualDesktopBackend(QObject *parent=nullptr)
Definition IVirtualDesktopBackend.h:60
~IVirtualDesktopBackend() override=default
virtual void unsubscribe()=0
virtual std::optional< Snapshot > readSnapshot()=0
Read the whole list now, blocking the caller.
virtual bool isReachable() const =0
Whether a read can reach the desktops right now.
Definition WindowTrackingService.h:46
One desktop of a compositor's list: 0-based position, stable id, raw name.
Definition IVirtualDesktopBackend.h:19
int position
Definition IVirtualDesktopBackend.h:20
QString id
Definition IVirtualDesktopBackend.h:21
QString name
Definition IVirtualDesktopBackend.h:22
One whole desktop list, with the current desktop and the grid's rows.
Definition IVirtualDesktopBackend.h:49
std::optional< int > rows
The grid's row count, nullopt when the compositor did not say.
Definition IVirtualDesktopBackend.h:54
QList< DesktopEntry > desktops
Definition IVirtualDesktopBackend.h:50
QString currentId
The current desktop's id, empty when the compositor did not say.
Definition IVirtualDesktopBackend.h:52