KWaylandServer

appmenu_interface.h
1 /*
2  SPDX-FileCopyrightText: 2017 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 #pragma once
7 
8 #include <KWaylandServer/kwaylandserver_export.h>
9 #include <QObject>
10 
11 struct wl_resource;
12 
13 namespace KWaylandServer
14 {
15 class Display;
16 class SurfaceInterface;
17 class AppMenuInterface;
18 
19 class AppMenuManagerInterfacePrivate;
20 class AppMenuInterfacePrivate;
21 
22 /**
23  * Provides the DBus service name and object path to a AppMenu DBus interface.
24  *
25  * This global can be used for clients to bind AppmenuInterface instances
26  * and notifies when a new one is created
27  */
28 class KWAYLANDSERVER_EXPORT AppMenuManagerInterface : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  explicit AppMenuManagerInterface(Display *display, QObject *parent = nullptr);
34  ~AppMenuManagerInterface() override;
35  /**
36  * Returns any existing appMenu for a given surface
37  * This returns a null pointer if no AppMenuInterface exists.
38  */
39  AppMenuInterface *appMenuForSurface(SurfaceInterface *);
40 
41 Q_SIGNALS:
42  /**
43  * Emitted whenever a new AppmenuInterface is created.
44  */
45  void appMenuCreated(KWaylandServer::AppMenuInterface *);
46 
47 private:
49 };
50 
51 /**
52  * Provides the DBus service name and object path to a AppMenu DBus interface.
53  * This interface is attached to a wl_surface and provides access to where
54  * the AppMenu DBus interface is registered.
55  */
56 class KWAYLANDSERVER_EXPORT AppMenuInterface : public QObject
57 {
58  Q_OBJECT
59 public:
60  /**
61  * Structure containing DBus service name and path
62  */
64  /** Service name of host with the AppMenu object*/
66  /** Object path of the AppMenu interface*/
68  };
69  ~AppMenuInterface() override;
70 
71  /**
72  * @returns the service name and object path or empty strings if unset
73  */
74  InterfaceAddress address() const;
75 
76  /**
77  * @returns The SurfaceInterface this AppmenuInterface references.
78  */
79  SurfaceInterface *surface() const;
80 
81 Q_SIGNALS:
82  /**
83  * Emitted when the address changes or is first received
84  */
86 
87 private:
88  explicit AppMenuInterface(SurfaceInterface *s, wl_resource *resource);
89  friend class AppMenuManagerInterfacePrivate;
90 
92 };
93 
94 }
Class holding the Wayland server display loop.
Definition: display.h:47
QString serviceName
Service name of host with the AppMenu object.
Provides the DBus service name and object path to a AppMenu DBus interface.
Structure containing DBus service name and path.
Provides the DBus service name and object path to a AppMenu DBus interface.
QString objectPath
Object path of the AppMenu interface.
Resource representing a wl_surface.
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.