/***************************************************************************
                            HTMLElement.cpp -  description
                             -------------------
    begin                : Sun Aug 26 09:45:02 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Aug 26 09:45:02 2001, using kdoc parser/custom Java conversion backend.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 <dom/html_element.h>
#include <dom/dom_string.h>
#include <qstring.h>
#include <qcstring.h>

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

class HTMLElementJBridge : public DOM::HTMLElement
{
public:
	HTMLElementJBridge() : DOM::HTMLElement() {}
	HTMLElementJBridge(const DOM::HTMLElement& other) : DOM::HTMLElement(other) {}
	HTMLElementJBridge(const Node& other) : DOM::HTMLElement(other) {}
	~HTMLElementJBridge() {QtSupport::qtKeyDeleted(this);}
	HTMLElementJBridge(DOM::HTMLElementImpl* impl) : DOM::HTMLElement(impl) {}
};


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

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_newHTMLElement__Lorg_kde_koala_HTMLElement_2(JNIEnv *env, jobject obj, jobject other)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new HTMLElementJBridge((DOM::HTMLElement&) *(DOM::HTMLElement *) QtSupport::getQt(env, other)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_newHTMLElement__Lorg_kde_koala_DOMNode_2(JNIEnv *env, jobject obj, jobject other)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new HTMLElementJBridge((DOM::Node&) *(DOM::Node *) QtSupport::getQt(env, other)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_id(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->id();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setId(JNIEnv *env, jobject obj, jstring arg1)
{
static DOM::DOMString * _domstring_arg1 = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setId((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, arg1, &_domstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_title(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->title();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setTitle(JNIEnv *env, jobject obj, jstring arg1)
{
static DOM::DOMString * _domstring_arg1 = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setTitle((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, arg1, &_domstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_lang(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->lang();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setLang(JNIEnv *env, jobject obj, jstring arg1)
{
static DOM::DOMString * _domstring_arg1 = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setLang((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, arg1, &_domstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_dir(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->dir();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setDir(JNIEnv *env, jobject obj, jstring arg1)
{
static DOM::DOMString * _domstring_arg1 = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setDir((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, arg1, &_domstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_className(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->className();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setClassName(JNIEnv *env, jobject obj, jstring arg1)
{
static DOM::DOMString * _domstring_arg1 = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setClassName((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, arg1, &_domstring_arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_innerHTML(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->innerHTML();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setInnerHTML(JNIEnv *env, jobject obj, jstring html)
{
static DOM::DOMString * _domstring_html = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setInnerHTML((DOM::DOMString) * (DOM::DOMString *) KDESupport::toDOMString(env, html, &_domstring_html));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_HTMLElement_innerText(JNIEnv *env, jobject obj)
{
	DOM::DOMString  _domstring;
	_domstring = ((HTMLElementJBridge*) QtSupport::getQt(env, obj))->innerText();
	return KDESupport::fromDOMString(env, &_domstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_setInnerText(JNIEnv *env, jobject obj, jstring text)
{
static DOM::DOMString * _domstring_text = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->setInnerText((DOM::DOMString) * (DOM::DOMString *) KDESupport::toDOMString(env, text, &_domstring_text));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_removeCSSProperty(JNIEnv *env, jobject obj, jstring property)
{
static DOM::DOMString * _domstring_property = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->removeCSSProperty((DOM::DOMString&) * (DOM::DOMString *) KDESupport::toDOMString(env, property, &_domstring_property));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_HTMLElement_addCSSProperty(JNIEnv *env, jobject obj, jstring property, jstring value)
{
static DOM::DOMString * _domstring_value = 0;
static DOM::DOMString * _domstring_property = 0;
	((HTMLElementJBridge*) QtSupport::getQt(env, obj))->addCSSProperty((DOM::DOMString) * (DOM::DOMString *) KDESupport::toDOMString(env, property, &_domstring_property), (DOM::DOMString) * (DOM::DOMString *) KDESupport::toDOMString(env, value, &_domstring_value));
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_HTMLElement_newHTMLElement__Lorg_kde_koala_HTMLElementImpl_2(JNIEnv *env, jobject obj, jobject impl)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new HTMLElementJBridge((HTMLElementImpl*) QtSupport::getQt(env, impl)));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

