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

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

class KXMLGUIClientJBridge : public KXMLGUIClient
{
public:
	KXMLGUIClientJBridge() : KXMLGUIClient() {}
	KXMLGUIClientJBridge(KXMLGUIClient* parent) : KXMLGUIClient(parent) {}
	~KXMLGUIClientJBridge() {QtSupport::qtKeyDeleted(this);}
	void protected_setInstance(KInstance* instance) {
		KXMLGUIClient::setInstance(instance);
		return;
	}
	void protected_setXMLFile(const QString& file, bool merge, bool setXMLDoc) {
		KXMLGUIClient::setXMLFile(file, merge, setXMLDoc);
		return;
	}
	void protected_setLocalXMLFile(const QString& file) {
		KXMLGUIClient::setLocalXMLFile(file);
		return;
	}
	void protected_setXML(const QString& document, bool merge) {
		KXMLGUIClient::setXML(document, merge);
		return;
	}
	void protected_setDOMDocument(const QDomDocument& document, bool merge) {
		KXMLGUIClient::setDOMDocument(document, merge);
		return;
	}
	void protected_conserveMemory() {
		KXMLGUIClient::conserveMemory();
		return;
	}
	void protected_stateChanged(const QString& newstate) {
		KXMLGUIClient::stateChanged(newstate);
		return;
	}
};


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

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KXMLGUIClient_finalize(env, obj);
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_action__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QCString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->action((char*) QtSupport::toCharString(env, name, &_qstring_name)), "org.kde.koala.KAction");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_action__Lorg_kde_qt_QDomElement_2(JNIEnv *env, jobject obj, jobject element)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->action((QDomElement&) *(QDomElement *) QtSupport::getQt(env, element)), "org.kde.koala.KAction");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_actionCollection(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->actionCollection(), "org.kde.koala.KActionCollection");
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_domDocument(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QDomDocument (((KXMLGUIClient*) QtSupport::getQt(env, obj))->domDocument()), "org.kde.qt.QDomDocument", TRUE);
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setXMLGUIBuildDocument(JNIEnv *env, jobject obj, jobject doc)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->setXMLGUIBuildDocument((QDomDocument&) *(QDomDocument *) QtSupport::getQt(env, doc));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_xmlguiBuildDocument(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QDomDocument (((KXMLGUIClient*) QtSupport::getQt(env, obj))->xmlguiBuildDocument()), "org.kde.qt.QDomDocument", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setFactory(JNIEnv *env, jobject obj, jobject factory)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->setFactory((KXMLGUIFactory*) QtSupport::getQt(env, factory));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_factory(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->factory(), "org.kde.koala.KXMLGUIFactory");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_parentClient(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->parentClient(), "org.kde.koala.KXMLGUIClientInterface");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_insertChildClient(JNIEnv *env, jobject obj, jobject child)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->insertChildClient((KXMLGUIClient*) QtSupport::getQt(env, child));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_removeChildClient(JNIEnv *env, jobject obj, jobject child)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->removeChildClient((KXMLGUIClient*) QtSupport::getQt(env, child));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_childClients(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->childClients(), "org.kde.koala.KXMLGUIClientPtrList");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setClientBuilder(JNIEnv *env, jobject obj, jobject builder)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->setClientBuilder((KXMLGUIBuilder*) QtSupport::getQt(env, builder));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KXMLGUIClient_clientBuilder(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KXMLGUIClient*) QtSupport::getQt(env, obj))->clientBuilder(), "org.kde.koala.KXMLGUIBuilderInterface");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_reloadXML(JNIEnv *env, jobject obj)
{
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->reloadXML();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_plugActionList(JNIEnv *env, jobject obj, jstring name, jobject actionList)
{
static QString * _qstring_name = 0;
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->plugActionList((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (QPtrList<KAction>&) *(QPtrList<KAction> *) QtSupport::getQt(env, actionList));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_unplugActionList(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->unplugActionList((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_addStateActionEnabled(JNIEnv *env, jobject obj, jstring state, jstring action)
{
static QString * _qstring_action = 0;
static QString * _qstring_state = 0;
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->addStateActionEnabled((QString&) * (QString *) QtSupport::toQString(env, state, &_qstring_state), (QString&) * (QString *) QtSupport::toQString(env, action, &_qstring_action));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_addStateActionDisabled(JNIEnv *env, jobject obj, jstring state, jstring action)
{
static QString * _qstring_action = 0;
static QString * _qstring_state = 0;
	((KXMLGUIClient*) QtSupport::getQt(env, obj))->addStateActionDisabled((QString&) * (QString *) QtSupport::toQString(env, state, &_qstring_state), (QString&) * (QString *) QtSupport::toQString(env, action, &_qstring_action));
	return;
}

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KXMLGUIClient_getActionsToChangeForState(JNIEnv *env, jobject obj, jstring state)
//{
//static QString * _qstring_state = 0;
//	return () ((KXMLGUIClient*) QtSupport::getQt(env, obj))->getActionsToChangeForState((QString&) * (QString *) QtSupport::toQString(env, state, &_qstring_state));
//}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KXMLGUIClient_findMostRecentXMLFile(JNIEnv *env, jclass obj, jobjectArray files, jstring doc)
{
	QString  _qstring;
static QString * _qstring_doc = 0;
static QStringList * _qlist_files = 0;
	_qstring = KXMLGUIClientJBridge::findMostRecentXMLFile((QStringList&) * (QStringList *) QtSupport::toQStringList(env, files, &_qlist_files), (QString&) * (QString *) QtSupport::toQString(env, doc, &_qstring_doc));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setInstance(JNIEnv *env, jobject obj, jobject instance)
{
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setInstance((KInstance*) QtSupport::getQt(env, instance));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setXMLFile__Ljava_lang_String_2ZZ(JNIEnv *env, jobject obj, jstring file, jboolean merge, jboolean setXMLDoc)
{
static QString * _qstring_file = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setXMLFile((QString&) * (QString *) QtSupport::toQString(env, file, &_qstring_file), (bool) merge, (bool) setXMLDoc);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setXMLFile__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring file)
{
static QString * _qstring_file = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setXMLFile((QString&) * (QString *) QtSupport::toQString(env, file, &_qstring_file), false, true);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setLocalXMLFile(JNIEnv *env, jobject obj, jstring file)
{
static QString * _qstring_file = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setLocalXMLFile((QString&) * (QString *) QtSupport::toQString(env, file, &_qstring_file));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setXML__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring document, jboolean merge)
{
static QString * _qstring_document = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setXML((QString&) * (QString *) QtSupport::toQString(env, document, &_qstring_document), (bool) merge);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setXML__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring document)
{
static QString * _qstring_document = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setXML((QString&) * (QString *) QtSupport::toQString(env, document, &_qstring_document), false);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setDOMDocument__Lorg_kde_qt_QDomDocument_2Z(JNIEnv *env, jobject obj, jobject document, jboolean merge)
{
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setDOMDocument((QDomDocument&) *(QDomDocument *) QtSupport::getQt(env, document), (bool) merge);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_setDOMDocument__Lorg_kde_qt_QDomDocument_2(JNIEnv *env, jobject obj, jobject document)
{
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_setDOMDocument((QDomDocument&) *(QDomDocument *) QtSupport::getQt(env, document), false);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_conserveMemory(JNIEnv *env, jobject obj)
{
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_conserveMemory();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KXMLGUIClient_stateChanged(JNIEnv *env, jobject obj, jstring newstate)
{
static QString * _qstring_newstate = 0;
	((KXMLGUIClientJBridge*) QtSupport::getQt(env, obj))->protected_stateChanged((QString&) * (QString *) QtSupport::toQString(env, newstate, &_qstring_newstate));
	return;
}

