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

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

class QRangeControlJBridge : public QRangeControl
{
public:
	QRangeControlJBridge() : QRangeControl() {}
	QRangeControlJBridge(int minValue, int maxValue, int lineStep, int pageStep, int value) : QRangeControl(minValue, maxValue, lineStep, pageStep, value) {}
	~QRangeControlJBridge() {QtSupport::qtKeyDeleted(this);}
	int  protected_positionFromValue(int val, int space) {
		return (int ) QRangeControl::positionFromValue(val, space);
	}
	int  protected_valueFromPosition(int pos, int space) {
		return (int ) QRangeControl::valueFromPosition(pos, space);
	}
	void protected_directSetValue(int val) {
		QRangeControl::directSetValue(val);
		return;
	}
	int  protected_prevValue() {
		return (int ) QRangeControl::prevValue();
	}
	void protected_valueChange() {
		QRangeControl::valueChange();
		return;
	}
	void protected_rangeChange() {
		QRangeControl::rangeChange();
		return;
	}
	void protected_stepChange() {
		QRangeControl::stepChange();
		return;
	}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_newQRangeControl__IIIII(JNIEnv *env, jobject obj, jint minValue, jint maxValue, jint lineStep, jint pageStep, jint value)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QRangeControlJBridge((int) minValue, (int) maxValue, (int) lineStep, (int) pageStep, (int) value));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QRangeControl*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_value(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->value();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_setValue(JNIEnv *env, jobject obj, jint arg1)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->setValue((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_addPage(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->addPage();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_subtractPage(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->subtractPage();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_addLine(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->addLine();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_subtractLine(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->subtractLine();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_minValue(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->minValue();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_maxValue(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->maxValue();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_setRange(JNIEnv *env, jobject obj, jint minValue, jint maxValue)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->setRange((int) minValue, (int) maxValue);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_setMinValue(JNIEnv *env, jobject obj, jint minVal)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->setMinValue((int) minVal);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_setMaxValue(JNIEnv *env, jobject obj, jint minVal)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->setMaxValue((int) minVal);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_lineStep(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->lineStep();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_pageStep(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->pageStep();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_setSteps(JNIEnv *env, jobject obj, jint line, jint page)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->setSteps((int) line, (int) page);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_bound(JNIEnv *env, jobject obj, jint arg1)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->bound((int) arg1);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_positionFromValue(JNIEnv *env, jobject obj, jint val, jint space)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_positionFromValue((int) val, (int) space);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_valueFromPosition(JNIEnv *env, jobject obj, jint pos, jint space)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_valueFromPosition((int) pos, (int) space);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_directSetValue(JNIEnv *env, jobject obj, jint val)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_directSetValue((int) val);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QRangeControl_prevValue(JNIEnv *env, jobject obj)
{
	return (jint) ((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_prevValue();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_valueChange(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_valueChange();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_rangeChange(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_rangeChange();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QRangeControl_stepChange(JNIEnv *env, jobject obj)
{
	((QRangeControlJBridge*) QtSupport::getQt(env, obj))->protected_stepChange();
	return;
}

