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 
19 class Display;
20 class SurfaceInterface;
21 class AppMenuInterface;
22 
23 /**
24  * Provides the DBus service name and object path to a AppMenu DBus interface.
25  *
26  * This global can be used for clients to bind AppmenuInterface instances
27  * and notifies when a new one is created
28  * @since 5.42
29  */
30 class KWAYLANDSERVER_EXPORT AppMenuManagerInterface : public Global
31 {
32  Q_OBJECT
33 public:
34  virtual ~AppMenuManagerInterface();
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(KWayland::Server::AppMenuInterface*);
46 
47 private:
48  explicit AppMenuManagerInterface(Display *display, QObject *parent = nullptr);
49  friend class Display;
50  class Private;
51  Private *d_func() const;
52 };
53 
54 /**
55  * Provides the DBus service name and object path to a AppMenu DBus interface.
56  * This interface is attached to a wl_surface and provides access to where
57  * the AppMenu DBus interface is registered.
58  * @since 5.42
59  */
60 class KWAYLANDSERVER_EXPORT AppMenuInterface : public Resource
61 {
62  Q_OBJECT
63 public:
64  /**
65  * Structure containing DBus service name and path
66  */
68  /** Service name of host with the AppMenu object*/
70  /** Object path of the AppMenu interface*/
72  };
73  virtual ~AppMenuInterface();
74 
75  /**
76  * @returns the service name and object path or empty strings if unset
77  */
78  InterfaceAddress address() const;
79 
80  /**
81  * @returns The SurfaceInterface this AppmenuInterface references.
82  **/
83  SurfaceInterface *surface() const;
84 
85 Q_SIGNALS:
86  /**
87  * Emitted when the address changes or is first received
88  */
90 
91 private:
92  explicit AppMenuInterface(AppMenuManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource);
93  friend class AppMenuManagerInterface;
94 
95  class Private;
96  Private *d_func() const;
97 };
98 
99 }
100 }
101 
102 #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:89
Base class for all Globals.
Definition: global.h:46
Structure containing DBus service name and path.
Represents a bound Resource.
Definition: resource.h:32
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 Mar 4 2021 22:51:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.