.TH "KCrash" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCrash \- This class handles segmentation-faults.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcrash.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef void(* \fBHandlerType\fP )(int)"
.br
.RI "\fIThis function type is a pointer to a crash handler function. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBdefaultCrashHandler\fP (int signal)"
.br
.RI "\fIThe default crash handler. \fP"
.ti -1c
.RI "void \fBsetCrashHandler\fP (\fBHandlerType\fP handler=defaultCrashHandler)"
.br
.RI "\fIInstall a function to be called in case a SIGSEGV is caught. \fP"
.ti -1c
.RI "\fBHandlerType\fP \fBcrashHandler\fP ()"
.br
.RI "\fIReturns the installed crash handler. \fP"
.ti -1c
.RI "void \fBsetEmergencySaveFunction\fP (\fBHandlerType\fP saveFunction=(\fBHandlerType\fP) 0)"
.br
.RI "\fIInstalls a function which should try to save the applications data. \fP"
.ti -1c
.RI "\fBHandlerType\fP \fBemergencySaveFunction\fP ()"
.br
.RI "\fIReturn the currently set emergency save function. \fP"
.ti -1c
.RI "void \fBsetApplicationPath\fP (\fBQString\fP path)"
.br
.RI "\fISets the application \fCpath\fP which should be passed to Dr. \fP"
.ti -1c
.RI "void \fBsetApplicationName\fP (\fBQString\fP name)"
.br
.RI "\fISets the application name \fCname\fP which should be passed to Dr. \fP"
.in -1c
.SS "Static Protected Attributes"

.in +1c
.ti -1c
.RI "\fBHandlerType\fP \fB_crashHandler\fP = 0"
.br
.RI "\fIPointer to the crash handler. \fP"
.ti -1c
.RI "\fBHandlerType\fP \fB_emergencySaveFunction\fP = 0"
.br
.RI "\fIPointer to the emergency save function. \fP"
.in -1c
.SH "Detailed Description"
.PP 
This class handles segmentation-faults. 

By default it displays a message-box saying the application crashed. This default can be overridden by setting a custom crash handler with \fBsetCrashHandler\fP(). If a function is specified with \fBsetEmergencySaveFunction\fP() it will be called by the default crash handler, giving the application a chance to save its data. 
.PP
Definition at line 36 of file kcrash.h.
.SH "Member Typedef Documentation"
.PP 
.SS "typedef void(* \fBKCrash::HandlerType\fP)(int)"
.PP
This function type is a pointer to a crash handler function. The function's argument is the number of the signal. Definition at line 53 of file kcrash.h.
.PP
Referenced by crashHandler(), emergencySaveFunction(), setCrashHandler(), and setEmergencySaveFunction().
.SH "Member Function Documentation"
.PP 
.SS "void KCrash::defaultCrashHandler (int signal)\fC [static]\fP"
.PP
The default crash handler. \fBParameters:\fP
.RS 4
\fIsignal\fP the signal number 
.RE
.PP
Definition at line 108 of file kcrash.cpp.
.PP
References _emergencySaveFunction, KInstance::aboutData(), KAboutData::bugAddress(), KStdAction::close(), DCOPClient::emergencyClose(), KNotifyClient::instance(), QString::isNull(), KAboutData::programName(), QCString::setNum(), QString::utf8(), and KAboutData::version().
.PP
Referenced by setEmergencySaveFunction().
.SS "void KCrash::setCrashHandler (\fBHandlerType\fP handler = defaultCrashHandler)\fC [static]\fP"
.PP
Install a function to be called in case a SIGSEGV is caught. \fBParameters:\fP
.RS 4
\fIHandlerType\fP handler can be one of 
.IP "\(bu" 2
null in which case signal-catching is disabled (by calling signal(SIGSEGV, SIG_DFL)) 
.IP "\(bu" 2
if handler is omitted the default crash handler is installed. 
.IP "\(bu" 2
an user defined function in the form: static (if in a class) void myCrashHandler(int); 
.PP
.br
\fIhandler\fP the crash handler 
.RE
.PP
Definition at line 77 of file kcrash.cpp.
.PP
References _crashHandler, and HandlerType.
.SS "\fBHandlerType\fP KCrash::crashHandler ()\fC [inline, static]\fP"
.PP
Returns the installed crash handler. \fBReturns:\fP
.RS 4
the crash handler 
.RE
.PP
Definition at line 72 of file kcrash.h.
.PP
References _crashHandler, and HandlerType.
.SS "void KCrash::setEmergencySaveFunction (\fBHandlerType\fP saveFunction = (\fBHandlerType\fP) 0)\fC [static]\fP"
.PP
Installs a function which should try to save the applications data. It is the crash handler´s responsibility to call this function. Therefore, if no crash handler is set, the default crash handler is installed to ensure the save function is called. 
.PP
\fBParameters:\fP
.RS 4
\fIsaveFunction\fP the handler to install 
.RE
.PP
Definition at line 61 of file kcrash.cpp.
.PP
References _crashHandler, _emergencySaveFunction, defaultCrashHandler(), and HandlerType.
.SS "\fBHandlerType\fP KCrash::emergencySaveFunction ()\fC [inline, static]\fP"
.PP
Return the currently set emergency save function. \fBReturns:\fP
.RS 4
the emergency save function 
.RE
.PP
Definition at line 86 of file kcrash.h.
.PP
References _emergencySaveFunction, and HandlerType.
.SS "void KCrash::setApplicationPath (\fBQString\fP path)\fC [inline, static]\fP"
.PP
Sets the application \fCpath\fP which should be passed to Dr. Konqi, our nice crash display application. 
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP the application path. 
.RE
.PP
Definition at line 93 of file kcrash.h.
.PP
References QString::local8Bit().
.SS "void KCrash::setApplicationName (\fBQString\fP name)\fC [inline, static]\fP"
.PP
Sets the application name \fCname\fP which should be passed to Dr. Konqi, our nice crash display application. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the application, as shown in Dr. Konqi 
.RE
.PP
Definition at line 100 of file kcrash.h.
.PP
References KStdAction::name().
.SH "Member Data Documentation"
.PP 
.SS "\fBKCrash::HandlerType\fP \fBKCrash::_crashHandler\fP = 0\fC [static, protected]\fP"
.PP
Pointer to the crash handler. Definition at line 53 of file kcrash.cpp.
.PP
Referenced by crashHandler(), setCrashHandler(), and setEmergencySaveFunction().
.SS "\fBKCrash::HandlerType\fP \fBKCrash::_emergencySaveFunction\fP = 0\fC [static, protected]\fP"
.PP
Pointer to the emergency save function. Definition at line 52 of file kcrash.cpp.
.PP
Referenced by defaultCrashHandler(), emergencySaveFunction(), and setEmergencySaveFunction().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
