/***************************************************************************
                            KAutoMount.cpp -  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.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <kautomount.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KAutoMount.h>

class KAutoMountJBridge : public KAutoMount
{
public:
	KAutoMountJBridge(bool readonly, const QString& format, const QString& device, const QString& mountpoint, const QString& desktopFile, bool show_filemanager_window) : KAutoMount(readonly, format, device, mountpoint, desktopFile, show_filemanager_window) {}
	void protected_slotResult(KIO::Job* arg1) {
		KAutoMount::slotResult(arg1);
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KAutoMount_newKAutoMount__ZLjava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jboolean readonly, jstring format, jstring device, jstring mountpoint, jstring desktopFile, jboolean show_filemanager_window)
{
static QString * _qstring_desktopFile = 0;
static QString * _qstring_mountpoint = 0;
static QString * _qstring_device = 0;
static QString * _qstring_format = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KAutoMountJBridge((bool) readonly, (QString&) * (QString *) QtSupport::toQString(env, format, &_qstring_format), (QString&) * (QString *) QtSupport::toQString(env, device, &_qstring_device), (QString&) * (QString *) QtSupport::toQString(env, mountpoint, &_qstring_mountpoint), (QString&) * (QString *) QtSupport::toQString(env, desktopFile, &_qstring_desktopFile), (bool) show_filemanager_window));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAutoMount_newKAutoMount__ZLjava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jboolean readonly, jstring format, jstring device, jstring mountpoint, jstring desktopFile)
{
static QString * _qstring_desktopFile = 0;
static QString * _qstring_mountpoint = 0;
static QString * _qstring_device = 0;
static QString * _qstring_format = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KAutoMountJBridge((bool) readonly, (QString&) * (QString *) QtSupport::toQString(env, format, &_qstring_format), (QString&) * (QString *) QtSupport::toQString(env, device, &_qstring_device), (QString&) * (QString *) QtSupport::toQString(env, mountpoint, &_qstring_mountpoint), (QString&) * (QString *) QtSupport::toQString(env, desktopFile, &_qstring_desktopFile), true));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KAutoMount_slotResult(JNIEnv *env, jobject obj, jobject arg1)
{
	((KAutoMountJBridge*) QtSupport::getQt(env, obj))->protected_slotResult((KIO::Job*) QtSupport::getQt(env, arg1));
	return;
}

