KDECore
kxmessages.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __KXMESSAGES_H
00026 #define __KXMESSAGES_H
00027
00028 #include <qwidget.h>
00029 #include <qcstring.h>
00030 #include <qmap.h>
00031 #include <kdelibs_export.h>
00032 #ifdef Q_WS_X11
00033 #include <X11/X.h>
00034
00035 class QString;
00036
00037 class KXMessagesPrivate;
00046
00047 class KDECORE_EXPORT KXMessages
00048 : public QWidget
00049 {
00050 Q_OBJECT
00051 public:
00061 KXMessages( const char* accept_broadcast, QWidget* parent, bool obsolete );
00066 KXMessages( const char* accept_broadcast = NULL, QWidget* parent = NULL );
00067
00068 virtual ~KXMessages();
00079 void sendMessage( WId w, const char* msg_type, const QString& message,
00080 bool obsolete );
00085 void sendMessage( WId w, const char* msg_type, const QString& message );
00094 void broadcastMessage( const char* msg_type, const QString& message,
00095 int screen, bool obsolete );
00100 void broadcastMessage( const char* msg_type, const QString& message );
00101
00115 static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00116 const QString& message, bool obsolete );
00121 static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00122 const QString& message );
00123
00136 static bool broadcastMessageX( Display* disp, const char* msg_type,
00137 const QString& message, int screen, bool obsolete );
00142 static bool broadcastMessageX( Display* disp, const char* msg_type,
00143 const QString& message );
00144 signals:
00149 void gotMessage( const QString& message );
00150 protected:
00154 virtual bool x11Event( XEvent* ev );
00155 private:
00156 static void send_message_internal( WId w_P, const QString& msg_P, long mask_P,
00157 Display* disp, Atom atom1_P, Atom atom2_P, Window handle_P );
00158 QWidget* handle;
00159 Atom accept_atom2;
00160 QCString cached_atom_name_;
00161 Atom accept_atom1;
00162 QMap< WId, QCString > incoming_messages;
00163 KXMessagesPrivate* d;
00164 };
00165
00166 #endif
00167 #endif