KWayland

plasmawindowmanagement_interface.h
1 /*
2  SPDX-FileCopyrightText: 2015 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H
7 #define WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H
8 
9 #include <KWayland/Server/kwaylandserver_export.h>
10 
11 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 73)
12 
13 #include <QObject>
14 
15 #include "global.h"
16 #include "resource.h"
17 
18 
19 namespace KWayland
20 {
21 namespace Server
22 {
23 class Display;
24 class PlasmaWindowInterface;
25 class SurfaceInterface;
26 class PlasmaVirtualDesktopManagementInterface;
27 
28 /**
29  * @deprecated 5.73 port to KWaylandServer in Plasma
30  */
31 class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public Global
32 {
33  Q_OBJECT
34 public:
35  KWAYLANDSERVER_DEPRECATED_VERSION(5, 73, "Port to KWaylandServer")
38  enum class ShowingDesktopState { Disabled, Enabled };
39  void setShowingDesktopState(ShowingDesktopState state);
40 
41  PlasmaWindowInterface *createWindow(QObject *parent);
42  QList<PlasmaWindowInterface *> windows() const;
43 
44  /**
45  * Unmaps the @p window previously created with {@link createWindow}.
46  * The window will be unmapped and removed from the list of {@link windows}.
47  *
48  * Unmapping a @p window indicates to the client that it should destroy the
49  * resource created for the window. Once all resources for the @p window are
50  * destroyed, the @p window will get deleted automatically. There is no need
51  * to manually delete the @p window. A manual delete will trigger the unmap
52  * and resource destroy at the same time and can result in protocol errors on
53  * client side if it still accesses the resource before receiving the unmap event.
54  *
55  * @see createWindow
56  * @see windows
57  * @since 5.23
58  **/
59  void unmapWindow(PlasmaWindowInterface *window);
60 
61  /**
62  * Associate a PlasmaVirtualDesktopManagementInterface to this window management.
63  * It's necessary to associate one in orderto use the plasma virtual desktop features
64  * of PlasmaWindowInterface, as a window must know what are the deasktops available
65  * @since 5.48
66  */
67  void setPlasmaVirtualDesktopManagementInterface(PlasmaVirtualDesktopManagementInterface *manager);
68 
69  /**
70  * @returns the PlasmaVirtualDesktopManagementInterface associated to this PlasmaWindowManagementInterface
71  * @since 5.48
72  */
73  PlasmaVirtualDesktopManagementInterface *plasmaVirtualDesktopManagementInterface() const;
74 
75  /**
76  * Associate stacking order to this window management
77  * @since 5.70
78  */
79  void setStackingOrder(const QVector<quint32> &stackingOrder);
80 
81 Q_SIGNALS:
82  void requestChangeShowingDesktop(ShowingDesktopState requestedState);
83 
84 private:
85  friend class Display;
86  explicit PlasmaWindowManagementInterface(Display *display, QObject *parent);
87  class Private;
88  Private *d_func() const;
89 };
90 
91 /**
92  * @todo Add documentation
93  */
94 class KWAYLANDSERVER_EXPORT PlasmaWindowInterface : public QObject
95 {
96  Q_OBJECT
97 public:
98  KWAYLANDSERVER_DEPRECATED_VERSION(5, 73, "Port to KWaylandServer")
99  PlasmaWindowInterface() = default;
100  virtual ~PlasmaWindowInterface();
101 
102  void setTitle(const QString &title);
103  void setAppId(const QString &appId);
104  void setPid(quint32 pid);
105 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52)
106  /**
107  * @deprecated Since 5.52, use addPlasmaVirtualDesktop and removePlasmaVirtualDesktop
108  */
109  KWAYLANDSERVER_DEPRECATED_VERSION(5,
110  52,
111  "Use PlasmaWindowManagementInterface::addPlasmaVirtualDesktop(const QString&) and "
112  "PlasmaWindowManagementInterface::removePlasmaVirtualDesktop(const QString&)")
113  void setVirtualDesktop(quint32 desktop);
114 #endif
115  void setActive(bool set);
116  void setMinimized(bool set);
117  void setMaximized(bool set);
118  void setFullscreen(bool set);
119  void setKeepAbove(bool set);
120  void setKeepBelow(bool set);
121  void setOnAllDesktops(bool set);
122  void setDemandsAttention(bool set);
123  void setCloseable(bool set);
124  void setMinimizeable(bool set);
125  void setMaximizeable(bool set);
126  void setFullscreenable(bool set);
127  void setSkipTaskbar(bool skip);
128  void setSkipSwitcher(bool skip);
129 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28)
130  /**
131  * @deprecated since 5.28 use setIcon
132  **/
133  KWAYLANDSERVER_DEPRECATED_VERSION(5, 28, "Use PlasmaWindowManagementInterface::setIcon(const QIcon&)")
134  void setThemedIconName(const QString &iconName);
135 #endif
136  /**
137  * @since 5.22
138  */
139  void setShadeable(bool set);
140  /**
141  * @since 5.22
142  */
143  void setShaded(bool set);
144  /**
145  * @since 5.22
146  */
147  void setMovable(bool set);
148  /**
149  * @since 5.22
150  */
151  void setResizable(bool set);
152  /**
153  * FIXME: still relevant with new desktops?
154  * @since 5.22
155  */
156  void setVirtualDesktopChangeable(bool set);
157 
158  /**
159  * This method removes the Window and the Client is supposed to release the resource
160  * bound for this Window. Once all resources are released the Window gets deleted.
161  *
162  * Prefer using {@link PlasmaWindowManagementInterface::unmapWindow}.
163  * @see PlasmaWindowManagementInterface::unmapWindow
164  **/
165  void unmap();
166 
167  /**
168  * @returns Geometries of the taskbar entries, indicized by the
169  * surface of the panels
170  * @since 5.5
171  */
172  QHash<SurfaceInterface *, QRect> minimizedGeometries() const;
173 
174  /**
175  * Sets this PlasmaWindowInterface as a transient window to @p parentWindow.
176  * If @p parentWindow is @c nullptr, the PlasmaWindowInterface is a toplevel
177  * window and does not have a parent window.
178  * @since 5.24
179  **/
180  void setParentWindow(PlasmaWindowInterface *parentWindow);
181 
182  /**
183  * Sets the window @p geometry of this PlasmaWindow.
184  *
185  * @param geometry The geometry in absolute coordinates
186  * @since 5.25
187  **/
188  void setGeometry(const QRect &geometry);
189 
190  /**
191  * Set the icon of the PlasmaWindowInterface.
192  *
193  * In case the icon has a themed name, only the name is sent to the client.
194  * Otherwise the client is only informed that there is an icon and the client
195  * can request the icon in an asynchronous way by passing a file descriptor
196  * into which the icon will be serialized.
197  *
198  * @param icon The new icon
199  * @since 5.28
200  **/
201  void setIcon(const QIcon &icon);
202 
203  /**
204  * Adds a new desktop to this window: a window can be on
205  * an arbitrary subset of virtual desktops.
206  * If it's on none it will be considered on all desktops.
207  *
208  * @since 5.48
209  */
210  void addPlasmaVirtualDesktop(const QString &id);
211 
212  /**
213  * Removes a visrtual desktop from a window
214  *
215  * @since 5.48
216  */
217  void removePlasmaVirtualDesktop(const QString &id);
218 
219  /**
220  * The ids of all the desktops currently associated with this window.
221  * When a desktop is deleted it will be automatically removed from this list
222  *
223  * @since 5.48
224  */
225  QStringList plasmaVirtualDesktops() const;
226 
227  /**
228  * Set the application menu D-BUS service name and object path for the window.
229  *
230  * @since 5.69
231  */
232  void setApplicationMenuPaths(const QString &serviceName, const QString &objectPath);
233 
234  /**
235  * Return the window internal id
236  *
237  * @since 5.70
238  */
239  quint32 internalId() const;
240 
241 Q_SIGNALS:
242  void closeRequested();
243  /**
244  * @since 5.22
245  */
246  void moveRequested();
247  /**
248  * @since 5.22
249  */
250  void resizeRequested();
251 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52)
252  /**
253  * @deprecated Since 5.52, use enterPlasmaVirtualDesktopRequested and leavePlasmaVirtualDesktopRequested instead
254  */
255  KWAYLANDSERVER_DEPRECATED_VERSION(5,
256  52,
257  "Use PlasmaWindowManagementInterface::enterPlasmaVirtualDesktopRequested(const QString&) and "
258  "PlasmaWindowManagementInterface::leavePlasmaVirtualDesktopRequested(const QString&)")
259  void virtualDesktopRequested(quint32 desktop);
260 #endif
261  void activeRequested(bool set);
262  void minimizedRequested(bool set);
263  void maximizedRequested(bool set);
264  void fullscreenRequested(bool set);
265  void keepAboveRequested(bool set);
266  void keepBelowRequested(bool set);
267  void demandsAttentionRequested(bool set);
268  void closeableRequested(bool set);
269  void minimizeableRequested(bool set);
270  void maximizeableRequested(bool set);
271  void fullscreenableRequested(bool set);
272  void skipTaskbarRequested(bool set);
273  void skipSwitcherRequested(bool set);
274  QRect minimizedGeometriesChanged();
275  /**
276  * @since 5.22
277  */
278  void shadeableRequested(bool set);
279  /**
280  * @since 5.22
281  */
282  void shadedRequested(bool set);
283  /**
284  * @since 5.22
285  */
286  void movableRequested(bool set);
287  /**
288  * @since 5.22
289  */
290  void resizableRequested(bool set);
291  /**
292  * FIXME: still relevant with new virtual desktops?
293  * @since 5.22
294  */
295  void virtualDesktopChangeableRequested(bool set);
296 
297  /**
298  * Emitted when the client wishes this window to enter in a new virtual desktop.
299  * The server will decide whether to consent this request
300  * @since 5.52
301  */
302  void enterPlasmaVirtualDesktopRequested(const QString &desktop);
303 
304  /**
305  * Emitted when the client wishes this window to enter in
306  * a new virtual desktop to be created for it.
307  * The server will decide whether to consent this request
308  * @since 5.52
309  */
310  void enterNewPlasmaVirtualDesktopRequested();
311 
312  /**
313  * Emitted when the client wishes to remove this window from a virtual desktop.
314  * The server will decide whether to consent this request
315  * @since 5.52
316  */
317  void leavePlasmaVirtualDesktopRequested(const QString &desktop);
318 
319 private:
320  friend class PlasmaWindowManagementInterface;
322 
323  class Private;
324  const QScopedPointer<Private> d;
325 };
326 
327 }
328 }
329 
330 Q_DECLARE_METATYPE(KWayland::Server::PlasmaWindowManagementInterface::ShowingDesktopState)
331 
332 #endif
333 #endif
Class holding the Wayland server display loop.
Definition: display.h:86
Base class for all Globals.
Definition: global.h:46
Wrapper for the org_kde_plasma_virtual_desktop_management interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Sep 23 2021 22:51:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.