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

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

class QWheelEventJBridge : public QWheelEvent
{
public:
	QWheelEventJBridge(const QPoint& pos, int delta, int state, Orientation orient) : QWheelEvent(pos, delta, state, orient) {}
	QWheelEventJBridge(const QPoint& pos, const QPoint& globalPos, int delta, int state, Orientation orient) : QWheelEvent(pos, globalPos, delta, state, orient) {}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_newQWheelEvent__Lorg_kde_qt_QPoint_2III(JNIEnv *env, jobject obj, jobject pos, jint delta, jint state, jint orient)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QWheelEventJBridge((QPoint&) *(QPoint *) QtSupport::getQt(env, pos), (int) delta, (int) state, (Qt::Orientation) orient));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_newQWheelEvent__Lorg_kde_qt_QPoint_2II(JNIEnv *env, jobject obj, jobject pos, jint delta, jint state)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QWheelEventJBridge((QPoint&) *(QPoint *) QtSupport::getQt(env, pos), (int) delta, (int) state, QWheelEvent::Vertical));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_newQWheelEvent__Lorg_kde_qt_QPoint_2Lorg_kde_qt_QPoint_2III(JNIEnv *env, jobject obj, jobject pos, jobject globalPos, jint delta, jint state, jint orient)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QWheelEventJBridge((QPoint&) *(QPoint *) QtSupport::getQt(env, pos), (QPoint&) *(QPoint *) QtSupport::getQt(env, globalPos), (int) delta, (int) state, (Qt::Orientation) orient));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_newQWheelEvent__Lorg_kde_qt_QPoint_2Lorg_kde_qt_QPoint_2II(JNIEnv *env, jobject obj, jobject pos, jobject globalPos, jint delta, jint state)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QWheelEventJBridge((QPoint&) *(QPoint *) QtSupport::getQt(env, pos), (QPoint&) *(QPoint *) QtSupport::getQt(env, globalPos), (int) delta, (int) state, QWheelEvent::Vertical));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_delta(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->delta();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QWheelEvent_pos(JNIEnv *env, jobject obj)
{
	QPoint _p= ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->pos();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPoint(_p.x(),_p.y()), "org.kde.qt.QPoint", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QWheelEvent_globalPos(JNIEnv *env, jobject obj)
{
	QPoint _p= ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->globalPos();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPoint(_p.x(),_p.y()), "org.kde.qt.QPoint", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_x(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->x();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_y(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->y();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_globalX(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->globalX();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_globalY(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->globalY();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_state(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->state();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QWheelEvent_orientation(JNIEnv *env, jobject obj)
{
	return (jint) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->orientation();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QWheelEvent_isAccepted(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QWheelEventJBridge*) QtSupport::getQt(env, obj))->isAccepted();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_accept(JNIEnv *env, jobject obj)
{
	((QWheelEventJBridge*) QtSupport::getQt(env, obj))->accept();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWheelEvent_ignore(JNIEnv *env, jobject obj)
{
	((QWheelEventJBridge*) QtSupport::getQt(env, obj))->ignore();
	return;
}

