kdecore Library API Documentation

kxmessages.h

00001 /****************************************************************************
00002 
00003  $Id: kxmessages.h,v 1.8 2002/09/09 20:40:54 tjansen Exp $
00004 
00005  Copyright (C) 2001 Lubos Lunak        <l.lunak@kde.org>
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a
00008 copy of this software and associated documentation files (the "Software"),
00009 to deal in the Software without restriction, including without limitation
00010 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011 and/or sell copies of the Software, and to permit persons to whom the
00012 Software is furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00022 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023 DEALINGS IN THE SOFTWARE.
00024 
00025 ****************************************************************************/
00026 
00027 #ifndef __KXMESSAGES_H
00028 #define __KXMESSAGES_H
00029 
00030 #include <qwidget.h>
00031 #include <qcstring.h>
00032 #include <qmap.h>
00033 #ifdef Q_WS_X11
00034 #include <X11/X.h>
00035 
00036 class QString;
00037 
00038 class KXMessagesPrivate;
00048 class KXMessages
00049     : public QWidget
00050     {
00051     Q_OBJECT
00052     public:
00060     // CHECKME accept_broadcast == NULL is useless now
00061         KXMessages( const char* accept_broadcast = NULL, QWidget* parent = NULL );
00062         virtual ~KXMessages();
00071         void sendMessage( WId w, const char* msg_type, const QString& message );
00077         void broadcastMessage( const char* msg_type, const QString& message );
00078 
00090         static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00091             const QString& message );
00092 
00102         static bool broadcastMessageX( Display* disp, const char* msg_type,
00103             const QString& message );
00104     signals:
00109         void gotMessage( const QString& message );
00110     protected:
00114         virtual bool x11Event( XEvent* ev );
00115     private:
00116         static void send_message_internal( WId w_P, const QString& msg_P, long mask_P,
00117             Display* disp, Atom atom_P, Window handle_P );
00118         QWidget* handle;
00119         Atom cached_atom;
00120         QCString cached_atom_name;
00121         Atom accept_atom;
00122         QMap< WId, QCString > incoming_messages;
00123         KXMessagesPrivate* d;
00124     };
00125 
00126 #endif
00127 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:14:48 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001