Changeset View
Changeset View
Standalone View
Standalone View
dbusinterface.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef KWIN_DBUS_INTERFACE_H | 21 | #ifndef KWIN_DBUS_INTERFACE_H | ||
22 | #define KWIN_DBUS_INTERFACE_H | 22 | #define KWIN_DBUS_INTERFACE_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QtDBus> | 25 | #include <QtDBus> | ||
26 | 26 | | |||
27 | #include "virtualdesktopsdbustypes.h" | ||||
28 | | ||||
27 | namespace KWin | 29 | namespace KWin | ||
28 | { | 30 | { | ||
29 | 31 | | |||
30 | class Compositor; | 32 | class Compositor; | ||
33 | class VirtualDesktopManager; | ||||
31 | 34 | | |||
32 | /** | 35 | /** | ||
33 | * @brief This class is a wrapper for the org.kde.KWin D-Bus interface. | 36 | * @brief This class is a wrapper for the org.kde.KWin D-Bus interface. | ||
34 | * | 37 | * | ||
35 | * The main purpose of this class is to be exported on the D-Bus as object /KWin. | 38 | * The main purpose of this class is to be exported on the D-Bus as object /KWin. | ||
36 | * It is a pure wrapper to provide the deprecated D-Bus methods which have been | 39 | * It is a pure wrapper to provide the deprecated D-Bus methods which have been | ||
37 | * removed from Workspace which used to implement the complete D-Bus interface. | 40 | * removed from Workspace which used to implement the complete D-Bus interface. | ||
38 | * | 41 | * | ||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | |||||
164 | 167 | | |||
165 | Q_SIGNALS: | 168 | Q_SIGNALS: | ||
166 | void compositingToggled(bool active); | 169 | void compositingToggled(bool active); | ||
167 | 170 | | |||
168 | private: | 171 | private: | ||
169 | Compositor *m_compositor; | 172 | Compositor *m_compositor; | ||
170 | }; | 173 | }; | ||
171 | 174 | | |||
175 | //TODO: disable all of this in case of kiosk? | ||||
176 | | ||||
177 | class VirtualDesktopManagerDBusInterface : public QObject | ||||
178 | { | ||||
179 | Q_OBJECT | ||||
180 | Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.VirtualDesktopManager") | ||||
181 | | ||||
182 | /** | ||||
183 | * The number of virtual desktops currently available. | ||||
184 | * The ids of the virtual desktops are in the range [1, VirtualDesktopManager::maximum()]. | ||||
185 | **/ | ||||
186 | Q_PROPERTY(uint count READ count NOTIFY countChanged) | ||||
187 | /** | ||||
188 | * The number of rows the virtual desktops will be laid out in | ||||
189 | **/ | ||||
190 | Q_PROPERTY(uint rows READ rows WRITE setRows NOTIFY rowsChanged) | ||||
191 | /** | ||||
192 | * The id of the virtual desktop which is currently in use. | ||||
193 | **/ | ||||
194 | Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged) | ||||
195 | /** | ||||
196 | * Whether navigation in the desktop layout wraps around at the borders. | ||||
197 | **/ | ||||
198 | Q_PROPERTY(bool navigationWrappingAround READ isNavigationWrappingAround WRITE setNavigationWrappingAround NOTIFY navigationWrappingAroundChanged) | ||||
199 | | ||||
200 | /** | ||||
201 | * list of key/value pairs which every one of them is representing a desktop | ||||
202 | */ | ||||
203 | Q_PROPERTY(KWin::DBusDesktopDataVector desktops READ desktops NOTIFY desktopsChanged); | ||||
204 | | ||||
205 | public: | ||||
206 | VirtualDesktopManagerDBusInterface(VirtualDesktopManager *parent); | ||||
207 | ~VirtualDesktopManagerDBusInterface() = default; | ||||
208 | | ||||
209 | uint count() const; | ||||
210 | | ||||
211 | void setRows(uint rows); | ||||
212 | uint rows() const; | ||||
213 | | ||||
214 | void setCurrent(const QString &id); | ||||
215 | QString current() const; | ||||
216 | | ||||
217 | void setNavigationWrappingAround(bool wraps); | ||||
218 | bool isNavigationWrappingAround() const; | ||||
219 | | ||||
220 | KWin::DBusDesktopDataVector desktops() const; | ||||
221 | | ||||
222 | Q_SIGNALS: | ||||
223 | void countChanged(uint count); | ||||
224 | void rowsChanged(uint rows); | ||||
225 | void currentChanged(const QString &id); | ||||
226 | void navigationWrappingAroundChanged(bool wraps); | ||||
227 | void desktopsChanged(KWin::DBusDesktopDataVector); | ||||
228 | void desktopDataChanged(const QString &id, KWin::DBusDesktopDataStruct); | ||||
229 | void desktopCreated(const QString &id, KWin::DBusDesktopDataStruct); | ||||
230 | void desktopRemoved(const QString &id); | ||||
231 | | ||||
232 | public Q_SLOTS: | ||||
233 | /** | ||||
234 | * Create a desktop with a new name at a given position | ||||
235 | * note: the position starts from 1 | ||||
236 | */ | ||||
237 | void createDesktop(uint position, const QString &name); | ||||
238 | void setDesktopName(const QString &id, const QString &name); | ||||
239 | void removeDesktop(const QString &id); | ||||
240 | | ||||
241 | private: | ||||
242 | VirtualDesktopManager *m_manager; | ||||
243 | }; | ||||
244 | | ||||
172 | } // namespace | 245 | } // namespace | ||
173 | 246 | | |||
174 | #endif // KWIN_DBUS_INTERFACE_H | 247 | #endif // KWIN_DBUS_INTERFACE_H |