00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef __KCRASH_H
00023
#define __KCRASH_H
00024
00025
#include <qstring.h>
00026
#include "kdelibs_export.h"
00027
00037 class KDECORE_EXPORT KCrash
00038 {
00039
private:
00040
static const char *appName;
00041
static const char *appPath;
00042
static bool safer;
00043
00044
public:
00049
static void defaultCrashHandler (
int signal);
00050
00055 typedef void (*HandlerType)(
int);
00056
00068
static void setCrashHandler (HandlerType handler = defaultCrashHandler);
00069
00074 static HandlerType crashHandler() {
return _crashHandler; }
00075
00083
static void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)0);
00088 static HandlerType emergencySaveFunction() {
return _emergencySaveFunction; }
00089
00093 static void setSafer(
bool on ) { safer = on; }
00094
00100 static void setApplicationPath (
QString path) { appPath = qstrdup(path.
local8Bit().data()); }
00101
00102
00108 static void setApplicationName (
QString name) { appName = qstrdup(name.local8Bit().data()); }
00109
00110
00111
protected:
00115
static HandlerType _crashHandler;
00119
static HandlerType _emergencySaveFunction;
00120 };
00121
00122
#endif
00123