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

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

class QVBoxLayoutJBridge : public QVBoxLayout
{
public:
	QVBoxLayoutJBridge(QWidget* parent, int border, int spacing, const char* name) : QVBoxLayout(parent, border, spacing, name) {}
	QVBoxLayoutJBridge(QLayout* parentLayout, int spacing, const char* name) : QVBoxLayout(parentLayout, spacing, name) {}
	QVBoxLayoutJBridge(int spacing, const char* name) : QVBoxLayout(spacing, name) {}
	~QVBoxLayoutJBridge() {QtSupport::qtKeyDeleted(this);}
	void childEvent(QChildEvent* e) {
		if (! QtSupport::eventDelegate(this, "childEvent", e, "org.kde.qt.QChildEvent")) {
			QLayout::childEvent(e);
		}
		return;
	}
	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;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QVBoxLayout_newQVBoxLayout__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 QVBoxLayoutJBridge((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_QVBoxLayout_newQVBoxLayout__Lorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jobject parent)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QVBoxLayoutJBridge((QWidget*) QtSupport::getQt(env, parent), 0, -1, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QVBoxLayout_newQVBoxLayout__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 QVBoxLayoutJBridge((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_QVBoxLayout_newQVBoxLayout__Lorg_kde_qt_QLayout_2(JNIEnv *env, jobject obj, jobject parentLayout)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QVBoxLayoutJBridge((QLayout*) QtSupport::getQt(env, parentLayout), -1, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QVBoxLayout_newQVBoxLayout__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 QVBoxLayoutJBridge((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_QVBoxLayout_newQVBoxLayout__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QVBoxLayoutJBridge(-1, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

