/***************************************************************************
                            KCrash.java -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

package org.kde.koala;

import org.kde.qt.*;
import java.util.*;
import java.lang.Error;

/**

 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
 {@link #setCrashHandler}.
 If a function is specified with {@link #setEmergencySaveFunction} it will
 be called by the default crash handler, giving the application a chance
 to save its data.
 
 @short 
 This class handles segmentation-faults.
*/
public class  KCrash implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;

	protected KCrash(Class dummy){}

//	public native typedef void( * HandlerType)(int arg1);
	public static native void defaultCrashHandler( int signal);

/** 
 Install a function to be called in case a SIGSEGV is caught.

*/
//	public static native void setCrashHandler( HandlerType handler);
	public static native void setCrashHandler();

/** 
 Returns the installed crash handler
   
*/
//	public static native HandlerType crashHandler();

/** 
 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.
   
*/
//	public static native void setEmergencySaveFunction( HandlerType saveFunction 0);
//	public static native void setEmergencySaveFunction();

/** 
 Return the currently set emergency save function.
   
*/
//	public static native HandlerType emergencySaveFunction();

/** 
 Sets the application path <code>path</code> which should be passed to
 Dr. Konqi, our nice crash display application.
   
*/
	public static native void setApplicationPath( String path);

/** 
 Sets the application name <code>name</code> which should be passed to
 Dr. Konqi, our nice crash display application.
   
*/
	public static native void setApplicationName( String name);
}
