KWayland

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 #ifndef KWAYLAND_SERVER_APPMENU_INTERFACE_H
7 #define KWAYLAND_SERVER_APPMENU_INTERFACE_H
8 
9 #include "global.h"
10 #include "resource.h"
11 
12 #include <KWayland/Server/kwaylandserver_export.h>
13 
14 namespace KWayland
15 {
16 namespace Server
17 {
18 class Display;
19 class SurfaceInterface;
20 class AppMenuInterface;
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  * @since 5.42
28  */
29 class KWAYLANDSERVER_EXPORT AppMenuManagerInterface : public Global
30 {
31  Q_OBJECT
32 public:
33  virtual ~AppMenuManagerInterface();
34  /**
35  * Returns any existing appMenu for a given surface
36  * This returns a null pointer if no AppMenuInterface exists.
37  */
38  AppMenuInterface *appMenuForSurface(SurfaceInterface *);
39 
40 Q_SIGNALS:
41  /**
42  * Emitted whenever a new AppmenuInterface is created.
43  **/
44  void appMenuCreated(KWayland::Server::AppMenuInterface *);
45 
46 private:
47  explicit AppMenuManagerInterface(Display *display, QObject *parent = nullptr);
48  friend class Display;
49  class Private;
50  Private *d_func() const;
51 };
52 
53 /**
54  * Provides the DBus service name and object path to a AppMenu DBus interface.
55  * This interface is attached to a wl_surface and provides access to where
56  * the AppMenu DBus interface is registered.
57  * @since 5.42
58  */
59 class KWAYLANDSERVER_EXPORT AppMenuInterface : public Resource
60 {
61  Q_OBJECT
62 public:
63  /**
64  * Structure containing DBus service name and path
65  */
67  /** Service name of host with the AppMenu object*/
69  /** Object path of the AppMenu interface*/
71  };
72  virtual ~AppMenuInterface();
73 
74  /**
75  * @returns the service name and object path or empty strings if unset
76  */
77  InterfaceAddress address() const;
78 
79  /**
80  * @returns The SurfaceInterface this AppmenuInterface references.
81  **/
82  SurfaceInterface *surface() const;
83 
84 Q_SIGNALS:
85  /**
86  * Emitted when the address changes or is first received
87  */
89 
90 private:
91  explicit AppMenuInterface(AppMenuManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource);
92  friend class AppMenuManagerInterface;
93 
94  class Private;
95  Private *d_func() const;
96 };
97 
98 }
99 }
100 
101 #endif
QString objectPath
Object path of the AppMenu interface.
QString serviceName
Service name of host with the AppMenu object.
Resource representing a wl_surface.
Provides the DBus service name and object path to a AppMenu DBus interface.
Class holding the Wayland server display loop.
Definition: display.h:86
Base class for all Globals.
Definition: global.h:46
Structure containing DBus service name and path.
Represents a bound Resource.
Definition: resource.h:31
Provides the DBus service name and object path to a AppMenu DBus interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Sep 23 2021 22:51:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.