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  virtual ~PlasmaWindowManagement();
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  virtual ~PlasmaWindow();
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  /**
423  * Requests to activate the window.
424  **/
425  void requestActivate();
426  /**
427  * Requests to close the window.
428  **/
429  void requestClose();
430  /**
431  * Requests to start an interactive window move operation.
432  * @since 5.22
433  */
434  void requestMove();
435  /**
436  * Requests to start an interactive resize operation.
437  * @since 5.22
438  */
439  void requestResize();
440 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
441  /**
442  * Requests to send the window to virtual @p desktop.
443  * @deprecated: Since 5.52, use requestEnterVirtualDesktop instead
444  **/
445  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::requestEnterVirtualDesktop(const QString &)")
446  void requestVirtualDesktop(quint32 desktop);
447 #endif
448 
449  /**
450  * Requests the window at this model row index have its keep above state toggled.
451  * @since 5.35
452  */
453  void requestToggleKeepAbove();
454 
455  /**
456  * Requests the window at this model row index have its keep below state toggled.
457  * @since 5.35
458  */
459  void requestToggleKeepBelow();
460 
461  /**
462  * Requests the window at this model row index have its minimized state toggled.
463  */
464  void requestToggleMinimized();
465 
466  /**
467  * Requests the window at this model row index have its maximized state toggled.
468  */
469  void requestToggleMaximized();
470 
471  /**
472  * Sets the geometry of the taskbar entry for this window
473  * relative to a panel in particular
474  * @since 5.5
475  */
476  void setMinimizedGeometry(Surface *panel, const QRect &geom);
477 
478  /**
479  * Remove the task geometry information for a particular panel
480  * @since 5.5
481  */
482  void unsetMinimizedGeometry(Surface *panel);
483 
484  /**
485  * Requests the window at this model row index have its shaded state toggled.
486  * @since 5.22
487  */
488  void requestToggleShaded();
489 
490 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
491  /**
492  * An internal window identifier.
493  * This is not a global window identifier.
494  * This identifier does not correspond to QWindow::winId in any way.
495  *
496  * @deprecated Since 5.73, use uuid(const QString &) instead
497  */
498  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::uuid(const QString &)")
499  quint32 internalId() const;
500 #endif
501 
502  /**
503  * A unique identifier for the window
504  *
505  * @see QUuid
506  * @since 5.73
507  */
508  QByteArray uuid() const;
509 
510  /**
511  * The parent window of this PlasmaWindow.
512  *
513  * If there is a parent window, this window is a transient window for the
514  * parent window. If this method returns a null PlasmaWindow it means this
515  * window is a top level window and is not a transient window.
516  *
517  * @see parentWindowChanged
518  * @since 5.24
519  **/
520  QPointer<PlasmaWindow> parentWindow() const;
521 
522  /**
523  * @returns The window geometry in absolute coordinates.
524  * @see geometryChanged
525  * @since 5.25
526  **/
527  QRect geometry() const;
528 
529  /**
530  * Ask the server to make the window enter a virtual desktop.
531  * The server may or may not consent.
532  * A window can enter more than one virtual desktop.
533  *
534  * @since 5.52
535  */
536  void requestEnterVirtualDesktop(const QString &id);
537 
538  /**
539  * Make the window enter a new virtual desktop. If the server consents the request,
540  * it will create a new virtual desktop and assign the window to it.
541  * @since 5.52
542  */
543  void requestEnterNewVirtualDesktop();
544 
545  /**
546  * Ask the server to make the window the window exit a virtual desktop.
547  * The server may or may not consent.
548  * If it exits all desktops it will be considered on all of them.
549  *
550  * @since 5.52
551  */
552  void requestLeaveVirtualDesktop(const QString &id);
553 
554  /**
555  * Return all the virtual desktop ids this window is associated to.
556  * When a desktop gets deleted, it will be automatically removed from this list.
557  * If this list is empty, assume it's on all desktops.
558  *
559  * @since 5.52
560  */
561  QStringList plasmaVirtualDesktops() const;
562 
563  /**
564  * Ask the server to make the window enter an activity.
565  * The server may or may not consent.
566  * A window can enter more than one activity.
567  *
568  * @since 5.81
569  */
570  void requestEnterActivity(const QString &id);
571 
572  /**
573  * Ask the server to make the window exit an activity.
574  * The server may or may not consent.
575  * If it exits all activities it will be considered on all of them.
576  *
577  * @since 5.81
578  */
579  void requestLeaveActivity(const QString &id);
580 
581  /**
582  * Return all the activity ids this window is associated to.
583  * When an activity gets deleted, it will be automatically removed from this list.
584  * If this list is empty, assume it's on all activities.
585  *
586  * @since 5.81
587  */
588  QStringList plasmaActivities() const;
589 
590  /**
591  * Return the D-BUS service name for a window's
592  * application menu.
593  *
594  * @since 5.69
595  */
596  QString applicationMenuServiceName() const;
597  /**
598  * Return the D-BUS object path to a windows's
599  * application menu.
600  *
601  * @since 5.69
602  */
603  QString applicationMenuObjectPath() const;
604 
605  /**
606  * Sends the current window to @p output
607  *
608  * @since 5.86
609  */
610  void sendToOutput(KWayland::Client::Output *output) const;
611 
612 Q_SIGNALS:
613  /**
614  * The window title changed.
615  * @see title
616  **/
617  void titleChanged();
618  /**
619  * The application id changed.
620  * @see appId
621  **/
622  void appIdChanged();
623 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
624  /**
625  * The virtual desktop changed.
626  * @deprecated Since 5.52, use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead
627  **/
628  KWAYLANDCLIENT_DEPRECATED_VERSION(
629  5,
630  52,
631  "Use PlasmaWindow::plasmaVirtualDesktopEntered(const QString &) and PlasmaWindow::plasmaVirtualDesktopLeft(const QString &)")
632  void virtualDesktopChanged();
633 #endif
634  /**
635  * The window became active or inactive.
636  * @see isActive
637  **/
638  void activeChanged();
639  /**
640  * The fullscreen state changed.
641  * @see isFullscreen
642  **/
643  void fullscreenChanged();
644  /**
645  * The keep above state changed.
646  * @see isKeepAbove
647  **/
648  void keepAboveChanged();
649  /**
650  * The keep below state changed.
651  * @see isKeepBelow
652  **/
653  void keepBelowChanged();
654  /**
655  * The minimized state changed.
656  * @see isMinimized
657  **/
658  void minimizedChanged();
659  /**
660  * The maximized state changed.
661  * @see isMaximized
662  **/
663  void maximizedChanged();
664  /**
665  * The on all desktops state changed.
666  * @see isOnAllDesktops
667  **/
668  void onAllDesktopsChanged();
669  /**
670  * The demands attention state changed.
671  * @see isDemandingAttention
672  **/
673  void demandsAttentionChanged();
674  /**
675  * The closeable state changed.
676  * @see isCloseable
677  **/
678  void closeableChanged();
679  /**
680  * The minimizeable state changed.
681  * @see isMinimizeable
682  **/
683  void minimizeableChanged();
684  /**
685  * The maximizeable state changed.
686  * @see isMaximizeable
687  **/
688  void maximizeableChanged();
689  /**
690  * The fullscreenable state changed.
691  * @see isFullscreenable
692  **/
693  void fullscreenableChanged();
694  /**
695  * The skip taskbar state changed.
696  * @see skipTaskbar
697  **/
698  void skipTaskbarChanged();
699  /**
700  * The skip switcher state changed.
701  * @see skipSwitcher
702  **/
703  void skipSwitcherChanged();
704  /**
705  * The window icon changed.
706  * @see icon
707  **/
708  void iconChanged();
709  /**
710  * The shadeable state changed.
711  * @see isShadeable
712  * @since 5.22
713  */
714  void shadeableChanged();
715  /**
716  * The shaded state changed.
717  * @see isShaded
718  * @since 5.22
719  */
720  void shadedChanged();
721  /**
722  * The movable state changed.
723  * @see isMovable
724  * @since 5.22
725  */
726  void movableChanged();
727  /**
728  * The resizable state changed.
729  * @see isResizable
730  * @since 5.22
731  */
732  void resizableChanged();
733  /**
734  * The virtual desktop changeable state changed.
735  * @see virtualDesktopChangeable
736  * @since 5.22
737  */
738  void virtualDesktopChangeableChanged();
739  /**
740  * The window got unmapped and is no longer available to the Wayland server.
741  * This instance will be automatically deleted and one should connect to this
742  * signal to perform cleanup.
743  **/
744  void unmapped();
745  /**
746  * This signal is emitted whenever the parent window changes.
747  * @see parentWindow
748  * @since 5.24
749  **/
750  void parentWindowChanged();
751  /**
752  * This signal is emitted whenever the window geometry changes.
753  * @see geometry
754  * @since 5.25
755  **/
756  void geometryChanged();
757 
758  /**
759  * This signal is emitted when the window has entered a new virtual desktop.
760  * The window can be on more than one desktop, or none: then is considered on all of them.
761  * @since 5.46
762  */
763  void plasmaVirtualDesktopEntered(const QString &id);
764 
765  /**
766  * This signal is emitted when the window left a virtual desktop.
767  * If the window leaves all desktops, it can be considered on all.
768  *
769  * @since 5.46
770  */
771  void plasmaVirtualDesktopLeft(const QString &id);
772 
773  /**
774  * This signal is emitted when the window has entered an activity.
775  * The window can be on more than one activity, or none: then is considered on all of them.
776  * @since 5.81
777  */
778  void plasmaActivityEntered(const QString &id);
779 
780  /**
781  * This signal is emitted when the window left an activity.
782  * If the window leaves all activities, it can be considered on all.
783  *
784  * @since 5.81
785  */
786  void plasmaActivityLeft(const QString &id);
787 
788  /**
789  * This signal is emitted when either the D-BUS service name or
790  * object path for the window's application menu changes.
791  *
792  * @since 5.69
793  **/
794  void applicationMenuChanged();
795 
796 private:
797  friend class PlasmaWindowManagement;
798  explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *activation, quint32 internalId, const char *uuid);
799  class Private;
801 };
802 
803 /**
804  * @since 5.86
805  */
806 class KWAYLANDCLIENT_EXPORT PlasmaActivation : public QObject
807 {
808  Q_OBJECT
809 public:
810  virtual ~PlasmaActivation();
811 
812 Q_SIGNALS:
813  /**
814  * Informs about which application this activation is representing
815  *
816  * The @p appId can be used to infer how to decorate this activation.
817  */
818  void applicationId(const QString &appId);
819 
820  /**
821  * Notifies that the activation is done with.
822  *
823  * It might happen either because it's over or because it timed out.
824  */
825  void finished();
826 
827 private:
828  friend class PlasmaActivationFeedback;
829  explicit PlasmaActivation(PlasmaActivationFeedback *parent, org_kde_plasma_activation *activation);
830  class Private;
832 };
833 
834 /**
835  * @since 5.86
836  */
837 class KWAYLANDCLIENT_EXPORT PlasmaActivationFeedback : public QObject
838 {
839  Q_OBJECT
840 
841 public:
842  explicit PlasmaActivationFeedback(QObject *parent = nullptr);
843  ~PlasmaActivationFeedback() override;
844 
845  /**
846  * @returns @c true if managing a org_kde_plasma_activation_feedback.
847  **/
848  bool isValid() const;
849 
850  /**
851  * Releases the org_kde_plasma_activation_feedback interface.
852  * After the interface has been released the PlasmaActivationFeedback instance is no
853  * longer valid and can be setup with another org_kde_plasma_activation_feedback interface.
854  *
855  * Right before the interface is released the signal interfaceAboutToBeReleased is emitted.
856  * @see interfaceAboutToBeReleased
857  **/
858  void release();
859 
860  /**
861  * Destroys the data held by this PlasmaActivationFeedback.
862  * This method is supposed to be used when the connection to the Wayland
863  * server goes away. Once the connection becomes invalid, it's not
864  * possible to call release anymore as that calls into the Wayland
865  * connection and the call would fail. This method cleans up the data, so
866  * that the instance can be deleted or set up to a new org_kde_plasma_activation_feedback interface
867  * once there is a new connection available.
868  *
869  * This method is automatically invoked when the Registry which created this
870  * PlasmaActivationFeedback gets destroyed.
871  *
872  * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted.
873  *
874  * @see release
875  * @see interfaceAboutToBeDestroyed
876  **/
877  void destroy();
878 
879  /**
880  * Setup this PlasmaActivationFeedback to manage the @p manager.
881  * When using Registry::createPlasmaActivationFeedback there is no need to call this
882  * method.
883  **/
884  void setup(org_kde_plasma_activation_feedback *manager);
885 
886  /**
887  * Sets the @p queue to use for creating a PlasmaActivationFeedback.
888  **/
889  void setEventQueue(EventQueue *queue);
890 
891  /**
892  * @returns The event queue to use for creating a PlasmaActivationFeedback.
893  **/
894  EventQueue *eventQueue();
895 
896  operator org_kde_plasma_activation_feedback *();
897  operator org_kde_plasma_activation_feedback *() const;
898 
899 Q_SIGNALS:
900  /**
901  * This signal is emitted right before the interface is released.
902  **/
903  void interfaceAboutToBeReleased();
904 
905  /**
906  * This signal is emitted right before the data is destroyed.
907  **/
908  void interfaceAboutToBeDestroyed();
909 
910  /**
911  * The corresponding global for this interface on the Registry got removed.
912  *
913  * This signal gets only emitted if the Compositor got created by
914  * Registry::createPlasmaActivationFeedback
915  **/
916  void removed();
917 
918  void activation(KWayland::Client::PlasmaActivation *activation);
919 
920 private:
921  class Private;
923 };
924 }
925 }
926 
927 Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow *)
928 
929 #endif
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 wl_output interface.
Definition: output.h:54
Wrapper for the org_kde_plasma_window interface.
Wrapper for the wl_surface interface.
Definition: surface.h:43
Wrapper for the org_kde_plasma_window_management interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 22:52:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.