/***************************************************************************
                            KServiceGroup.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 <kservicegroup.h>
#include <qstring.h>
#include <qcstring.h>

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

class KServiceGroupJBridge : public KServiceGroup
{
public:
	KServiceGroupJBridge(const QString& _fullpath, const QString& _relpath) : KServiceGroup(_fullpath, _relpath) {}
	KServiceGroupJBridge(QDataStream& _str, int offset, bool deep) : KServiceGroup(_str, offset, deep) {}
	~KServiceGroupJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_addEntry(KSycocaEntry* entry) {
		KServiceGroup::addEntry(entry);
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_newKServiceGroup__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring _fullpath, jstring _relpath)
{
static QString * _qstring__relpath = 0;
static QString * _qstring__fullpath = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KServiceGroupJBridge((QString&) * (QString *) QtSupport::toQString(env, _fullpath, &_qstring__fullpath), (QString&) * (QString *) QtSupport::toQString(env, _relpath, &_qstring__relpath)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_newKServiceGroup__Lorg_kde_qt_QDataStream_2IZ(JNIEnv *env, jobject obj, jobject _str, jint offset, jboolean deep)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KServiceGroupJBridge((QDataStream&) *(QDataStream *) QtSupport::getQt(env, _str), (int) offset, (bool) deep));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KServiceGroup_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KServiceGroup_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KServiceGroup*) QtSupport::getQt(env, obj))->isValid();
}

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

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

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

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

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

JNIEXPORT jint JNICALL
Java_org_kde_koala_KServiceGroup_childCount(JNIEnv *env, jobject obj)
{
	return (jint) ((KServiceGroup*) QtSupport::getQt(env, obj))->childCount();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_load(JNIEnv *env, jobject obj, jobject arg1)
{
	((KServiceGroup*) QtSupport::getQt(env, obj))->load((QDataStream&) *(QDataStream *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_save(JNIEnv *env, jobject obj, jobject arg1)
{
	((KServiceGroup*) QtSupport::getQt(env, obj))->save((QDataStream&) *(QDataStream *) QtSupport::getQt(env, arg1));
	return;
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_koala_KServiceGroup_entries__ZZ(JNIEnv *env, jobject obj, jboolean sorted, jboolean excludeNoDisplay)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)new  List (((KServiceGroup*) QtSupport::getQt(env, obj))->entries((bool) sorted, (bool) excludeNoDisplay)), "org.kde.koala.List", TRUE);
//}

//JNIEXPORT jobject JNICALL
//Java_org_kde_koala_KServiceGroup_entries__Z(JNIEnv *env, jobject obj, jboolean sorted)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)new  List (((KServiceGroup*) QtSupport::getQt(env, obj))->entries((bool) sorted)), "org.kde.koala.List", TRUE);
//}

//JNIEXPORT jobject JNICALL
//Java_org_kde_koala_KServiceGroup_entries__(JNIEnv *env, jobject obj)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)new List(((KServiceGroup*) QtSupport::getQt(env, obj))->entries(false)), "org.kde.koala.List", TRUE);
//}

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

//JNIEXPORT jint JNICALL
//Java_org_kde_koala_KServiceGroup_baseGroup(JNIEnv *env, jclass obj, jstring baseGroupName)
//{
//static QString * _qstring_baseGroupName = 0;
//	return (jint) KServiceGroupJBridge::baseGroup((QString&) * (QString *) QtSupport::toQString(env, baseGroupName, &_qstring_baseGroupName));
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_koala_KServiceGroup_root(JNIEnv *env, jclass obj)
//{
//	return (jint) KServiceGroupJBridge::root();
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_koala_KServiceGroup_group(JNIEnv *env, jclass obj, jstring relPath)
//{
//static QString * _qstring_relPath = 0;
//	return (jint) KServiceGroupJBridge::group((QString&) * (QString *) QtSupport::toQString(env, relPath, &_qstring_relPath));
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KServiceGroup_addEntry(JNIEnv *env, jobject obj, jobject entry)
{
	((KServiceGroupJBridge*) QtSupport::getQt(env, obj))->protected_addEntry((KSycocaEntry*) QtSupport::getQt(env, entry));
	return;
}

