/***************************************************************************
                            QSpacerItem.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/QSpacerItem.h>

class QSpacerItemJBridge : public QSpacerItem
{
public:
	QSpacerItemJBridge(int w, int h, QSizePolicy::SizeType hData, QSizePolicy::SizeType vData) : QSpacerItem(w, h, hData, vData) {}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QSpacerItem_newQSpacerItem__IIII(JNIEnv *env, jobject obj, jint w, jint h, jint hData, jint vData)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSpacerItemJBridge((int) w, (int) h, (QSizePolicy::SizeType) hData, (QSizePolicy::SizeType) vData));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSpacerItem_newQSpacerItem__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSpacerItemJBridge((int) w, (int) h, QSizePolicy::Minimum, QSizePolicy::Minimum));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSpacerItem_changeSize__IIII(JNIEnv *env, jobject obj, jint w, jint h, jint hData, jint vData)
{
	((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->changeSize((int) w, (int) h, (QSizePolicy::SizeType) hData, (QSizePolicy::SizeType) vData);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSpacerItem_changeSize__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->changeSize((int) w, (int) h, QSizePolicy::Minimum, QSizePolicy::Minimum);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSpacerItem_sizeHint(JNIEnv *env, jobject obj)
{
	QSize _s= ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->sizeHint();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSpacerItem_minimumSize(JNIEnv *env, jobject obj)
{
	QSize _s= ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->minimumSize();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSpacerItem_maximumSize(JNIEnv *env, jobject obj)
{
	QSize _s= ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->maximumSize();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSpacerItem_expanding(JNIEnv *env, jobject obj)
{
	return (jint) ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->expanding();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSpacerItem_isEmpty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->isEmpty();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSpacerItem_setGeometry(JNIEnv *env, jobject obj, jobject arg1)
{
	((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->setGeometry((QRect&) *(QRect *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSpacerItem_geometry(JNIEnv *env, jobject obj)
{
	QRect _r= ((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->geometry();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QSpacerItem_spacerItem(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QSpacerItemJBridge*) QtSupport::getQt(env, obj))->spacerItem(), "org.kde.qt.QSpacerItem");
}

