KWaylandServer

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 #pragma once
7 
8 #include <QObject>
9 
10 #include <KWaylandServer/kwaylandserver_export.h>
11 
12 class QSize;
13 
14 namespace KWaylandServer
15 {
16 class Display;
17 class OutputInterface;
18 class PlasmaWindowActivationFeedbackInterfacePrivate;
19 class PlasmaWindowInterface;
20 class PlasmaVirtualDesktopManagementInterface;
21 class PlasmaWindowActivationInterfacePrivate;
22 class PlasmaWindowManagementInterfacePrivate;
23 class PlasmaWindowInterfacePrivate;
24 class SurfaceInterface;
25 
26 class KWAYLANDSERVER_EXPORT PlasmaWindowActivationInterface
27 {
28 public:
30 
31  void sendAppId(const QString &id);
32 
33 private:
34  friend class PlasmaWindowActivationFeedbackInterface;
36 
38 };
39 
40 class KWAYLANDSERVER_EXPORT PlasmaWindowActivationFeedbackInterface : public QObject
41 {
42  Q_OBJECT
43 
44 public:
45  explicit PlasmaWindowActivationFeedbackInterface(Display *display, QObject *parent = nullptr);
46  ~PlasmaWindowActivationFeedbackInterface() override;
47 
48  /**
49  * Notify about a new application with @p app_id being started
50  *
51  * @returns an instance of @class PlasmaWindowActivationInterface to
52  * be destroyed as the activation process ends.
53  */
54  PlasmaWindowActivationInterface *createActivation(const QString &app_id);
55 
56 private:
58 };
59 
60 class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public QObject
61 {
62  Q_OBJECT
63 
64 public:
65  explicit PlasmaWindowManagementInterface(Display *display, QObject *parent = nullptr);
66  ~PlasmaWindowManagementInterface() override;
67  enum class ShowingDesktopState {
68  Disabled,
69  Enabled,
70  };
71  void setShowingDesktopState(ShowingDesktopState state);
72 
73  PlasmaWindowInterface *createWindow(QObject *parent, const QUuid &uuid);
74  QList<PlasmaWindowInterface *> windows() const;
75 
76  /**
77  * Associate a PlasmaVirtualDesktopManagementInterface to this window management.
78  * It's necessary to associate one in orderto use the plasma virtual desktop features
79  * of PlasmaWindowInterface, as a window must know what are the deasktops available
80  */
81  void setPlasmaVirtualDesktopManagementInterface(PlasmaVirtualDesktopManagementInterface *manager);
82 
83  /**
84  * @returns the PlasmaVirtualDesktopManagementInterface associated to this PlasmaWindowManagementInterface
85  */
86  PlasmaVirtualDesktopManagementInterface *plasmaVirtualDesktopManagementInterface() const;
87 
88  /**
89  * Associate stacking order to this window management
90  */
91  void setStackingOrder(const QVector<quint32> &stackingOrder);
92 
93  void setStackingOrderUuids(const QVector<QString> &stackingOrderUuids);
94 
95 Q_SIGNALS:
96  void requestChangeShowingDesktop(ShowingDesktopState requestedState);
97 
98 private:
100 };
101 
102 /**
103  * @todo Add documentation
104  */
105 class KWAYLANDSERVER_EXPORT PlasmaWindowInterface : public QObject
106 {
107  Q_OBJECT
108 public:
109  ~PlasmaWindowInterface() override;
110 
111  void setTitle(const QString &title);
112  void setAppId(const QString &appId);
113  void setPid(quint32 pid);
114 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52)
115  /**
116  * @deprecated Since 5.52, use addPlasmaVirtualDesktop and removePlasmaVirtualDesktop
117  */
118  KWAYLANDSERVER_DEPRECATED_VERSION(5,
119  52,
120  "Use PlasmaWindowManagementInterface::addPlasmaVirtualDesktop(const QString&) and "
121  "PlasmaWindowManagementInterface::removePlasmaVirtualDesktop(const QString&)")
122  void setVirtualDesktop(quint32 desktop);
123 #endif
124  void setActive(bool set);
125  void setMinimized(bool set);
126  void setMaximized(bool set);
127  void setFullscreen(bool set);
128  void setKeepAbove(bool set);
129  void setKeepBelow(bool set);
130  void setOnAllDesktops(bool set);
131  void setDemandsAttention(bool set);
132  void setCloseable(bool set);
133  void setMinimizeable(bool set);
134  void setMaximizeable(bool set);
135  void setFullscreenable(bool set);
136  void setSkipTaskbar(bool skip);
137  void setSkipSwitcher(bool skip);
138 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28)
139  /**
140  * @deprecated since 5.28 use setIcon
141  */
142  KWAYLANDSERVER_DEPRECATED_VERSION(5, 28, "Use PlasmaWindowManagementInterface::setIcon(const QIcon&)")
143  void setThemedIconName(const QString &iconName);
144 #endif
145  void setShadeable(bool set);
146  void setShaded(bool set);
147  void setMovable(bool set);
148  void setResizable(bool set);
149  /**
150  * FIXME: still relevant with new desktops?
151  */
152  void setVirtualDesktopChangeable(bool set);
153 
154  /**
155  * This method removes the Window and the Client is supposed to release the resource
156  * bound for this Window.
157  *
158  * No more events should be sent afterwards.
159  */
160  void unmap();
161 
162  /**
163  * @returns Geometries of the taskbar entries, indicized by the
164  * surface of the panels
165  */
166  QHash<SurfaceInterface *, QRect> minimizedGeometries() const;
167 
168  /**
169  * Sets this PlasmaWindowInterface as a transient window to @p parentWindow.
170  * If @p parentWindow is @c nullptr, the PlasmaWindowInterface is a toplevel
171  * window and does not have a parent window.
172  */
173  void setParentWindow(PlasmaWindowInterface *parentWindow);
174 
175  /**
176  * Sets the window @p geometry of this PlasmaWindow.
177  *
178  * @param geometry The geometry in absolute coordinates
179  */
180  void setGeometry(const QRect &geometry);
181 
182  /**
183  * Set the icon of the PlasmaWindowInterface.
184  *
185  * In case the icon has a themed name, only the name is sent to the client.
186  * Otherwise the client is only informed that there is an icon and the client
187  * can request the icon in an asynchronous way by passing a file descriptor
188  * into which the icon will be serialized.
189  *
190  * @param icon The new icon
191  */
192  void setIcon(const QIcon &icon);
193 
194  /**
195  * Adds a new desktop to this window: a window can be on
196  * an arbitrary subset of virtual desktops.
197  * If it's on none it will be considered on all desktops.
198  */
199  void addPlasmaVirtualDesktop(const QString &id);
200 
201  /**
202  * Removes a visrtual desktop from a window
203  */
204  void removePlasmaVirtualDesktop(const QString &id);
205 
206  /**
207  * The ids of all the desktops currently associated with this window.
208  * When a desktop is deleted it will be automatically removed from this list
209  */
210  QStringList plasmaVirtualDesktops() const;
211 
212  /**
213  * Adds an activity to this window: a window can be on
214  * an arbitrary subset of activities.
215  * If it's on none it will be considered on all activities.
216  */
217  void addPlasmaActivity(const QString &id);
218 
219  /**
220  * Removes an activity from a window
221  */
222  void removePlasmaActivity(const QString &id);
223 
224  /**
225  * The ids of all the activities currently associated with this window.
226  * When an activity is deleted it will be automatically removed from this list
227  */
228  QStringList plasmaActivities() const;
229 
230  /**
231  * Set the application menu D-BUS service name and object path for the window.
232  */
233  void setApplicationMenuPaths(const QString &serviceName, const QString &objectPath);
234 
235  /**
236  * Return the window internal id
237  */
238  quint32 internalId() const;
239 
240  /**
241  * @return a unique string that identifies this window
242  */
243  QString uuid() const;
244 
245 Q_SIGNALS:
246  void closeRequested();
247  void moveRequested();
248  void resizeRequested();
249 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52)
250  /**
251  * @deprecated Since 5.52, use enterPlasmaVirtualDesktopRequested and leavePlasmaVirtualDesktopRequested instead
252  */
253  KWAYLANDSERVER_DEPRECATED_VERSION(5,
254  52,
255  "Use PlasmaWindowManagementInterface::enterPlasmaVirtualDesktopRequested(const QString&) and "
256  "PlasmaWindowManagementInterface::leavePlasmaVirtualDesktopRequested(const QString&)")
257  void virtualDesktopRequested(quint32 desktop);
258 #endif
259  void activeRequested(bool set);
260  void minimizedRequested(bool set);
261  void maximizedRequested(bool set);
262  void fullscreenRequested(bool set);
263  void keepAboveRequested(bool set);
264  void keepBelowRequested(bool set);
265  void demandsAttentionRequested(bool set);
266  void closeableRequested(bool set);
267  void minimizeableRequested(bool set);
268  void maximizeableRequested(bool set);
269  void fullscreenableRequested(bool set);
270  void skipTaskbarRequested(bool set);
271  void skipSwitcherRequested(bool set);
272  QRect minimizedGeometriesChanged();
273  void shadeableRequested(bool set);
274  void shadedRequested(bool set);
275  void movableRequested(bool set);
276  void resizableRequested(bool set);
277  /**
278  * FIXME: still relevant with new virtual desktops?
279  */
280  void virtualDesktopChangeableRequested(bool set);
281 
282  /**
283  * Emitted when the client wishes this window to enter in a new virtual desktop.
284  * The server will decide whether to consent this request
285  */
286  void enterPlasmaVirtualDesktopRequested(const QString &desktop);
287 
288  /**
289  * Emitted when the client wishes this window to enter in
290  * a new virtual desktop to be created for it.
291  * The server will decide whether to consent this request
292  */
293  void enterNewPlasmaVirtualDesktopRequested();
294 
295  /**
296  * Emitted when the client wishes to remove this window from a virtual desktop.
297  * The server will decide whether to consent this request
298  */
299  void leavePlasmaVirtualDesktopRequested(const QString &desktop);
300 
301  /**
302  * Emitted when the client wishes this window to enter an activity.
303  * The server will decide whether to consent this request
304  */
305  void enterPlasmaActivityRequested(const QString &activity);
306 
307  /**
308  * Emitted when the client wishes to remove this window from an activity.
309  * The server will decide whether to consent this request
310  */
311  void leavePlasmaActivityRequested(const QString &activity);
312 
313  /**
314  * Requests sending the window to @p output
315  */
316  void sendToOutput(KWaylandServer::OutputInterface *output);
317 
318 private:
319  friend class PlasmaWindowManagementInterface;
320  friend class PlasmaWindowInterfacePrivate;
321  friend class PlasmaWindowManagementInterfacePrivate;
322  explicit PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent);
323 
325 };
326 
327 }
328 
329 Q_DECLARE_METATYPE(KWaylandServer::PlasmaWindowManagementInterface::ShowingDesktopState)
The OutputInterface class represents a screen.
Notify about a new application with app_id being started.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.