kdecore Library API Documentation

kxmessages.h

00001 /****************************************************************************
00002 
00003  $Id: kxmessages.h,v 1.11 2003/10/10 11:20:54 lunakl Exp $
00004 
00005  Copyright (C) 2001-2003 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 // KDE4 - make this internal for KStartupInfo only?
00049 class KXMessages
00050     : public QWidget
00051     {
00052     Q_OBJECT
00053     public:
00063         KXMessages( const char* accept_broadcast, QWidget* parent, bool obsolete );
00068         KXMessages( const char* accept_broadcast = NULL, QWidget* parent = NULL );
00069 
00070         virtual ~KXMessages();
00081         void sendMessage( WId w, const char* msg_type, const QString& message,
00082             bool obsolete );
00087         void sendMessage( WId w, const char* msg_type, const QString& message );
00096         void broadcastMessage( const char* msg_type, const QString& message,
00097             int screen, bool obsolete );
00102         void broadcastMessage( const char* msg_type, const QString& message );
00103 
00117         static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00118             const QString& message, bool obsolete );
00123         static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00124             const QString& message );
00125 
00138         static bool broadcastMessageX( Display* disp, const char* msg_type,
00139             const QString& message, int screen, bool obsolete );
00144         static bool broadcastMessageX( Display* disp, const char* msg_type,
00145             const QString& message );
00146     signals:
00151         void gotMessage( const QString& message );
00152     protected:
00156         virtual bool x11Event( XEvent* ev );
00157     private:
00158         static void send_message_internal( WId w_P, const QString& msg_P, long mask_P,
00159             Display* disp, Atom atom1_P, Atom atom2_P, Window handle_P );
00160         QWidget* handle;
00161         Atom accept_atom2;
00162         QCString cached_atom_name_; // KDE4 unused
00163         Atom accept_atom1;
00164         QMap< WId, QCString > incoming_messages;
00165         KXMessagesPrivate* d;
00166     };
00167 
00168 #endif
00169 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 22 14:23:03 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003