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

JNIEXPORT void JNICALL
Java_org_kde_qt_QLayoutItem_finalize(JNIEnv *env, jobject obj)
{
	if (	QtSupport::allocatedInJavaWorld(env, obj)
			&& ((QLayoutItem*)QtSupport::getQt(env, obj))->layout() == 0
			&& ((QLayoutItem*)QtSupport::getQt(env, obj))->widget() == 0
			&& ((QLayoutItem*)QtSupport::getQt(env, obj))->spacerItem() == 0 )
	{
		delete (QLayoutItem*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QLayoutItem_sizeHint(JNIEnv *env, jobject obj)
{
	QSize _s= ((QLayoutItem*) 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_QLayoutItem_minimumSize(JNIEnv *env, jobject obj)
{
	QSize _s= ((QLayoutItem*) 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_QLayoutItem_maximumSize(JNIEnv *env, jobject obj)
{
	QSize _s= ((QLayoutItem*) 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_QLayoutItem_expanding(JNIEnv *env, jobject obj)
{
	return (jint) ((QLayoutItem*) QtSupport::getQt(env, obj))->expanding();
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QLayoutItem_geometry(JNIEnv *env, jobject obj)
{
	QRect _r= ((QLayoutItem*) 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 jboolean JNICALL
Java_org_kde_qt_QLayoutItem_isEmpty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QLayoutItem*) QtSupport::getQt(env, obj))->isEmpty();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QLayoutItem_hasHeightForWidth(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QLayoutItem*) QtSupport::getQt(env, obj))->hasHeightForWidth();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QLayoutItem_heightForWidth(JNIEnv *env, jobject obj, jint arg1)
{
	return (jint) ((QLayoutItem*) QtSupport::getQt(env, obj))->heightForWidth((int) arg1);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QLayoutItem_invalidate(JNIEnv *env, jobject obj)
{
	((QLayoutItem*) QtSupport::getQt(env, obj))->invalidate();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QLayoutItem_widget(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QLayoutItem*) QtSupport::getQt(env, obj))->widget(), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QLayoutItem_iterator(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QLayoutIterator (((QLayoutItem*) QtSupport::getQt(env, obj))->iterator()), "org.kde.qt.QLayoutIterator", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QLayoutItem_layout(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QLayoutItem*) QtSupport::getQt(env, obj))->layout(), "org.kde.qt.QLayout");
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QLayoutItem_alignment(JNIEnv *env, jobject obj)
{
	return (jint) ((QLayoutItem*) QtSupport::getQt(env, obj))->alignment();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QLayoutItem_setAlignment(JNIEnv *env, jobject obj, jint a)
{
	((QLayoutItem*) QtSupport::getQt(env, obj))->setAlignment((int) a);
	return;
}

