KDEUI
kxerrorhandler.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 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 explicit KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = QX11Info::display()) KDE_DEPRECATED;
00092 bool error( bool sync ) const;
00098 XErrorEvent errorEvent() const;
00104 static QByteArray errorMessage( const XErrorEvent& e, Display* dpy = QX11Info::display());
00105 ~KXErrorHandler();
00106 private:
00107 void addHandler();
00108 int handle( Display* dpy, XErrorEvent* e );
00109 bool (*user_handler1)( int request, int error_code, unsigned long resource_id );
00110 int (*user_handler2)( Display*, XErrorEvent* );
00111 int (*old_handler)( Display*, XErrorEvent* );
00112 static int handler_wrapper( Display*, XErrorEvent* );
00113 static KXErrorHandler** handlers;
00114 static int pos;
00115 static int size;
00116 Q_DISABLE_COPY( KXErrorHandler )
00117 KXErrorHandlerPrivate * const d;
00118 };
00119
00120 #endif // Q_WS_X11
00121
00122 #endif