/***************************************************************************
                            QSizePolicy.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 <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) {}
};


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 jint JNICALL
Java_org_kde_qt_QSizePolicy_horData(JNIEnv *env, jobject obj)
{
	return (jint) ((QSizePolicyJBridge*) QtSupport::getQt(env, obj))->horData();
}

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

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

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

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

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

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

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

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

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

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

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setHorStretch(JNIEnv *env, jobject obj, jstring sf)
{
static QCString * _qstring_sf = 0;
	((QSizePolicyJBridge*) QtSupport::getQt(env, obj))->setHorStretch((uchar) QtSupport::toCharString(env, sf, &_qstring_sf));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QSizePolicy_setVerStretch(JNIEnv *env, jobject obj, jstring sf)
{
static QCString * _qstring_sf = 0;
	((QSizePolicyJBridge*) QtSupport::getQt(env, obj))->setVerStretch((uchar) QtSupport::toCharString(env, sf, &_qstring_sf));
	return;
}

