/***************************************************************************
                            QHBoxLayout.cpp -  description
                             -------------------
    begin                : Sun Nov  3 10:27:27 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Nov  3 10:27:27 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 <qlayout.h>
#include <qstring.h>
#include <qcstring.h>

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

class QHBoxLayoutJBridge : public QHBoxLayout
{
public:
	QHBoxLayoutJBridge(QWidget* parent, int border, int spacing, const char* name) : QHBoxLayout(parent, border, spacing, name) {}
	QHBoxLayoutJBridge(QLayout* parentLayout, int spacing, const char* name) : QHBoxLayout(parentLayout, spacing, name) {}
	QHBoxLayoutJBridge(int spacing, const char* name) : QHBoxLayout(spacing, name) {}
	~QHBoxLayoutJBridge() {QtSupport::qtKeyDeleted(this);}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
	void childEvent(QChildEvent* e) {
		if (! QtSupport::eventDelegate(this, "childEvent", e, "org.kde.qt.QChildEvent")) {
			QLayout::childEvent(e);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_newQHBoxLayout__Lorg_kde_qt_QWidget_2IILjava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jint border, jint spacing, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QHBoxLayoutJBridge((QWidget*) QtSupport::getQt(env, parent), (int) border, (int) spacing, (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_newQHBoxLayout__Lorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jobject parent)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QHBoxLayoutJBridge((QWidget*) QtSupport::getQt(env, parent), 0, -1, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_newQHBoxLayout__Lorg_kde_qt_QLayout_2ILjava_lang_String_2(JNIEnv *env, jobject obj, jobject parentLayout, jint spacing, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QHBoxLayoutJBridge((QLayout*) QtSupport::getQt(env, parentLayout), (int) spacing, (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_newQHBoxLayout__Lorg_kde_qt_QLayout_2(JNIEnv *env, jobject obj, jobject parentLayout)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QHBoxLayoutJBridge((QLayout*) QtSupport::getQt(env, parentLayout), -1, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_newQHBoxLayout__ILjava_lang_String_2(JNIEnv *env, jobject obj, jint spacing, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QHBoxLayoutJBridge((int) spacing, (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QHBoxLayout_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_qt_QHBoxLayout_finalize(env, obj);
	return;
}

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

