/***************************************************************************
                            KHTMLPart.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 <khtml_part.h>
#include <qstring.h>
#include <qcstring.h>
#include <qvariant.h>
#include <qcursor.h>

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

class KHTMLPartJBridge : public KHTMLPart
{
public:
	KHTMLPartJBridge(QWidget* parentWidget, const char* widgetname, QObject* parent, const char* name, GUIProfile prof) : KHTMLPart(parentWidget, widgetname, parent, name, prof) {}
	KHTMLPartJBridge(KHTMLView* view, QObject* parent, const char* name, GUIProfile prof) : KHTMLPart(view, parent, name, prof) {}
	~KHTMLPartJBridge() {QtSupport::qtKeyDeleted(this);}
	KURL  protected_completeURL(const QString& url) {
		return (KURL ) KHTMLPart::completeURL(url);
	}
	void protected_customEvent(QCustomEvent* event) {
		KHTMLPart::customEvent(event);
		return;
	}
	void protected_khtmlMousePressEvent(khtml::MousePressEvent* event) {
		KHTMLPart::khtmlMousePressEvent(event);
		return;
	}
	void protected_khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent* arg1) {
		KHTMLPart::khtmlMouseDoubleClickEvent(arg1);
		return;
	}
	void protected_khtmlMouseMoveEvent(khtml::MouseMoveEvent* event) {
		KHTMLPart::khtmlMouseMoveEvent(event);
		return;
	}
	void protected_khtmlMouseReleaseEvent(khtml::MouseReleaseEvent* event) {
		KHTMLPart::khtmlMouseReleaseEvent(event);
		return;
	}
	void protected_khtmlDrawContentsEvent(khtml::DrawContentsEvent* arg1) {
		KHTMLPart::khtmlDrawContentsEvent(arg1);
		return;
	}
	void protected_guiActivateEvent(KParts::GUIActivateEvent* event) {
		KHTMLPart::guiActivateEvent(event);
		return;
	}
	 bool  protected_openFile() {
		return ( bool ) KHTMLPart::openFile();
	}
	void protected_urlSelected(const QString& url, int button, int state, const QString& _target, KParts::URLArgs args) {
		KHTMLPart::urlSelected(url, button, state, _target, args);
		return;
	}
	 KParts::ReadOnlyPart * protected_createPart(QWidget* parentWidget, const char* widgetName, QObject* parent, const char* name, const QString& mimetype, QString& serviceName, QStringList& serviceTypes, const QStringList& params) {
		return ( KParts::ReadOnlyPart *) KHTMLPart::createPart(parentWidget, widgetName, parent, name, mimetype, serviceName, serviceTypes, params);
	}
	void khtmlMouseMoveEvent(khtml::MouseMoveEvent* event) {
		if (! QtSupport::eventDelegate(this, "khtmlMouseMoveEvent", event, "org.kde.koala.MouseMoveEvent")) {
			KHTMLPart::khtmlMouseMoveEvent(event);
		}
		return;
	}
	void partActivateEvent(KParts::PartActivateEvent* event) {
		if (! QtSupport::eventDelegate(this, "partActivateEvent", event, "org.kde.koala.PartActivateEvent")) {
			Part::partActivateEvent(event);
		}
		return;
	}
	void partSelectEvent(KParts::PartSelectEvent* event) {
		if (! QtSupport::eventDelegate(this, "partSelectEvent", event, "org.kde.koala.PartSelectEvent")) {
			Part::partSelectEvent(event);
		}
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* event) {
		if (! QtSupport::eventDelegate(this, "customEvent", event, "org.kde.qt.QCustomEvent")) {
			KHTMLPart::customEvent(event);
		}
		return;
	}
	void guiActivateEvent(KParts::GUIActivateEvent* event) {
		if (! QtSupport::eventDelegate(this, "guiActivateEvent", event, "org.kde.koala.GUIActivateEvent")) {
			KHTMLPart::guiActivateEvent(event);
		}
		return;
	}
	void khtmlMousePressEvent(khtml::MousePressEvent* event) {
		if (! QtSupport::eventDelegate(this, "khtmlMousePressEvent", event, "org.kde.koala.MousePressEvent")) {
			KHTMLPart::khtmlMousePressEvent(event);
		}
		return;
	}
	void khtmlMouseReleaseEvent(khtml::MouseReleaseEvent* event) {
		if (! QtSupport::eventDelegate(this, "khtmlMouseReleaseEvent", event, "org.kde.koala.MouseReleaseEvent")) {
			KHTMLPart::khtmlMouseReleaseEvent(event);
		}
		return;
	}
	void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "khtmlMouseDoubleClickEvent", arg1, "org.kde.koala.MouseDoubleClickEvent")) {
			KHTMLPart::khtmlMouseDoubleClickEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
	void khtmlDrawContentsEvent(khtml::DrawContentsEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "khtmlDrawContentsEvent", arg1, "org.kde.koala.DrawContentsEvent")) {
			KHTMLPart::khtmlDrawContentsEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_newKHTMLPart__Lorg_kde_qt_QWidget_2Ljava_lang_String_2Lorg_kde_qt_QObject_2Ljava_lang_String_2I(JNIEnv *env, jobject obj, jobject parentWidget, jstring widgetname, jobject parent, jstring name, jint prof)
{
static QCString * _qstring_name = 0;
static QCString * _qstring_widgetname = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KHTMLPartJBridge((QWidget*) QtSupport::getQt(env, parentWidget), (char*) QtSupport::toCharString(env, widgetname, &_qstring_widgetname), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name), (KHTMLPart::GUIProfile) prof));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_newKHTMLPart__Lorg_kde_koala_KHTMLView_2Lorg_kde_qt_QObject_2Ljava_lang_String_2I(JNIEnv *env, jobject obj, jobject view, jobject parent, jstring name, jint prof)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KHTMLPartJBridge((KHTMLView*) QtSupport::getQt(env, view), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name), (KHTMLPart::GUIProfile) prof));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_newKHTMLPart__Lorg_kde_koala_KHTMLView_2(JNIEnv *env, jobject obj, jobject view)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KHTMLPartJBridge((KHTMLView*) QtSupport::getQt(env, view), 0, 0, KHTMLPart::DefaultGUI));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((KHTMLPart*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (KHTMLPart*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KHTMLPart_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_openURL(JNIEnv *env, jobject obj, jobject url)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->openURL((KURL&) *(KURL *) QtSupport::getQt(env, url));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_closeURL(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->closeURL();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_showError(JNIEnv *env, jobject obj, jobject job)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->showError((KIO::Job*) QtSupport::getQt(env, job));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_htmlDocument(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new DOM::HTMLDocument (((KHTMLPart*) QtSupport::getQt(env, obj))->htmlDocument()), "org.kde.koala.HTMLDocument", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_document(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new DOM::Document (((KHTMLPart*) QtSupport::getQt(env, obj))->document()), "org.kde.koala.DOMDocument", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_activeNode(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new DOM::Node (((KHTMLPart*) QtSupport::getQt(env, obj))->activeNode()), "org.kde.koala.DOMNode", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_browserExtension(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->browserExtension(), "org.kde.koala.BrowserExtension");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_view(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->view(), "org.kde.koala.KHTMLView");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setJScriptEnabled(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setJScriptEnabled((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_jScriptEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->jScriptEnabled();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setMetaRefreshEnabled(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setMetaRefreshEnabled((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_metaRefreshEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->metaRefreshEnabled();
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_executeScript__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring script)
{
static QString * _qstring_script = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QVariant (((KHTMLPart*) QtSupport::getQt(env, obj))->executeScript((QString&) * (QString *) QtSupport::toQString(env, script, &_qstring_script))), "org.kde.qt.QVariant", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_executeScript__Lorg_kde_koala_DOMNode_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject n, jstring script)
{
static QString * _qstring_script = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QVariant (((KHTMLPart*) QtSupport::getQt(env, obj))->executeScript((DOM::Node&) *(DOM::Node *) QtSupport::getQt(env, n), (QString&) * (QString *) QtSupport::toQString(env, script, &_qstring_script))), "org.kde.qt.QVariant", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setDNDEnabled(JNIEnv *env, jobject obj, jboolean b)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setDNDEnabled((bool) b);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_dndEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->dndEnabled();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setJavaEnabled(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setJavaEnabled((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_javaEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->javaEnabled();
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_javaContext(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->javaContext(), "org.kde.koala.KJavaAppletContext");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_createJavaContext(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->createJavaContext(), "org.kde.koala.KJavaAppletContext");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setPluginsEnabled(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setPluginsEnabled((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_pluginsEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->pluginsEnabled();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setAutoloadImages(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setAutoloadImages((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_autoloadImages__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->autoloadImages();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setOnlyLocalReferences(JNIEnv *env, jobject obj, jboolean enable)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setOnlyLocalReferences((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_onlyLocalReferences(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->onlyLocalReferences();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_enableJScript(JNIEnv *env, jobject obj, jboolean e)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->enableJScript((bool) e);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_enableJava(JNIEnv *env, jobject obj, jboolean e)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->enableJava((bool) e);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_enablePlugins(JNIEnv *env, jobject obj, jboolean e)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->enablePlugins((bool) e);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_autoloadImages__Z(JNIEnv *env, jobject obj, jboolean e)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->autoloadImages((bool) e);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_enableMetaRefresh(JNIEnv *env, jobject obj, jboolean e)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->enableMetaRefresh((bool) e);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_setCharset(JNIEnv *env, jobject obj, jstring arg1, jboolean arg2)
{
static QString * _qstring_arg1 = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->setCharset((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1), (bool) arg2);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_baseURL(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL (((KHTMLPart*) QtSupport::getQt(env, obj))->baseURL()), "org.kde.koala.KURL", TRUE);
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_backgroundURL(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL (((KHTMLPart*) QtSupport::getQt(env, obj))->backgroundURL()), "org.kde.koala.KURL", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_scheduleRedirection(JNIEnv *env, jobject obj, jint delay, jstring url)
{
static QString * _qstring_url = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->scheduleRedirection((int) delay, (QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_begin__Lorg_kde_koala_KURL_2II(JNIEnv *env, jobject obj, jobject url, jint xOffset, jint yOffset)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->begin((KURL&) *(KURL *) QtSupport::getQt(env, url), (int) xOffset, (int) yOffset);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_begin__(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->begin(KURL(), 0, 0);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_write__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring str, jint len)
{
static QCString * _qstring_str = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->write((char*) QtSupport::toCharString(env, str, &_qstring_str), (int) len);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_write__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring str)
{
static QCString * _qstring_str = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->write((char*) QtSupport::toCharString(env, str, &_qstring_str), -1);
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLPart_write__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring str)
//{
//static QString * _qstring_str = 0;
//	((KHTMLPart*) QtSupport::getQt(env, obj))->write((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str));
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_end(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->end();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_paint__Lorg_kde_qt_QPainter_2Lorg_kde_qt_QRect_2I_3I(JNIEnv *env, jobject obj, jobject arg1, jobject arg2, jint arg3, jintArray arg4)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->paint((QPainter*) QtSupport::getQt(env, arg1), (QRect&) *(QRect *) QtSupport::getQt(env, arg2), (int) arg3,  (bool*) QtSupport::toIntPtr(env, arg4));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_paint__Lorg_kde_qt_QPainter_2Lorg_kde_qt_QRect_2(JNIEnv *env, jobject obj, jobject arg1, jobject arg2)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->paint((QPainter*) QtSupport::getQt(env, arg1), (QRect&) *(QRect *) QtSupport::getQt(env, arg2), 0, 0);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_setEncoding__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring name, jboolean override)
{
static QString * _qstring_name = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->setEncoding((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), (bool) override);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_setEncoding__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->setEncoding((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name), false);
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setUserStyleSheet__Lorg_kde_koala_KURL_2(JNIEnv *env, jobject obj, jobject url)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setUserStyleSheet((KURL&) *(KURL *) QtSupport::getQt(env, url));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setUserStyleSheet__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring styleSheet)
{
static QString * _qstring_styleSheet = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->setUserStyleSheet((QString&) * (QString *) QtSupport::toQString(env, styleSheet, &_qstring_styleSheet));
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLPart_setFontSizes(JNIEnv *env, jobject obj, jintArray newFontSizes)
//{
//static QValueList<int> * _qlist_newFontSizes = 0;
//	((KHTMLPart*) QtSupport::getQt(env, obj))->setFontSizes( (QValueList<int>&) QtSupport::toQIntValueList(env, newFontSizes, &_qlist_newFontSizes));
//	return;
//}

//JNIEXPORT jintArray JNICALL
//Java_org_kde_koala_KHTMLPart_fontSizes(JNIEnv *env, jobject obj)
//{
//	QValueList<int> _qintArray;
//	_qintArray = ((KHTMLPart*) QtSupport::getQt(env, obj))->fontSizes();
//	return QtSupport::fromQIntValueList(env, &_qintArray);
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLPart_resetFontSizes(JNIEnv *env, jobject obj)
//{
//	((KHTMLPart*) QtSupport::getQt(env, obj))->resetFontSizes();
//	return;
//}

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

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

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_gotoAnchor(JNIEnv *env, jobject obj, jstring name)
{
static QString * _qstring_name = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->gotoAnchor((QString&) * (QString *) QtSupport::toQString(env, name, &_qstring_name));
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setURLCursor(JNIEnv *env, jobject obj, jobject c)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setURLCursor((QCursor&) *(QCursor *) QtSupport::getQt(env, c));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_urlCursor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QCursor (((KHTMLPart*) QtSupport::getQt(env, obj))->urlCursor()), "org.kde.qt.QCursor", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_findTextBegin(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->findTextBegin();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_findTextNext(JNIEnv *env, jobject obj, jstring str, jboolean forward, jboolean caseSensitive, jboolean isRegExp)
{
static QString * _qstring_str = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->findTextNext((QString&) * (QString *) QtSupport::toQString(env, str, &_qstring_str), (bool) forward, (bool) caseSensitive, (bool) isRegExp);
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_selection(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new DOM::Range (((KHTMLPart*) QtSupport::getQt(env, obj))->selection()), "org.kde.koala.Range", TRUE);
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KHTMLPart_setSelection(JNIEnv *env, jobject obj, j arg1)
//{
//	((KHTMLPart*) QtSupport::getQt(env, obj))->setSelection((DOM::Range) arg1);
//	return;
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_hasSelection(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->hasSelection();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_selectAll(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->selectAll();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_show(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->show();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_hide(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->hide();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_partManager(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->partManager(), "org.kde.koala.PartManager");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_saveState(JNIEnv *env, jobject obj, jobject stream)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->saveState((QDataStream&) *(QDataStream *) QtSupport::getQt(env, stream));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_restoreState(JNIEnv *env, jobject obj, jobject stream)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->restoreState((QDataStream&) *(QDataStream *) QtSupport::getQt(env, stream));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_nodeUnderMouse(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new DOM::Node (((KHTMLPart*) QtSupport::getQt(env, obj))->nodeUnderMouse()), "org.kde.koala.DOMNode", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_settings(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->settings(), "org.kde.koala.KHTMLSettings");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_parentPart(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->parentPart(), "org.kde.koala.KHTMLPart");
}

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

//JNIEXPORT  JNICALL
//Java_org_kde_koala_KHTMLPart_frames(JNIEnv *env, jobject obj)
//{
//	return () ((KHTMLPart*) QtSupport::getQt(env, obj))->frames();
//}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_findFrame(JNIEnv *env, jobject obj, jstring f)
{
static QString * _qstring_f = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->findFrame((QString&) * (QString *) QtSupport::toQString(env, f, &_qstring_f)), "org.kde.koala.KHTMLPart");
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_currentFrame(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPart*) QtSupport::getQt(env, obj))->currentFrame(), "org.kde.koala.ReadOnlyPart");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_frameExists(JNIEnv *env, jobject obj, jstring frameName)
{
static QString * _qstring_frameName = 0;
	return (jboolean) ((KHTMLPart*) QtSupport::getQt(env, obj))->frameExists((QString&) * (QString *) QtSupport::toQString(env, frameName, &_qstring_frameName));
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setJSStatusBarText(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->setJSStatusBarText((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setJSDefaultStatusBarText(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->setJSDefaultStatusBarText((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return;
}

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

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

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_preloadStyleSheet(JNIEnv *env, jobject obj, jstring url, jstring stylesheet)
{
static QString * _qstring_stylesheet = 0;
static QString * _qstring_url = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->preloadStyleSheet((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url), (QString&) * (QString *) QtSupport::toQString(env, stylesheet, &_qstring_stylesheet));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_preloadScript(JNIEnv *env, jobject obj, jstring url, jstring script)
{
static QString * _qstring_script = 0;
static QString * _qstring_url = 0;
	((KHTMLPart*) QtSupport::getQt(env, obj))->preloadScript((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url), (QString&) * (QString *) QtSupport::toQString(env, script, &_qstring_script));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_setActiveNode(JNIEnv *env, jobject obj, jobject node)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->setActiveNode((DOM::Node&) *(DOM::Node *) QtSupport::getQt(env, node));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_stopAnimations(JNIEnv *env, jobject obj)
{
	((KHTMLPart*) QtSupport::getQt(env, obj))->stopAnimations();
	return;
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_completeURL(JNIEnv *env, jobject obj, jstring url)
{
static QString * _qstring_url = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)new KURL (((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_completeURL((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url))), "org.kde.koala.KURL", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_customEvent(JNIEnv *env, jobject obj, jobject event)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_customEvent((QCustomEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_khtmlMousePressEvent(JNIEnv *env, jobject obj, jobject event)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_khtmlMousePressEvent((khtml::MousePressEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_khtmlMouseDoubleClickEvent(JNIEnv *env, jobject obj, jobject arg1)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_khtmlMouseDoubleClickEvent((khtml::MouseDoubleClickEvent*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_khtmlMouseMoveEvent(JNIEnv *env, jobject obj, jobject event)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_khtmlMouseMoveEvent((khtml::MouseMoveEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_khtmlMouseReleaseEvent(JNIEnv *env, jobject obj, jobject event)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_khtmlMouseReleaseEvent((khtml::MouseReleaseEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_khtmlDrawContentsEvent(JNIEnv *env, jobject obj, jobject arg1)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_khtmlDrawContentsEvent((khtml::DrawContentsEvent*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_guiActivateEvent(JNIEnv *env, jobject obj, jobject event)
{
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_guiActivateEvent((KParts::GUIActivateEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KHTMLPart_openFile(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_openFile();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_urlSelected__Ljava_lang_String_2IILjava_lang_String_2Lorg_kde_koala_URLArgs_2(JNIEnv *env, jobject obj, jstring url, jint button, jint state, jstring _target, jobject args)
{
static QString * _qstring__target = 0;
static QString * _qstring_url = 0;
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_urlSelected((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url), (int) button, (int) state, (QString&) * (QString *) QtSupport::toQString(env, _target, &_qstring__target), (KParts::URLArgs) *(KParts::URLArgs *) QtSupport::getQt(env, args));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KHTMLPart_urlSelected__Ljava_lang_String_2IILjava_lang_String_2(JNIEnv *env, jobject obj, jstring url, jint button, jint state, jstring _target)
{
static QString * _qstring__target = 0;
static QString * _qstring_url = 0;
	((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_urlSelected((QString&) * (QString *) QtSupport::toQString(env, url, &_qstring_url), (int) button, (int) state, (QString&) * (QString *) QtSupport::toQString(env, _target, &_qstring__target), KParts::URLArgs());
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KHTMLPart_createPart(JNIEnv *env, jobject obj, jobject parentWidget, jstring widgetName, jobject parent, jstring name, jstring mimetype, jstring serviceName, jobjectArray serviceTypes, jobjectArray params)
{
static QStringList * _qlist_params = 0;
static QStringList * _qlist_serviceTypes = 0;
static QString * _qstring_serviceName = 0;
static QString * _qstring_mimetype = 0;
static QCString * _qstring_name = 0;
static QCString * _qstring_widgetName = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KHTMLPartJBridge*) QtSupport::getQt(env, obj))->protected_createPart((QWidget*) QtSupport::getQt(env, parentWidget), (char*) QtSupport::toCharString(env, widgetName, &_qstring_widgetName), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name), (QString&) * (QString *) QtSupport::toQString(env, mimetype, &_qstring_mimetype), (QString&) * (QString *) QtSupport::toQString(env, serviceName, &_qstring_serviceName), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, serviceTypes, &_qlist_serviceTypes), (QStringList&) * (QStringList *) QtSupport::toQStringList(env, params, &_qlist_params)), "org.kde.koala.ReadOnlyPart");
}

