/***************************************************************************
                            StubProcess.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 <kdesu/stub.h>
#include <qstring.h>
#include <qcstring.h>

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

class StubProcessJBridge : public StubProcess
{
public:
	StubProcessJBridge() : StubProcess() {}
	~StubProcessJBridge() {QtSupport::qtKeyDeleted(this);}
	int  protected_ConverseStub(int check) {
		return (int ) StubProcess::ConverseStub(check);
	}
	void protected_notifyTaskbar(const QString& suffix) {
		StubProcess::notifyTaskbar(suffix);
		return;
	}
	 QCString  protected_display() {
		return ( QCString ) StubProcess::display();
	}
	 QCString  protected_displayAuth() {
		return ( QCString ) StubProcess::displayAuth();
	}
	 QCString  protected_dcopServer() {
		return ( QCString ) StubProcess::dcopServer();
	}
	 QCString  protected_dcopAuth() {
		return ( QCString ) StubProcess::dcopAuth();
	}
	 QCString  protected_iceAuth() {
		return ( QCString ) StubProcess::iceAuth();
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_newStubProcess(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new StubProcessJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (StubProcess*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_StubProcess_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_StubProcess_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setDcopTransport(JNIEnv *env, jobject obj, jstring dcopTransport)
{
static QCString * _qcstring_dcopTransport = 0;
	((StubProcess*) QtSupport::getQt(env, obj))->setDcopTransport((QCString&) * (QCString *) QtSupport::toQCString(env, dcopTransport, &_qcstring_dcopTransport));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setCommand(JNIEnv *env, jobject obj, jstring command)
{
static QCString * _qcstring_command = 0;
	((StubProcess*) QtSupport::getQt(env, obj))->setCommand((QCString&) * (QCString *) QtSupport::toQCString(env, command, &_qcstring_command));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setUser(JNIEnv *env, jobject obj, jstring user)
{
static QCString * _qcstring_user = 0;
	((StubProcess*) QtSupport::getQt(env, obj))->setUser((QCString&) * (QCString *) QtSupport::toQCString(env, user, &_qcstring_user));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setXOnly(JNIEnv *env, jobject obj, jboolean xonly)
{
	((StubProcess*) QtSupport::getQt(env, obj))->setXOnly((bool) xonly);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setDCOPForwarding(JNIEnv *env, jobject obj, jboolean dcopForwarding)
{
	((StubProcess*) QtSupport::getQt(env, obj))->setDCOPForwarding((bool) dcopForwarding);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setPriority(JNIEnv *env, jobject obj, jint prio)
{
	((StubProcess*) QtSupport::getQt(env, obj))->setPriority((int) prio);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_setScheduler(JNIEnv *env, jobject obj, jint sched)
{
	((StubProcess*) QtSupport::getQt(env, obj))->setScheduler((int) sched);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_StubProcess_ConverseStub(JNIEnv *env, jobject obj, jint check)
{
	return (jint) ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_ConverseStub((int) check);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_StubProcess_notifyTaskbar(JNIEnv *env, jobject obj, jstring suffix)
{
static QString * _qstring_suffix = 0;
	((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_notifyTaskbar((QString&) * (QString *) QtSupport::toQString(env, suffix, &_qstring_suffix));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_StubProcess_display(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_display();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_StubProcess_displayAuth(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_displayAuth();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_StubProcess_dcopServer(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_dcopServer();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_StubProcess_dcopAuth(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_dcopAuth();
	return QtSupport::fromQCString(env, &_qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_StubProcess_iceAuth(JNIEnv *env, jobject obj)
{
	QCString  _qcstring;
	_qcstring = ((StubProcessJBridge*) QtSupport::getQt(env, obj))->protected_iceAuth();
	return QtSupport::fromQCString(env, &_qcstring);
}

