/***************************************************************************
                            QClipboard.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 <qclipboard.h>
#include <qstring.h>
#include <qcstring.h>
#include <qimage.h>
#include <qpixmap.h>

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QClipboard_clear(JNIEnv *env, jobject obj)
{
	((QClipboard*) QtSupport::getQt(env, obj))->clear();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QClipboard_supportsSelection(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QClipboard*) QtSupport::getQt(env, obj))->supportsSelection();
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QClipboard_ownsSelection(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QClipboard*) QtSupport::getQt(env, obj))->ownsSelection();
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QClipboard_ownsClipboard(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QClipboard*) QtSupport::getQt(env, obj))->ownsClipboard();
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QClipboard_setSelectionMode(JNIEnv *env, jobject obj, jboolean enable)
{
	((QClipboard*) QtSupport::getQt(env, obj))->setSelectionMode((bool) enable);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QClipboard_selectionModeEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QClipboard*) QtSupport::getQt(env, obj))->selectionModeEnabled();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QClipboard_data(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QClipboard*) QtSupport::getQt(env, obj))->data(), "org.kde.qt.QMimeSourceInterface");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QClipboard_setData(JNIEnv *env, jobject obj, jobject arg1)
{
	((QClipboard*) QtSupport::getQt(env, obj))->setData(QtSupport::mimeSource(env, arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QClipboard_text__(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QClipboard*) QtSupport::getQt(env, obj))->text();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QClipboard_text__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring subtype)
{
	QString  _qstring;
static QCString * _qcstring_subtype = 0;
	_qstring = ((QClipboard*) QtSupport::getQt(env, obj))->text((QCString&) * (QCString *) QtSupport::toQCString(env, subtype, &_qcstring_subtype));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QClipboard_setText(JNIEnv *env, jobject obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	((QClipboard*) QtSupport::getQt(env, obj))->setText((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QClipboard_image(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QImage (((QClipboard*) QtSupport::getQt(env, obj))->image()), "org.kde.qt.QImage", TRUE);
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QClipboard_setImage(JNIEnv *env, jobject obj, jobject arg1)
{
	((QClipboard*) QtSupport::getQt(env, obj))->setImage((QImage&) *(QImage *) QtSupport::getQt(env, arg1));
	return;
}

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

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QClipboard_connectNotify(JNIEnv *env, jobject obj, jstring arg1)
//{
//static QCString * _qstring_arg1 = 0;
//	((QClipboard*) QtSupport::getQt(env, obj))->protected_connectNotify((char*) QtSupport::toCharString(env, arg1, &_qstring_arg1));
//	return;
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QClipboard_event(JNIEnv *env, jobject obj, jobject arg1)
//{
//	return (jboolean) ((QClipboard*) QtSupport::getQt(env, obj))->protected_event((QEvent*) QtSupport::getQt(env, arg1));
//}

