/***************************************************************************
                            KDataToolInfo.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 <kdatatool.h>
#include <qstring.h>
#include <qcstring.h>
#include <qpixmap.h>

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

class KDataToolInfoJBridge : public KDataToolInfo
{
public:
	KDataToolInfoJBridge() : KDataToolInfo() {}
	KDataToolInfoJBridge(const KService::Ptr& service, KInstance* instance) : KDataToolInfo(service, instance) {}
	KDataToolInfoJBridge(const KDataToolInfo& info) : KDataToolInfo(info) {}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_KDataToolInfo_newKDataToolInfo__Lorg_kde_koala_KServicePtr_2Lorg_kde_koala_KInstanceInterface_2(JNIEnv *env, jobject obj, jobject service, jobject instance)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KDataToolInfoJBridge((KService::Ptr&) *(KService::Ptr *) QtSupport::getQt(env, service), (KInstance*) QtSupport::getQt(env, instance)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KDataToolInfo_newKDataToolInfo__Lorg_kde_koala_KDataToolInfo_2(JNIEnv *env, jobject obj, jobject info)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KDataToolInfoJBridge((KDataToolInfo&) *(KDataToolInfo *) QtSupport::getQt(env, info)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KDataToolInfo_isReadOnly(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KDataToolInfo*) QtSupport::getQt(env, obj))->isReadOnly();
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_icon(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((KDataToolInfo*) QtSupport::getQt(env, obj))->icon()), "org.kde.qt.QPixmap", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_miniIcon(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((KDataToolInfo*) QtSupport::getQt(env, obj))->miniIcon()), "org.kde.qt.QPixmap", TRUE);
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_createTool__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KDataToolInfo*) QtSupport::getQt(env, obj))->createTool((QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)), "org.kde.koala.KDataTool");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_createTool__(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KDataToolInfo*) QtSupport::getQt(env, obj))->createTool(0, 0), "org.kde.koala.KDataTool");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_service(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KService::Ptr (((KDataToolInfo*) QtSupport::getQt(env, obj))->service()), "org.kde.koala.KService_Ptr", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KDataToolInfo_instance(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KDataToolInfo*) QtSupport::getQt(env, obj))->instance(), "org.kde.koala.KInstanceInterface");
}

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

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KDataToolInfo_query(JNIEnv *env, jclass obj, jstring datatype, jstring mimetype, jobject instance)
//{
//static QString * _qstring_mimetype = 0;
//static QString * _qstring_datatype = 0;
//	return () KDataToolInfoJBridge::query((QString&) * (QString *) QtSupport::toQString(env, datatype, &_qstring_datatype), (QString&) * (QString *) QtSupport::toQString(env, mimetype, &_qstring_mimetype), (KInstance*) QtSupport::getQt(env, instance));
//}

