KDEUI
kxerrorhandler.h
Go to the documentation of this file.
00001 /* 00002 00003 Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org> 00004 00005 Permission is hereby granted, free of charge, to any person obtaining a 00006 copy of this software and associated documentation files (the "Software"), 00007 to deal in the Software without restriction, including without limitation 00008 the rights to use, copy, modify, merge, publish, distribute, sublicense, 00009 and/or sell copies of the Software, and to permit persons to whom the 00010 Software is furnished to do so, subject to the following conditions: 00011 00012 The above copyright notice and this permission notice shall be included in 00013 all copies or substantial portions of the Software. 00014 00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00018 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00020 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00021 DEALINGS IN THE SOFTWARE. 00022 00023 */ 00024 00025 #ifndef KXERRORHANDLER_H 00026 #define KXERRORHANDLER_H 00027 00028 #include <QtGui/QWidget> 00029 #include <QtGui/QWidgetList> 00030 00031 #ifdef Q_WS_X11 00032 00033 #include <kdeui_export.h> 00034 #include <QtGui/QX11Info> 00035 #include <X11/Xlib.h> 00036 00037 class KXErrorHandlerPrivate; 00062 class KDEUI_EXPORT KXErrorHandler 00063 { 00064 public: 00069 explicit KXErrorHandler( Display* dpy = QX11Info::display()); 00076 explicit KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = QX11Info::display()); 00083 #ifndef KDE_NO_DEPRECATED 00084 explicit KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = QX11Info::display()) KDE_DEPRECATED; 00085 #endif 00086 00094 bool error( bool sync ) const; 00100 XErrorEvent errorEvent() const; 00106 static QByteArray errorMessage( const XErrorEvent& e, Display* dpy = QX11Info::display()); 00107 ~KXErrorHandler(); 00108 private: 00109 void addHandler(); 00110 int handle( Display* dpy, XErrorEvent* e ); 00111 bool (*user_handler1)( int request, int error_code, unsigned long resource_id ); 00112 int (*user_handler2)( Display*, XErrorEvent* ); 00113 int (*old_handler)( Display*, XErrorEvent* ); 00114 static int handler_wrapper( Display*, XErrorEvent* ); 00115 static KXErrorHandler** handlers; 00116 static int pos; 00117 static int size; 00118 Q_DISABLE_COPY( KXErrorHandler ) 00119 KXErrorHandlerPrivate * const d; 00120 }; 00121 00122 #endif // Q_WS_X11 00123 00124 #endif
KDE 4.6 API Reference