/***************************************************************************
                            KActionMenu.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, 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 <kaction.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KActionMenu.h>

class KActionMenuJBridge : public KActionMenu
{
public:
	KActionMenuJBridge(const QString& text, QObject* parent, const char* name) : KActionMenu(text, parent, name) {}
	KActionMenuJBridge(const QString& text, const QIconSet& icon, QObject* parent, const char* name) : KActionMenu(text, icon, parent, name) {}
	KActionMenuJBridge(const QString& text, const QString& icon, QObject* parent, const char* name) : KActionMenu(text, icon, parent, name) {}
	KActionMenuJBridge(QObject* parent, const char* name) : KActionMenu(parent, name) {}
	~KActionMenuJBridge() {QtSupport::qtKeyDeleted(this);}
//	void protected_setText(int id, const QString& text) {
//		KActionMenu::setText(id, text);
//		return;
//	}
//	void protected_setIconSet(int id, const QIconSet& iconSet) {
//		KActionMenu::setIconSet(id, iconSet);
//		return;
//	}
	void protected_setIconSet(const QIconSet& i) {
		KActionMenu::setIconSet(i);
		return;
	}
	void protected_setText(const QString& s) {
		KActionMenu::setText(s);
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), 0, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2Lorg_kde_qt_QIconSet_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jobject icon, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QIconSet&) *(QIconSet *) QtSupport::getQt(env, icon), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2Lorg_kde_qt_QIconSet_2(JNIEnv *env, jobject obj, jstring text, jobject icon)
{
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QIconSet&) *(QIconSet *) QtSupport::getQt(env, icon), 0, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2Ljava_lang_String_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jstring icon, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
static QString * _qstring_icon = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, icon, &_qstring_icon), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring text, jstring icon)
{
static QString * _qstring_icon = 0;
static QString * _qstring_text = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text), (QString&) * (QString *) QtSupport::toQString(env, icon, &_qstring_icon), 0, 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_newKActionMenu__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KActionMenuJBridge((QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KActionMenu_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KActionMenu_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_insert__Lorg_kde_koala_KAction_2I(JNIEnv *env, jobject obj, jobject arg1, jint index)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->insert((KAction*) QtSupport::getQt(env, arg1), (int) index);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_insert__Lorg_kde_koala_KAction_2(JNIEnv *env, jobject obj, jobject arg1)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->insert((KAction*) QtSupport::getQt(env, arg1), -1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_remove(JNIEnv *env, jobject obj, jobject arg1)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->remove((KAction*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_koala_KActionMenu_popupMenu(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((KActionMenu*) QtSupport::getQt(env, obj))->popupMenu(), "org.kde.koala.KPopupMenu");
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_popup(JNIEnv *env, jobject obj, jobject global)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->popup((QPoint&) *(QPoint *) QtSupport::getQt(env, global));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KActionMenu_delayed(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KActionMenu*) QtSupport::getQt(env, obj))->delayed();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_setDelayed(JNIEnv *env, jobject obj, jboolean _delayed)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->setDelayed((bool) _delayed);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KActionMenu_stickyMenu(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KActionMenu*) QtSupport::getQt(env, obj))->stickyMenu();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_setStickyMenu(JNIEnv *env, jobject obj, jboolean sticky)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->setStickyMenu((bool) sticky);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KActionMenu_plug__Lorg_kde_qt_QWidget_2I(JNIEnv *env, jobject obj, jobject widget, jint index)
{
	return (jint) ((KActionMenu*) QtSupport::getQt(env, obj))->plug((QWidget*) QtSupport::getQt(env, widget), (int) index);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KActionMenu_plug__Lorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jobject widget)
{
	return (jint) ((KActionMenu*) QtSupport::getQt(env, obj))->plug((QWidget*) QtSupport::getQt(env, widget), -1);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_unplug(JNIEnv *env, jobject obj, jobject widget)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->unplug((QWidget*) QtSupport::getQt(env, widget));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_setEnabled(JNIEnv *env, jobject obj, jboolean b)
{
	((KActionMenu*) QtSupport::getQt(env, obj))->setEnabled((bool) b);
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KActionMenu_setText__ILjava_lang_String_2(JNIEnv *env, jobject obj, jint identifier, jstring text)
//{
//static QString * _qstring_text = 0;
//	((KActionMenuJBridge*) QtSupport::getQt(env, obj))->protected_setText((int) identifier, (QString&) * (QString *) QtSupport::toQString(env, text, &_qstring_text));
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_koala_KActionMenu_setIconSet__ILorg_kde_qt_QIconSet_2(JNIEnv *env, jobject obj, jint identifier, jobject iconSet)
//{
//	((KActionMenuJBridge*) QtSupport::getQt(env, obj))->protected_setIconSet((int) identifier, (QIconSet&) *(QIconSet *) QtSupport::getQt(env, iconSet));
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_setIconSet__Lorg_kde_qt_QIconSet_2(JNIEnv *env, jobject obj, jobject i)
{
	((KActionMenuJBridge*) QtSupport::getQt(env, obj))->protected_setIconSet((QIconSet&) *(QIconSet *) QtSupport::getQt(env, i));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KActionMenu_setText__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring s)
{
static QString * _qstring_s = 0;
	((KActionMenuJBridge*) QtSupport::getQt(env, obj))->protected_setText((QString&) * (QString *) QtSupport::toQString(env, s, &_qstring_s));
	return;
}

