KWayland

plasmawindowmanagement.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_PLASMAWINDOWMANAGEMENT_H
7 #define WAYLAND_PLASMAWINDOWMANAGEMENT_H
8 
9 #include <QIcon>
10 #include <QObject>
11 #include <QSize>
12 
13 #include "KWayland/Client/kwaylandclient_export.h"
14 
15 struct org_kde_plasma_activation_feedback;
16 struct org_kde_plasma_activation;
17 struct org_kde_plasma_window_management;
18 struct org_kde_plasma_window;
19 
20 namespace KWayland
21 {
22 namespace Client
23 {
24 class EventQueue;
25 class Output;
26 class PlasmaActivationFeedback;
27 class PlasmaWindow;
28 class PlasmaWindowModel;
29 class Surface;
30 
31 /**
32  * @short Wrapper for the org_kde_plasma_window_management interface.
33  *
34  * PlasmaWindowManagement is a privileged interface. A Wayland compositor is allowed to ignore
35  * any requests. The PlasmaWindowManagement allows to get information about the overall windowing
36  * system. It allows to see which windows are currently available and thus is the base to implement
37  * e.g. a task manager.
38  *
39  * This class provides a convenient wrapper for the org_kde_plasma_window_management interface.
40  * It's main purpose is to create a PlasmaWindowManagementSurface.
41  *
42  * To use this class one needs to interact with the Registry. There are two
43  * possible ways to create the Shell interface:
44  * @code
45  * PlasmaWindowManagement *s = registry->createPlasmaWindowManagement(name, version);
46  * @endcode
47  *
48  * This creates the PlasmaWindowManagement and sets it up directly. As an alternative this
49  * can also be done in a more low level way:
50  * @code
51  * PlasmaWindowManagement *s = new PlasmaWindowManagement;
52  * s->setup(registry->bindPlasmaWindowManagement(name, version));
53  * @endcode
54  *
55  * The PlasmaWindowManagement can be used as a drop-in replacement for any org_kde_plasma_window_management
56  * pointer as it provides matching cast operators.
57  *
58  * @see Registry
59  * @see PlasmaWindowManagementSurface
60  **/
61 class KWAYLANDCLIENT_EXPORT PlasmaWindowManagement : public QObject
62 {
63  Q_OBJECT
64 public:
65  explicit PlasmaWindowManagement(QObject *parent = nullptr);
66  ~PlasmaWindowManagement() override;
67 
68  /**
69  * @returns @c true if managing a org_kde_plasma_window_management.
70  **/
71  bool isValid() const;
72  /**
73  * Releases the org_kde_plasma_window_management interface.
74  * After the interface has been released the PlasmaWindowManagement instance is no
75  * longer valid and can be setup with another org_kde_plasma_window_management interface.
76  *
77  * Right before the interface is released the signal interfaceAboutToBeReleased is emitted.
78  * @see interfaceAboutToBeReleased
79  **/
80  void release();
81  /**
82  * Destroys the data held by this PlasmaWindowManagement.
83  * This method is supposed to be used when the connection to the Wayland
84  * server goes away. Once the connection becomes invalid, it's not
85  * possible to call release anymore as that calls into the Wayland
86  * connection and the call would fail. This method cleans up the data, so
87  * that the instance can be deleted or set up to a new org_kde_plasma_window_management interface
88  * once there is a new connection available.
89  *
90  * This method is automatically invoked when the Registry which created this
91  * PlasmaWindowManagement gets destroyed.
92  *
93  * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted.
94  *
95  * @see release
96  * @see interfaceAboutToBeDestroyed
97  **/
98  void destroy();
99  /**
100  * Setup this Shell to manage the @p shell.
101  * When using Registry::createShell there is no need to call this
102  * method.
103  **/
104  void setup(org_kde_plasma_window_management *shell);
105 
106  /**
107  * Sets the @p queue to use for creating a Surface.
108  **/
109  void setEventQueue(EventQueue *queue);
110  /**
111  * @returns The event queue to use for creating a Surface.
112  **/
113  EventQueue *eventQueue();
114 
115  operator org_kde_plasma_window_management *();
116  operator org_kde_plasma_window_management *() const;
117 
118  /**
119  * Whether the system is currently showing the desktop.
120  * This means that the system focuses on the desktop and hides other windows.
121  * @see setShowingDesktop
122  * @see showDesktop
123  * @see hideDesktop
124  * @see showingDesktopChanged
125  **/
126  bool isShowingDesktop() const;
127  /**
128  * Requests to change the showing desktop state to @p show.
129  * @see isShowingDesktop
130  * @see showDesktop
131  * @see hideDesktop
132  **/
133  void setShowingDesktop(bool show);
134  /**
135  * Same as calling setShowingDesktop with @c true.
136  * @see setShowingDesktop
137  **/
138  void showDesktop();
139  /**
140  * Same as calling setShowingDesktop with @c false.
141  * @see setShowingDesktop
142  **/
143  void hideDesktop();
144 
145  /**
146  * @returns All windows currently known to the PlasmaWindowManagement
147  * @see windowCreated
148  **/
149  QList<PlasmaWindow *> windows() const;
150  /**
151  * @returns The currently active PlasmaWindow, the PlasmaWindow which
152  * returns @c true in {@link PlasmaWindow::isActive} or @c nullptr in case
153  * there is no active window.
154  **/
155  PlasmaWindow *activeWindow() const;
156  /**
157  * Factory method to create a PlasmaWindowModel.
158  * @returns a new created PlasmaWindowModel
159  **/
160  PlasmaWindowModel *createWindowModel();
161 
162 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
163  /**
164  * @returns windows stacking order
165  *
166  * @deprecated Since 5.73, use stackingOrderUuids()
167  */
168  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuids()")
169  QVector<quint32> stackingOrder() const;
170 #endif
171 
172  /**
173  * @returns windows stacking order
174  *
175  * @since 5.73
176  */
177  QVector<QByteArray> stackingOrderUuids() const;
178 
179 Q_SIGNALS:
180  /**
181  * This signal is emitted right before the interface is released.
182  **/
183  void interfaceAboutToBeReleased();
184  /**
185  * This signal is emitted right before the data is destroyed.
186  **/
187  void interfaceAboutToBeDestroyed();
188  /**
189  * The showing desktop state changed.
190  * @see isShowingDesktop
191  **/
192  void showingDesktopChanged(bool);
193 
194  /**
195  * A new @p window got created.
196  * @see windows
197  **/
198  void windowCreated(KWayland::Client::PlasmaWindow *window);
199  /**
200  * The active window changed.
201  * @see activeWindow
202  **/
203  void activeWindowChanged();
204 
205  /**
206  * The corresponding global for this interface on the Registry got removed.
207  *
208  * This signal gets only emitted if the Compositor got created by
209  * Registry::createPlasmaWindowManagement
210  *
211  * @since 5.5
212  **/
213  void removed();
214 
215 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
216  /**
217  * The stacking order changed
218  * @since 5.70
219  * @deprecated Since 5.73, use stackingOrderUuidsChanged()
220  **/
221  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuidsChanged()")
222  void stackingOrderChanged();
223 #endif
224 
225  /**
226  * The stacking order uuids changed
227  * @since 5.73
228  **/
229  void stackingOrderUuidsChanged();
230 
231 public:
232  class Private;
233 
234 private:
236 };
237 
238 /**
239  * @short Wrapper for the org_kde_plasma_window interface.
240  *
241  * A PlasmaWindow gets created by the PlasmaWindowManagement and announced through
242  * the {@link PlasmaWindowManagement::windowCreated} signal. The PlasmaWindow encapsulates
243  * state about a window managed by the Wayland server and allows to request state changes.
244  *
245  * The PlasmaWindow will be automatically deleted when the PlasmaWindow gets unmapped.
246  *
247  * This class is a convenient wrapper for the org_kde_plasma_window interface.
248  * The PlasmaWindow gets created by PlasmaWindowManagement.
249  *
250  * @see PlasmaWindowManager
251  **/
252 class KWAYLANDCLIENT_EXPORT PlasmaWindow : public QObject
253 {
254  Q_OBJECT
255 public:
256  ~PlasmaWindow() override;
257 
258  /**
259  * Releases the org_kde_plasma_window interface.
260  * After the interface has been released the PlasmaWindow instance is no
261  * longer valid and can be setup with another org_kde_plasma_window interface.
262  **/
263  void release();
264  /**
265  * Destroys the data held by this PlasmaWindow.
266  * This method is supposed to be used when the connection to the Wayland
267  * server goes away. If the connection is not valid anymore, it's not
268  * possible to call release anymore as that calls into the Wayland
269  * connection and the call would fail. This method cleans up the data, so
270  * that the instance can be deleted or set up to a new org_kde_plasma_window interface
271  * once there is a new connection available.
272  *
273  * It is suggested to connect this method to ConnectionThread::connectionDied:
274  * @code
275  * connect(connection, &ConnectionThread::connectionDied, source, &PlasmaWindow::destroy);
276  * @endcode
277  *
278  * @see release
279  **/
280  void destroy();
281  /**
282  * @returns @c true if managing a org_kde_plasma_window.
283  **/
284  bool isValid() const;
285 
286  operator org_kde_plasma_window *();
287  operator org_kde_plasma_window *() const;
288 
289  /**
290  * @returns the window title.
291  * @see titleChanged
292  **/
293  QString title() const;
294  /**
295  * @returns the application id which should reflect the name of a desktop file.
296  * @see appIdChanged
297  **/
298  QString appId() const;
299 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
300  /**
301  * @returns the id of the virtual desktop this PlasmaWindow is on
302  * @see virtualDesktopChanged
303  * @deprecated: Since 5.52, use plasmaVirtualDesktops instead
304  **/
305  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktops()")
306  quint32 virtualDesktop() const;
307 #endif
308  /**
309  * @returns Whether the window is currently the active Window.
310  * @see activeChanged
311  **/
312  bool isActive() const;
313  /**
314  * @returns Whether the window is fullscreen
315  * @see fullscreenChanged
316  **/
317  bool isFullscreen() const;
318  /**
319  * @returns Whether the window is kept above other windows.
320  * @see keepAboveChanged
321  **/
322  bool isKeepAbove() const;
323  /**
324  * @returns Whether the window is kept below other window
325  * @see keepBelowChanged
326  **/
327  bool isKeepBelow() const;
328  /**
329  * @returns Whether the window is currently minimized
330  * @see minimizedChanged
331  **/
332  bool isMinimized() const;
333  /**
334  * @returns Whether the window is maximized.
335  * @see maximizedChanged
336  **/
337  bool isMaximized() const;
338  /**
339  * @returns Whether the window is shown on all desktops.
340  * @see virtualDesktop
341  * @see onAllDesktopsChanged
342  **/
343  bool isOnAllDesktops() const;
344  /**
345  * @returns Whether the window is demanding attention.
346  * @see demandsAttentionChanged
347  **/
348  bool isDemandingAttention() const;
349  /**
350  * @returns Whether the window can be closed.
351  * @see closeableChanged
352  **/
353  bool isCloseable() const;
354  /**
355  * @returns Whether the window can be maximized.
356  * @see maximizeableChanged
357  **/
358  bool isMaximizeable() const;
359  /**
360  * @returns Whether the window can be minimized.
361  * @see minimizeableChanged
362  **/
363  bool isMinimizeable() const;
364  /**
365  * @returns Whether the window can be set to fullscreen.
366  * @see fullscreenableChanged
367  **/
368  bool isFullscreenable() const;
369  /**
370  * @returns Whether the window should be ignored by a task bar.
371  * @see skipTaskbarChanged
372  **/
373  bool skipTaskbar() const;
374  /**
375  * @returns Whether the window should be ignored by a switcher.
376  * @see skipSwitcherChanged
377  **/
378  bool skipSwitcher() const;
379  /**
380  * @returns The icon of the window.
381  * @see iconChanged
382  **/
383  QIcon icon() const;
384  /**
385  * @returns Whether the window can be set to the shaded state.
386  * @see isShaded
387  * @see shadeableChanged
388  * @since 5.22
389  */
390  bool isShadeable() const;
391  /**
392  * @returns Whether the window is shaded, that is reduced to the window decoration
393  * @see shadedChanged
394  * @since 5.22
395  */
396  bool isShaded() const;
397  /**
398  * @returns Whether the window can be moved.
399  * @see movableChanged
400  * @since 5.22
401  */
402  bool isMovable() const;
403  /**
404  * @returns Whether the window can be resized.
405  * @see resizableChanged
406  * @since 5.22
407  */
408  bool isResizable() const;
409  /**
410  * @returns Whether the virtual desktop can be changed.
411  * @see virtualDesktopChangeableChanged
412  * @since 5.22
413  */
414  bool isVirtualDesktopChangeable() const;
415  /**
416  * @returns The process id this window belongs to.
417  * or 0 if unset
418  * @since 5.35
419  */
420  quint32 pid() const;
421  /**
422  * @returns The X11 resource name for this window.
423  * This is only set for X11 windows.
424  * @since 5.94
425  */
426  QString resourceName() const;
427 
428  /**
429  * Requests to activate the window.
430  **/
431  void requestActivate();
432  /**
433  * Requests to close the window.
434  **/
435  void requestClose();
436  /**
437  * Requests to start an interactive window move operation.
438  * @since 5.22
439  */
440  void requestMove();
441  /**
442  * Requests to start an interactive resize operation.
443  * @since 5.22
444  */
445  void requestResize();
446 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
447  /**
448  * Requests to send the window to virtual @p desktop.
449  * @deprecated: Since 5.52, use requestEnterVirtualDesktop instead
450  **/
451  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::requestEnterVirtualDesktop(const QString &)")
452  void requestVirtualDesktop(quint32 desktop);
453 #endif
454 
455  /**
456  * Requests the window at this model row index have its keep above state toggled.
457  * @since 5.35
458  */
459  void requestToggleKeepAbove();
460 
461  /**
462  * Requests the window at this model row index have its keep below state toggled.
463  * @since 5.35
464  */
465  void requestToggleKeepBelow();
466 
467  /**
468  * Requests the window at this model row index have its minimized state toggled.
469  */
470  void requestToggleMinimized();
471 
472  /**
473  * Requests the window at this model row index have its maximized state toggled.
474  */
475  void requestToggleMaximized();
476 
477  /**
478  * Sets the geometry of the taskbar entry for this window
479  * relative to a panel in particular
480  * @since 5.5
481  */
482  void setMinimizedGeometry(Surface *panel, const QRect &geom);
483 
484  /**
485  * Remove the task geometry information for a particular panel
486  * @since 5.5
487  */
488  void unsetMinimizedGeometry(Surface *panel);
489 
490  /**
491  * Requests the window at this model row index have its shaded state toggled.
492  * @since 5.22
493  */
494  void requestToggleShaded();
495 
496 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
497  /**
498  * An internal window identifier.
499  * This is not a global window identifier.
500  * This identifier does not correspond to QWindow::winId in any way.
501  *
502  * @deprecated Since 5.73, use uuid(const QString &) instead
503  */
504  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::uuid(const QString &)")
505  quint32 internalId() const;
506 #endif
507 
508  /**
509  * A unique identifier for the window
510  *
511  * @see QUuid
512  * @since 5.73
513  */
514  QByteArray uuid() const;
515 
516  /**
517  * The parent window of this PlasmaWindow.
518  *
519  * If there is a parent window, this window is a transient window for the
520  * parent window. If this method returns a null PlasmaWindow it means this
521  * window is a top level window and is not a transient window.
522  *
523  * @see parentWindowChanged
524  * @since 5.24
525  **/
526  QPointer<PlasmaWindow> parentWindow() const;
527 
528  /**
529  * @returns The window geometry in absolute coordinates.
530  * @see geometryChanged
531  * @since 5.25
532  **/
533  QRect geometry() const;
534 
535  /**
536  * Ask the server to make the window enter a virtual desktop.
537  * The server may or may not consent.
538  * A window can enter more than one virtual desktop.
539  *
540  * @since 5.52
541  */
542  void requestEnterVirtualDesktop(const QString &id);
543 
544  /**
545  * Make the window enter a new virtual desktop. If the server consents the request,
546  * it will create a new virtual desktop and assign the window to it.
547  * @since 5.52
548  */
549  void requestEnterNewVirtualDesktop();
550 
551  /**
552  * Ask the server to make the window the window exit a virtual desktop.
553  * The server may or may not consent.
554  * If it exits all desktops it will be considered on all of them.
555  *
556  * @since 5.52
557  */
558  void requestLeaveVirtualDesktop(const QString &id);
559 
560  /**
561  * Return all the virtual desktop ids this window is associated to.
562  * When a desktop gets deleted, it will be automatically removed from this list.
563  * If this list is empty, assume it's on all desktops.
564  *
565  * @since 5.52
566  */
567  QStringList plasmaVirtualDesktops() const;
568 
569  /**
570  * Ask the server to make the window enter an activity.
571  * The server may or may not consent.
572  * A window can enter more than one activity.
573  *
574  * @since 5.81
575  */
576  void requestEnterActivity(const QString &id);
577 
578  /**
579  * Ask the server to make the window exit an activity.
580  * The server may or may not consent.
581  * If it exits all activities it will be considered on all of them.
582  *
583  * @since 5.81
584  */
585  void requestLeaveActivity(const QString &id);
586 
587  /**
588  * Return all the activity ids this window is associated to.
589  * When an activity gets deleted, it will be automatically removed from this list.
590  * If this list is empty, assume it's on all activities.
591  *
592  * @since 5.81
593  */
594  QStringList plasmaActivities() const;
595 
596  /**
597  * Return the D-BUS service name for a window's
598  * application menu.
599  *
600  * @since 5.69
601  */
602  QString applicationMenuServiceName() const;
603  /**
604  * Return the D-BUS object path to a windows's
605  * application menu.
606  *
607  * @since 5.69
608  */
609  QString applicationMenuObjectPath() const;
610 
611  /**
612  * Sends the current window to @p output
613  *
614  * @since 5.86
615  */
616  void sendToOutput(KWayland::Client::Output *output) const;
617 
618 Q_SIGNALS:
619  /**
620  * The window title changed.
621  * @see title
622  **/
623  void titleChanged();
624  /**
625  * The application id changed.
626  * @see appId
627  **/
628  void appIdChanged();
629 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
630  /**
631  * The virtual desktop changed.
632  * @deprecated Since 5.52, use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead
633  **/
634  KWAYLANDCLIENT_DEPRECATED_VERSION(
635  5,
636  52,
637  "Use PlasmaWindow::plasmaVirtualDesktopEntered(const QString &) and PlasmaWindow::plasmaVirtualDesktopLeft(const QString &)")
638  void virtualDesktopChanged();
639 #endif
640  /**
641  * The window became active or inactive.
642  * @see isActive
643  **/
644  void activeChanged();
645  /**
646  * The fullscreen state changed.
647  * @see isFullscreen
648  **/
649  void fullscreenChanged();
650  /**
651  * The keep above state changed.
652  * @see isKeepAbove
653  **/
654  void keepAboveChanged();
655  /**
656  * The keep below state changed.
657  * @see isKeepBelow
658  **/
659  void keepBelowChanged();
660  /**
661  * The minimized state changed.
662  * @see isMinimized
663  **/
664  void minimizedChanged();
665  /**
666  * The maximized state changed.
667  * @see isMaximized
668  **/
669  void maximizedChanged();
670  /**
671  * The on all desktops state changed.
672  * @see isOnAllDesktops
673  **/
674  void onAllDesktopsChanged();
675  /**
676  * The demands attention state changed.
677  * @see isDemandingAttention
678  **/
679  void demandsAttentionChanged();
680  /**
681  * The closeable state changed.
682  * @see isCloseable
683  **/
684  void closeableChanged();
685  /**
686  * The minimizeable state changed.
687  * @see isMinimizeable
688  **/
689  void minimizeableChanged();
690  /**
691  * The maximizeable state changed.
692  * @see isMaximizeable
693  **/
694  void maximizeableChanged();
695  /**
696  * The fullscreenable state changed.
697  * @see isFullscreenable
698  **/
699  void fullscreenableChanged();
700  /**
701  * The skip taskbar state changed.
702  * @see skipTaskbar
703  **/
704  void skipTaskbarChanged();
705  /**
706  * The skip switcher state changed.
707  * @see skipSwitcher
708  **/
709  void skipSwitcherChanged();
710  /**
711  * The window icon changed.
712  * @see icon
713  **/
714  void iconChanged();
715  /**
716  * The shadeable state changed.
717  * @see isShadeable
718  * @since 5.22
719  */
720  void shadeableChanged();
721  /**
722  * The shaded state changed.
723  * @see isShaded
724  * @since 5.22
725  */
726  void shadedChanged();
727  /**
728  * The movable state changed.
729  * @see isMovable
730  * @since 5.22
731  */
732  void movableChanged();
733  /**
734  * The resizable state changed.
735  * @see isResizable
736  * @since 5.22
737  */
738  void resizableChanged();
739  /**
740  * The virtual desktop changeable state changed.
741  * @see virtualDesktopChangeable
742  * @since 5.22
743  */
744  void virtualDesktopChangeableChanged();
745  /**
746  * The window got unmapped and is no longer available to the Wayland server.
747  * This instance will be automatically deleted and one should connect to this
748  * signal to perform cleanup.
749  **/
750  void unmapped();
751  /**
752  * This signal is emitted whenever the parent window changes.
753  * @see parentWindow
754  * @since 5.24
755  **/
756  void parentWindowChanged();
757  /**
758  * This signal is emitted whenever the window geometry changes.
759  * @see geometry
760  * @since 5.25
761  **/
762  void geometryChanged();
763 
764  /**
765  * This signal is emitted whenever the resource name changes.
766  * @see resourceName
767  * @since 5.94
768  **/
769  void resourceNameChanged();
770 
771  /**
772  * This signal is emitted when the window has entered a new virtual desktop.
773  * The window can be on more than one desktop, or none: then is considered on all of them.
774  * @since 5.46
775  */
776  void plasmaVirtualDesktopEntered(const QString &id);
777 
778  /**
779  * This signal is emitted when the window left a virtual desktop.
780  * If the window leaves all desktops, it can be considered on all.
781  *
782  * @since 5.46
783  */
784  void plasmaVirtualDesktopLeft(const QString &id);
785 
786  /**
787  * This signal is emitted when the window has entered an activity.
788  * The window can be on more than one activity, or none: then is considered on all of them.
789  * @since 5.81
790  */
791  void plasmaActivityEntered(const QString &id);
792 
793  /**
794  * This signal is emitted when the window left an activity.
795  * If the window leaves all activities, it can be considered on all.
796  *
797  * @since 5.81
798  */
799  void plasmaActivityLeft(const QString &id);
800 
801  /**
802  * This signal is emitted when either the D-BUS service name or
803  * object path for the window's application menu changes.
804  *
805  * @since 5.69
806  **/
807  void applicationMenuChanged();
808 
809 private:
810  friend class PlasmaWindowManagement;
811  explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *activation, quint32 internalId, const char *uuid);
812  class Private;
814 };
815 
816 /**
817  * @since 5.86
818  */
819 class KWAYLANDCLIENT_EXPORT PlasmaActivation : public QObject
820 {
821  Q_OBJECT
822 public:
823  ~PlasmaActivation() override;
824 
825 Q_SIGNALS:
826  /**
827  * Informs about which application this activation is representing
828  *
829  * The @p appId can be used to infer how to decorate this activation.
830  */
831  void applicationId(const QString &appId);
832 
833  /**
834  * Notifies that the activation is done with.
835  *
836  * It might happen either because it's over or because it timed out.
837  */
838  void finished();
839 
840 private:
841  friend class PlasmaActivationFeedback;
842  explicit PlasmaActivation(PlasmaActivationFeedback *parent, org_kde_plasma_activation *activation);
843  class Private;
845 };
846 
847 /**
848  * @since 5.86
849  */
850 class KWAYLANDCLIENT_EXPORT PlasmaActivationFeedback : public QObject
851 {
852  Q_OBJECT
853 
854 public:
855  explicit PlasmaActivationFeedback(QObject *parent = nullptr);
856  ~PlasmaActivationFeedback() override;
857 
858  /**
859  * @returns @c true if managing a org_kde_plasma_activation_feedback.
860  **/
861  bool isValid() const;
862 
863  /**
864  * Releases the org_kde_plasma_activation_feedback interface.
865  * After the interface has been released the PlasmaActivationFeedback instance is no
866  * longer valid and can be setup with another org_kde_plasma_activation_feedback interface.
867  *
868  * Right before the interface is released the signal interfaceAboutToBeReleased is emitted.
869  * @see interfaceAboutToBeReleased
870  **/
871  void release();
872 
873  /**
874  * Destroys the data held by this PlasmaActivationFeedback.
875  * This method is supposed to be used when the connection to the Wayland
876  * server goes away. Once the connection becomes invalid, it's not
877  * possible to call release anymore as that calls into the Wayland
878  * connection and the call would fail. This method cleans up the data, so
879  * that the instance can be deleted or set up to a new org_kde_plasma_activation_feedback interface
880  * once there is a new connection available.
881  *
882  * This method is automatically invoked when the Registry which created this
883  * PlasmaActivationFeedback gets destroyed.
884  *
885  * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted.
886  *
887  * @see release
888  * @see interfaceAboutToBeDestroyed
889  **/
890  void destroy();
891 
892  /**
893  * Setup this PlasmaActivationFeedback to manage the @p manager.
894  * When using Registry::createPlasmaActivationFeedback there is no need to call this
895  * method.
896  **/
897  void setup(org_kde_plasma_activation_feedback *manager);
898 
899  /**
900  * Sets the @p queue to use for creating a PlasmaActivationFeedback.
901  **/
902  void setEventQueue(EventQueue *queue);
903 
904  /**
905  * @returns The event queue to use for creating a PlasmaActivationFeedback.
906  **/
907  EventQueue *eventQueue();
908 
909  operator org_kde_plasma_activation_feedback *();
910  operator org_kde_plasma_activation_feedback *() const;
911 
912 Q_SIGNALS:
913  /**
914  * This signal is emitted right before the interface is released.
915  **/
916  void interfaceAboutToBeReleased();
917 
918  /**
919  * This signal is emitted right before the data is destroyed.
920  **/
921  void interfaceAboutToBeDestroyed();
922 
923  /**
924  * The corresponding global for this interface on the Registry got removed.
925  *
926  * This signal gets only emitted if the Compositor got created by
927  * Registry::createPlasmaActivationFeedback
928  **/
929  void removed();
930 
931  void activation(KWayland::Client::PlasmaActivation *activation);
932 
933 private:
934  class Private;
936 };
937 }
938 }
939 
940 Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow *)
941 
942 #endif
Wrapper for the wl_output interface.
Definition: output.h:54
virtual void release(quint64 objid)
Wrapper for the wl_surface interface.
Definition: surface.h:43
Wrapper for the org_kde_plasma_window_management interface.
Exposes the window list and window state as a Qt item model.
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:54
Wrapper for the org_kde_plasma_window interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:50:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.