/***************************************************************************
                            QSessionManager.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, 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 <qsessionmanager.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QSessionManager.h>

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QSessionManager_sessionId(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QSessionManager*) QtSupport::getQt(env, obj))->sessionId();
	return QtSupport::fromQString(env, &_qstring);
}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QSessionManager_handle(JNIEnv *env, jobject obj)
//{
//	return (jint) ((QSessionManager*) QtSupport::getQt(env, obj))->handle();
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSessionManager_allowsInteraction(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSessionManager*) QtSupport::getQt(env, obj))->allowsInteraction();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSessionManager_allowsErrorInteraction(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSessionManager*) QtSupport::getQt(env, obj))->allowsErrorInteraction();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_release(JNIEnv *env, jobject obj)
{
	((QSessionManager*) QtSupport::getQt(env, obj))->release();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_cancel(JNIEnv *env, jobject obj)
{
	((QSessionManager*) QtSupport::getQt(env, obj))->cancel();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_setRestartHint(JNIEnv *env, jobject obj, jint arg1)
{
	((QSessionManager*) QtSupport::getQt(env, obj))->setRestartHint((QSessionManager::RestartHint) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSessionManager_restartHint(JNIEnv *env, jobject obj)
{
	return (jint) ((QSessionManager*) QtSupport::getQt(env, obj))->restartHint();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_setRestartCommand(JNIEnv *env, jobject obj, jobjectArray arg1)
{
static QStringList * _qlist_arg1 = 0;
	((QSessionManager*) QtSupport::getQt(env, obj))->setRestartCommand((QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg1, &_qlist_arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSessionManager_restartCommand(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((QSessionManager*) QtSupport::getQt(env, obj))->restartCommand();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_setDiscardCommand(JNIEnv *env, jobject obj, jobjectArray arg1)
{
static QStringList * _qlist_arg1 = 0;
	((QSessionManager*) QtSupport::getQt(env, obj))->setDiscardCommand((QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg1, &_qlist_arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSessionManager_discardCommand(JNIEnv *env, jobject obj)
{
	QStringList  _qlist;
	_qlist = ((QSessionManager*) QtSupport::getQt(env, obj))->discardCommand();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_setManagerProperty__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name, jstring value)
{
static QString * _qstring_value = 0;
static QString * _qstring_name = 0;
	((QSessionManager*) QtSupport::getQt(env, obj))->setManagerProperty((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QString&) * (QString *) QtSupport::toQString(env, value, &_qstring_value));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_setManagerProperty__Ljava_lang_String_2_3Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name, jobjectArray value)
{
static QStringList * _qlist_value = 0;
static QString * _qstring_name = 0;
	((QSessionManager*) QtSupport::getQt(env, obj))->setManagerProperty((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, value, &_qlist_value));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSessionManager_isPhase2(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSessionManager*) QtSupport::getQt(env, obj))->isPhase2();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSessionManager_requestPhase2(JNIEnv *env, jobject obj)
{
	((QSessionManager*) QtSupport::getQt(env, obj))->requestPhase2();
	return;
}

