/***************************************************************************
                            QMetaObject.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, 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 <qmetaobject.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QMetaObject.h>

class QMetaObjectJBridge : public QMetaObject
{
public:
	QMetaObjectJBridge(const char* const class_name, QMetaObject* superclass, const QMetaData* const slot_data, int n_slots, const QMetaData* const signal_data, int n_signals, const QMetaProperty* const prop_data, int n_props, const QMetaEnum* const enum_data, int n_enums, const QClassInfo* const class_info, int n_info) : QMetaObject(class_name, superclass, slot_data, n_slots, signal_data, n_signals, prop_data, n_props, enum_data, n_enums, class_info, n_info) {}
	~QMetaObjectJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QMetaObject_newQMetaObject(JNIEnv *env, jobject obj, jstring class_name, jobject superclass, jobject slot_data, jint n_slots, jobject signal_data, jint n_signals, jobject prop_data, jint n_props, jobject enum_data, jint n_enums, jobject class_info, jint n_info)
{
static QCString * _qstring_class_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMetaObjectJBridge((char*) QtSupport::toCharString(env, class_name, &_qstring_class_name), (QMetaObject*) QtSupport::getQt(env, superclass), (QMetaData*) QtSupport::getQt(env, slot_data), (int) n_slots, (QMetaData*) QtSupport::getQt(env, signal_data), (int) n_signals, (QMetaProperty*) QtSupport::getQt(env, prop_data), (int) n_props, (QMetaEnum*) QtSupport::getQt(env, enum_data), (int) n_enums, (QClassInfo*) QtSupport::getQt(env, class_info), (int) n_info));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QMetaObject_className(JNIEnv *env, jobject obj)
{
	const char * _qcstring;
	_qcstring = (const char *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->className();
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QMetaObject_superClassName(JNIEnv *env, jobject obj)
{
	const char * _qcstring;
	_qcstring = (const char *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->superClassName();
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_superClass(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->superClass(), "org.kde.qt.QMetaObject");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMetaObject_inherits(JNIEnv *env, jobject obj, jstring clname)
{
static QCString * _qstring_clname = 0;
	return (jboolean) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->inherits((char*) QtSupport::toCharString(env, clname, &_qstring_clname));
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numSlots__Z(JNIEnv *env, jobject obj, jboolean superClass)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numSlots((bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numSlots__(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numSlots(FALSE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numSignals__Z(JNIEnv *env, jobject obj, jboolean superClass)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numSignals((bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numSignals__(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numSignals(FALSE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findSlot__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring arg1, jboolean superClass)
{
static QCString * _qstring_arg1 = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findSlot((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1), (bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findSlot__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QCString * _qstring_arg1 = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findSlot((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1), FALSE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findSignal__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring arg1, jboolean superClass)
{
static QCString * _qstring_arg1 = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findSignal((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1), (bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findSignal__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring arg1)
{
static QCString * _qstring_arg1 = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findSignal((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1), FALSE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_slot__IZ(JNIEnv *env, jobject obj, jint index, jboolean superClass)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->slot((int) index, (bool) superClass), "org.kde.qt.QMetaData");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_slot__I(JNIEnv *env, jobject obj, jint index)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->slot((int) index, FALSE), "org.kde.qt.QMetaData");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_signal__IZ(JNIEnv *env, jobject obj, jint index, jboolean superClass)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->signal((int) index, (bool) superClass), "org.kde.qt.QMetaData");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_signal__I(JNIEnv *env, jobject obj, jint index)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->signal((int) index, FALSE), "org.kde.qt.QMetaData");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_slotNames(JNIEnv *env, jobject obj, jboolean superClass)
{
	QStrList  _qlist;
	_qlist = ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->slotNames((bool) superClass);
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList *) &_qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_signalNames(JNIEnv *env, jobject obj, jboolean superClass)
{
	QStrList  _qlist;
	_qlist = ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->signalNames((bool) superClass);
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList *) &_qlist);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_slotOffset(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->slotOffset();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_signalOffset(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->signalOffset();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_propertyOffset(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->propertyOffset();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numClassInfo__Z(JNIEnv *env, jobject obj, jboolean superClass)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numClassInfo((bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numClassInfo__(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numClassInfo(FALSE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_classInfo__IZ(JNIEnv *env, jobject obj, jint index, jboolean superClass)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->classInfo((int) index, (bool) superClass), "org.kde.qt.QClassInfo");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_classInfo__I(JNIEnv *env, jobject obj, jint index)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->classInfo((int) index, FALSE), "org.kde.qt.QClassInfo");
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QMetaObject_classInfo__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring name, jboolean superClass)
{
	const char * _qcstring;
static QCString * _qstring_name = 0;
	_qcstring = (const char *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->classInfo((char*) QtSupport::toCharString(env, name, &_qstring_name), (bool) superClass);
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_property__IZ(JNIEnv *env, jobject obj, jint index, jboolean superClass)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->property((int) index, (bool) superClass), "org.kde.qt.QMetaProperty");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_property__I(JNIEnv *env, jobject obj, jint index)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->property((int) index, FALSE), "org.kde.qt.QMetaProperty");
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findProperty__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring name, jboolean superClass)
{
static QCString * _qstring_name = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findProperty((char*) QtSupport::toCharString(env, name, &_qstring_name), (bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_findProperty__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QCString * _qstring_name = 0;
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->findProperty((char*) QtSupport::toCharString(env, name, &_qstring_name), FALSE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_indexOfProperty__Lorg_kde_qt_QMetaProperty_2Z(JNIEnv *env, jobject obj, jobject arg1, jboolean superClass)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->indexOfProperty((QMetaProperty*) QtSupport::getQt(env, arg1), (bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_indexOfProperty__Lorg_kde_qt_QMetaProperty_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->indexOfProperty((QMetaProperty*) QtSupport::getQt(env, arg1), FALSE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_resolveProperty__Lorg_kde_qt_QMetaProperty_2(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->resolveProperty((QMetaProperty*) QtSupport::getQt(env, arg1)), "org.kde.qt.QMetaProperty");
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_resolveProperty__I(JNIEnv *env, jobject obj, jint arg1)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->resolveProperty((int) arg1);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_propertyNames(JNIEnv *env, jobject obj, jboolean superClass)
{
	QStrList  _qlist;
	_qlist = ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->propertyNames((bool) superClass);
	return (jobject) QtSupport::arrayWithQStrList(env, (QStrList *) &_qlist);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numProperties__Z(JNIEnv *env, jobject obj, jboolean superClass)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numProperties((bool) superClass);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMetaObject_numProperties__(JNIEnv *env, jobject obj)
{
	return (jint) ((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->numProperties(FALSE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_enumerator__Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jstring name, jboolean superClass)
{
static QCString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->enumerator((char*) QtSupport::toCharString(env, name, &_qstring_name), (bool) superClass), "org.kde.qt.QMetaEnum");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_enumerator__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring name)
{
static QCString * _qstring_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMetaObjectJBridge*) QtSupport::getQt(env, obj))->enumerator((char*) QtSupport::toCharString(env, name, &_qstring_name), FALSE), "org.kde.qt.QMetaEnum");
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QMetaObject_new_metaobject(JNIEnv *env, jclass obj, jstring arg1, jobject arg2, jobject const, jint arg3, jobject const, jint arg4, jobject prop_data, jint n_props, jobject enum_data, jint n_enums, jobject class_info, jint n_info)
//{
//static QCString * _qstring_arg1 = 0;
//	return (jobject) QtSupport::objectForQtKey(env, (void *)QMetaObjectJBridge::new_metaobject((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1), (QMetaObject*) QtSupport::getQt(env, arg2), (QMetaData*) QtSupport::getQt(env, const), (int) arg3, (QMetaData*) QtSupport::getQt(env, const), (int) arg4, (QMetaProperty*) QtSupport::getQt(env, prop_data), (int) n_props, (QMetaEnum*) QtSupport::getQt(env, enum_data), (int) n_enums, (QClassInfo*) QtSupport::getQt(env, class_info), (int) n_info), "org.kde.qt.QMetaObject");
//}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMetaObject_metaObject(JNIEnv *env, jclass obj, jstring class_name)
{
static QCString * _qstring_class_name = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)QMetaObjectJBridge::metaObject((char*) QtSupport::toCharString(env, class_name, &_qstring_class_name)), "org.kde.qt.QMetaObject");
}

