KWindowSystem

kxmessages.h
1 /*
2  SPDX-FileCopyrightText: 2001-2003 Lubos Lunak <[email protected]>
3 
4  SPDX-License-Identifier: MIT
5 */
6 
7 #ifndef KXMESSAGES_H
8 #define KXMESSAGES_H
9 
10 #include <kwindowsystem_export.h>
11 #include <QObject>
12 #include <QMap>
13 
14 #include <config-kwindowsystem.h> // KWINDOWSYSTEM_HAVE_X11
15 #if KWINDOWSYSTEM_HAVE_X11
16 #include <xcb/xcb.h>
17 typedef struct _XDisplay Display;
18 
19 class QString;
20 
21 class KXMessagesPrivate;
22 
33 class KWINDOWSYSTEM_EXPORT KXMessages : public QObject
34 {
35  Q_OBJECT
36 public:
44  explicit KXMessages(const char *accept_broadcast = nullptr, QObject *parent = nullptr);
45 
57  explicit KXMessages(xcb_connection_t *connection, xcb_window_t rootWindow, const char *accept_broadcast = nullptr, QObject *parent = nullptr);
58 
59  ~KXMessages() override;
66  void broadcastMessage(const char *msg_type, const QString &message, int screen = -1);
67 // Not 5.0, as KStartupInfo::sendStartupX uses this, and is only deprecated for 5.18
68 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 18)
69 
80  KWINDOWSYSTEM_DEPRECATED_VERSION(5, 0, "Use KXMessages::broadcastMessageX(xcb_connection_t *, const char *, const QString &, int)")
81  static bool broadcastMessageX(Display *disp, const char *msg_type,
82  const QString &message, int screen = -1);
83 #endif
84 
94  static bool broadcastMessageX(xcb_connection_t *c, const char *msg_type,
95  const QString &message, int screenNumber);
96 
97 #if 0 // currently unused
98 
106  void sendMessage(WId w, const char *msg_type, const QString &message);
118  static bool sendMessageX(Display *disp, WId w, const char *msg_type,
119  const QString &message);
120 #endif
121 
122 Q_SIGNALS:
127  void gotMessage(const QString &message);
128 private:
129  friend class KXMessagesPrivate;
130  KXMessagesPrivate *const d;
131 };
132 
133 #endif
134 #endif
Sending string messages to other applications using the X Client Messages.
Definition: kxmessages.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:41:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.