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 <QObject>
10 #include <QIcon>
11 #include <QSize>
12 
13 #include <KWayland/Client/kwaylandclient_export.h>
14 
15 struct org_kde_plasma_window_management;
16 struct org_kde_plasma_window;
17 
18 namespace KWayland
19 {
20 namespace Client
21 {
22 class EventQueue;
23 class PlasmaWindow;
24 class PlasmaWindowModel;
25 class Surface;
26 class PlasmaVirtualDesktop;
27 
58 class KWAYLANDCLIENT_EXPORT PlasmaWindowManagement : public QObject
59 {
60  Q_OBJECT
61 public:
62  explicit PlasmaWindowManagement(QObject *parent = nullptr);
63  virtual ~PlasmaWindowManagement();
64 
68  bool isValid() const;
77  void release();
95  void destroy();
101  void setup(org_kde_plasma_window_management *shell);
102 
106  void setEventQueue(EventQueue *queue);
110  EventQueue *eventQueue();
111 
112  operator org_kde_plasma_window_management*();
113  operator org_kde_plasma_window_management*() const;
114 
123  bool isShowingDesktop() const;
130  void setShowingDesktop(bool show);
135  void showDesktop();
140  void hideDesktop();
141 
146  QList<PlasmaWindow*> windows() const;
152  PlasmaWindow *activeWindow() const;
157  PlasmaWindowModel *createWindowModel();
158 
159 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
160 
165  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuids()")
166  QVector<quint32> stackingOrder() const;
167 #endif
168 
174  QVector<QByteArray> stackingOrderUuids() const;
175 
176 Q_SIGNALS:
180  void interfaceAboutToBeReleased();
184  void interfaceAboutToBeDestroyed();
189  void showingDesktopChanged(bool);
190 
195  void windowCreated(KWayland::Client::PlasmaWindow *window);
200  void activeWindowChanged();
201 
210  void removed();
211 
212 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
213 
218  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuidsChanged()")
219  void stackingOrderChanged();
220 #endif
221 
226  void stackingOrderUuidsChanged();
227 
228 private:
229  class Private;
231 };
232 
247 class KWAYLANDCLIENT_EXPORT PlasmaWindow : public QObject
248 {
249  Q_OBJECT
250 public:
251  virtual ~PlasmaWindow();
252 
258  void release();
275  void destroy();
279  bool isValid() const;
280 
281  operator org_kde_plasma_window*();
282  operator org_kde_plasma_window*() const;
283 
288  QString title() const;
293  QString appId() const;
294 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
295 
300  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktops()")
301  quint32 virtualDesktop() const;
302 #endif
303 
307  bool isActive() const;
312  bool isFullscreen() const;
317  bool isKeepAbove() const;
322  bool isKeepBelow() const;
327  bool isMinimized() const;
332  bool isMaximized() const;
338  bool isOnAllDesktops() const;
343  bool isDemandingAttention() const;
348  bool isCloseable() const;
353  bool isMaximizeable() const;
358  bool isMinimizeable() const;
363  bool isFullscreenable() const;
368  bool skipTaskbar() const;
373  bool skipSwitcher() const;
378  QIcon icon() const;
385  bool isShadeable() const;
391  bool isShaded() const;
397  bool isMovable() const;
403  bool isResizable() const;
409  bool isVirtualDesktopChangeable() const;
415  quint32 pid() const;
416 
420  void requestActivate();
424  void requestClose();
429  void requestMove();
434  void requestResize();
435 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
436 
440  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::requestEnterVirtualDesktop(const QString &)")
441  void requestVirtualDesktop(quint32 desktop);
442 #endif
443 
448  void requestToggleKeepAbove();
449 
454  void requestToggleKeepBelow();
455 
459  void requestToggleMinimized();
460 
464  void requestToggleMaximized();
465 
471  void setMinimizedGeometry(Surface *panel, const QRect &geom);
472 
477  void unsetMinimizedGeometry(Surface *panel);
478 
483  void requestToggleShaded();
484 
485 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73)
486 
493  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::uuid(const QString &)")
494  quint32 internalId() const;
495 #endif
496 
503  QByteArray uuid() const;
504 
515  QPointer<PlasmaWindow> parentWindow() const;
516 
522  QRect geometry() const;
523 
531  void requestEnterVirtualDesktop(const QString &id);
532 
538  void requestEnterNewVirtualDesktop();
539 
547  void requestLeaveVirtualDesktop(const QString &id);
548 
556  QStringList plasmaVirtualDesktops() const;
557 
564  QString applicationMenuServiceName() const;
571  QString applicationMenuObjectPath() const;
572 
573 Q_SIGNALS:
578  void titleChanged();
583  void appIdChanged();
584 #if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52)
585 
589  KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktopEntered(const QString &) and PlasmaWindow::plasmaVirtualDesktopLeft(const QString &)")
590  void virtualDesktopChanged();
591 #endif
592 
596  void activeChanged();
601  void fullscreenChanged();
606  void keepAboveChanged();
611  void keepBelowChanged();
616  void minimizedChanged();
621  void maximizedChanged();
626  void onAllDesktopsChanged();
631  void demandsAttentionChanged();
636  void closeableChanged();
641  void minimizeableChanged();
646  void maximizeableChanged();
651  void fullscreenableChanged();
656  void skipTaskbarChanged();
661  void skipSwitcherChanged();
666  void iconChanged();
672  void shadeableChanged();
678  void shadedChanged();
684  void movableChanged();
690  void resizableChanged();
696  void virtualDesktopChangeableChanged();
702  void unmapped();
708  void parentWindowChanged();
714  void geometryChanged();
715 
721  void plasmaVirtualDesktopEntered(const QString &id);
722 
729  void plasmaVirtualDesktopLeft(const QString &id);
730 
737  void applicationMenuChanged();
738 
739 private:
740  friend class PlasmaWindowManagement;
741  explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *dataOffer, quint32 internalId, const char *uuid);
742  class Private;
744 };
745 
746 }
747 }
748 
749 Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow*)
750 
751 #endif
Exposes the window list and window state as a Qt item model.
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the org_kde_plasma_window interface.
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the org_kde_plasma_window_management interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:18 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.