KWayland

xdgdecoration.h
1 /*
2  SPDX-FileCopyrightText: 2018 David Edmundson <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef KWAYLAND_CLIENT_XDG_DECORATION_UNSTABLE_V1_H
7 #define KWAYLAND_CLIENT_XDG_DECORATION_UNSTABLE_V1_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct zxdg_decoration_manager_v1;
14 struct zxdg_toplevel_decoration_v1;
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class EventQueue;
22 class XdgDecoration;
23 class XdgShellSurface;
24 
51 class KWAYLANDCLIENT_EXPORT XdgDecorationManager : public QObject
52 {
53  Q_OBJECT
54 public:
61  explicit XdgDecorationManager(QObject *parent = nullptr);
62  virtual ~XdgDecorationManager();
63 
69  void setup(zxdg_decoration_manager_v1 *xdgdecorationmanager);
73  bool isValid() const;
79  void release();
96  void destroy();
97 
101  void setEventQueue(EventQueue *queue);
105  EventQueue *eventQueue();
106 
107  XdgDecoration *getToplevelDecoration(XdgShellSurface *toplevel, QObject *parent = nullptr);
108 
109  operator zxdg_decoration_manager_v1*();
110  operator zxdg_decoration_manager_v1*() const;
111 
112 Q_SIGNALS:
119  void removed();
120 
121 private:
122  class Private;
124 };
125 
126 class KWAYLANDCLIENT_EXPORT XdgDecoration : public QObject
127 {
128  Q_OBJECT
129 public:
130  enum class Mode {
131  ClientSide,
132  ServerSide
133  };
134 
135  Q_ENUM(Mode)
136 
137  virtual ~XdgDecoration();
138 
144  void setup(zxdg_toplevel_decoration_v1 *xdgdecoration);
148  bool isValid() const;
154  void release();
171  void destroy();
172 
177  void setMode(Mode mode);
178 
182  void unsetMode();
183 
187  Mode mode() const;
188 
189  operator zxdg_toplevel_decoration_v1*();
190  operator zxdg_toplevel_decoration_v1*() const;
191 
192 Q_SIGNALS:
193  void modeChanged(KWayland::Client::XdgDecoration::Mode mode);
194 
195 private:
196  friend class XdgDecorationManager;
197  explicit XdgDecoration(QObject *parent = nullptr);
198  class Private;
200 };
201 
202 
203 }
204 }
205 
206 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the zxdg_decoration_manager_v1 interface.
Definition: xdgdecoration.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 22:50:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.