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

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

class QSizePolicyJBridge : public QSizePolicy
{
public:
	QSizePolicyJBridge() : QSizePolicy() {}
    QSizePolicyJBridge(SizeType hor, SizeType ver, bool hfw) : QSizePolicy(hor, ver, hfw) {}
	QSizePolicyJBridge(SizeType hor, SizeType ver, uchar hors, uchar vers, bool hfw) : QSizePolicy(hor, ver, hors, vers, hfw) {}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_newQSizePolicy__IIZ(JNIEnv *env, jobject obj, jint hor, jint ver, jboolean hfw)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSizePolicyJBridge((QSizePolicy::SizeType) hor, (QSizePolicy::SizeType) ver, (bool) hfw));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QSizePolicy_newQSizePolicy__II(JNIEnv *env, jobject obj, jint hor, jint ver)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QSizePolicyJBridge((QSizePolicy::SizeType) hor, (QSizePolicy::SizeType) ver);
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_newQSizePolicy__II(JNIEnv *env, jobject obj, jint hor, jint ver)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSizePolicyJBridge((QSizePolicy::SizeType) hor, (QSizePolicy::SizeType) ver, FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_newQSizePolicy__IISSZ(JNIEnv *env, jobject obj, jint hor, jint ver, jshort hors, jshort vers, jboolean hfw)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSizePolicyJBridge((QSizePolicy::SizeType) hor, (QSizePolicy::SizeType) ver, (uchar) hors, (uchar) vers, (bool) hfw));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_newQSizePolicy__IISS(JNIEnv *env, jobject obj, jint hor, jint ver, jshort hors, jshort vers)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QSizePolicyJBridge((QSizePolicy::SizeType) hor, (QSizePolicy::SizeType) ver, (uchar) hors, (uchar) vers, FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSizePolicy_horData(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizePolicy*) QtSupport::getQt(env, obj))->horData();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSizePolicy_verData(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizePolicy*) QtSupport::getQt(env, obj))->verData();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSizePolicy_mayShrinkHorizontally(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizePolicy*) QtSupport::getQt(env, obj))->mayShrinkHorizontally();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSizePolicy_mayShrinkVertically(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizePolicy*) QtSupport::getQt(env, obj))->mayShrinkVertically();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSizePolicy_mayGrowHorizontally(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizePolicy*) QtSupport::getQt(env, obj))->mayGrowHorizontally();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QSizePolicy_mayGrowVertically(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QSizePolicy*) QtSupport::getQt(env, obj))->mayGrowVertically();
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setHorData(JNIEnv *env, jobject obj, jint d)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->setHorData((QSizePolicy::SizeType) d);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setVerData(JNIEnv *env, jobject obj, jint d)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->setVerData((QSizePolicy::SizeType) d);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setHeightForWidth(JNIEnv *env, jobject obj, jboolean b)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->setHeightForWidth((bool) b);
	return;
}

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSizePolicy_horStretch(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizePolicy*) QtSupport::getQt(env, obj))->horStretch();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QSizePolicy_verStretch(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizePolicy*) QtSupport::getQt(env, obj))->verStretch();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setHorStretch(JNIEnv *env, jobject obj, jshort sf)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->setHorStretch((uchar) sf);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setVerStretch(JNIEnv *env, jobject obj, jshort sf)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->setVerStretch((uchar) sf);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_transpose(JNIEnv *env, jobject obj)
{
	((QSizePolicy*) QtSupport::getQt(env, obj))->transpose();
	return;
}

