/***************************************************************************
                            QMenuItem.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_
#define INCLUDE_MENUITEM_DEF
#include <qmenudata.h>
#include <qstring.h>
#include <qcstring.h>

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

class QMenuItemJBridge : public QMenuItem
{
public:
	QMenuItemJBridge() : QMenuItem() {}
	~QMenuItemJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMenuItem_id(JNIEnv *env, jobject obj)
{
	return (jint) ((QMenuItemJBridge*) QtSupport::getQt(env, obj))->id();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMenuItem_iconSet(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMenuItemJBridge*) QtSupport::getQt(env, obj))->iconSet(), "org.kde.qt.QIconSet");
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMenuItem_popup(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMenuItemJBridge*) QtSupport::getQt(env, obj))->popup(), "org.kde.qt.QPopupMenu");
}

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMenuItem_custom(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMenuItemJBridge*) QtSupport::getQt(env, obj))->custom(), "org.kde.qt.QCustomMenuItem");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMenuItem_key(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QKeySequence (((QMenuItemJBridge*) QtSupport::getQt(env, obj))->key()), "org.kde.qt.QKeySequence", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMenuItem_signal(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QMenuItemJBridge*) QtSupport::getQt(env, obj))->signal(), "org.kde.qt.QSignal");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMenuItem_isSeparator(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMenuItemJBridge*) QtSupport::getQt(env, obj))->isSeparator();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMenuItem_isEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMenuItemJBridge*) QtSupport::getQt(env, obj))->isEnabled();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMenuItem_isChecked(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMenuItemJBridge*) QtSupport::getQt(env, obj))->isChecked();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMenuItem_isDirty(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMenuItemJBridge*) QtSupport::getQt(env, obj))->isDirty();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMenuItem_setText(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	((QMenuItemJBridge*) QtSupport::getQt(env, obj))->setText((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMenuItem_setDirty(JNIEnv *env, jobject obj, jboolean dirty)
{
	((QMenuItemJBridge*) QtSupport::getQt(env, obj))->setDirty((bool) dirty);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMenuItem_setWhatsThis(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	((QMenuItemJBridge*) QtSupport::getQt(env, obj))->setWhatsThis((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
	return;
}

