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

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



JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((QDragObject*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (QDragObject*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDragObject_drag__(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QDragObject*) QtSupport::getQt(env, obj))->drag();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDragObject_dragMove(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QDragObject*) QtSupport::getQt(env, obj))->dragMove();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_dragCopy(JNIEnv *env, jobject obj)
{
	((QDragObject*) QtSupport::getQt(env, obj))->dragCopy();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_dragLink(JNIEnv *env, jobject obj)
{
	((QDragObject*) QtSupport::getQt(env, obj))->dragLink();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_setPixmap__Lorg_kde_qt_QPixmap_2(JNIEnv *env, jobject obj, jobject arg1)
{
	((QDragObject*) QtSupport::getQt(env, obj))->setPixmap((QPixmap) *(QPixmap *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_setPixmap__Lorg_kde_qt_QPixmap_2Lorg_kde_qt_QPoint_2(JNIEnv *env, jobject obj, jobject arg1, jobject hotspot)
{
	((QDragObject*) QtSupport::getQt(env, obj))->setPixmap((QPixmap) *(QPixmap *) QtSupport::getQt(env, arg1), (QPoint&) *(QPoint *) QtSupport::getQt(env, hotspot));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDragObject_pixmap(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((QDragObject*) QtSupport::getQt(env, obj))->pixmap()), "org.kde.qt.QPixmap", TRUE);
}

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QDragObject_target(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QDragObject::target(), "org.kde.qt.QWidget");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QDragObject_setTarget(JNIEnv *env, jclass obj, jobject arg1)
{
	QDragObject::setTarget((QWidget*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QDragObject_format(JNIEnv *env, jobject obj, jint n)
{
	 const char*  _qcstring;
	_qcstring = (const char *)((QDragObject*) QtSupport::getQt(env, obj))->format((int) n);
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QDragObject_provides(JNIEnv *env, jobject obj, jstring arg1)
{
static QCString * _qstring_arg1 = 0;
	return (jboolean) ((QDragObject*) QtSupport::getQt(env, obj))->provides((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1));
}

JNIEXPORT jbyteArray JNICALL
Java_org_kde_qt_QDragObject_encodedData(JNIEnv *env, jobject obj, jstring arg1)
{
	QByteArray  _qbyteArray;
static QCString * _qstring_arg1 = 0;
	_qbyteArray = ((QDragObject*) QtSupport::getQt(env, obj))->encodedData((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1));
	return QtSupport::fromQByteArray(env, &_qbyteArray);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QDragObject_serialNumber(JNIEnv *env, jobject obj)
{
	return (jint) ((QDragObject*) QtSupport::getQt(env, obj))->serialNumber();
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QDragObject_mimeSource(JNIEnv * env, jobject obj)
{
	return (jlong) (QMimeSource *) (QDragObject *) QtSupport::getQt(env, obj);
}

