kdecore Library API Documentation

kxmessages.h

00001 /****************************************************************************
00002 
00003  $Id: kxmessages.h,v 1.12 2004/11/15 22:43:22 mueller 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 #include <kdelibs_export.h>
00034 #ifdef Q_WS_X11
00035 #include <X11/X.h>
00036 
00037 class QString;
00038 
00039 class KXMessagesPrivate;
00049 // KDE4 - make this internal for KStartupInfo only?
00050 class KDECORE_EXPORT KXMessages
00051     : public QWidget
00052     {
00053     Q_OBJECT
00054     public:
00064         KXMessages( const char* accept_broadcast, QWidget* parent, bool obsolete );
00069         KXMessages( const char* accept_broadcast = NULL, QWidget* parent = NULL );
00070 
00071         virtual ~KXMessages();
00082         void sendMessage( WId w, const char* msg_type, const QString& message,
00083             bool obsolete );
00088         void sendMessage( WId w, const char* msg_type, const QString& message );
00097         void broadcastMessage( const char* msg_type, const QString& message,
00098             int screen, bool obsolete );
00103         void broadcastMessage( const char* msg_type, const QString& message );
00104 
00118         static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00119             const QString& message, bool obsolete );
00124         static bool sendMessageX( Display* disp, WId w, const char* msg_type,
00125             const QString& message );
00126 
00139         static bool broadcastMessageX( Display* disp, const char* msg_type,
00140             const QString& message, int screen, bool obsolete );
00145         static bool broadcastMessageX( Display* disp, const char* msg_type,
00146             const QString& message );
00147     signals:
00152         void gotMessage( const QString& message );
00153     protected:
00157         virtual bool x11Event( XEvent* ev );
00158     private:
00159         static void send_message_internal( WId w_P, const QString& msg_P, long mask_P,
00160             Display* disp, Atom atom1_P, Atom atom2_P, Window handle_P );
00161         QWidget* handle;
00162         Atom accept_atom2;
00163         QCString cached_atom_name_; // KDE4 unused
00164         Atom accept_atom1;
00165         QMap< WId, QCString > incoming_messages;
00166         KXMessagesPrivate* d;
00167     };
00168 
00169 #endif
00170 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:09:41 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003