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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((QGridView*)QtSupport::getQt(env, obj))->parentWidget(TRUE) == (QWidget *) 0) {
		delete (QGridView*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_numRows(JNIEnv *env, jobject obj)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->numRows();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_setNumRows(JNIEnv *env, jobject obj, jint arg1)
{
	((QGridView*) QtSupport::getQt(env, obj))->setNumRows((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_numCols(JNIEnv *env, jobject obj)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->numCols();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_setNumCols(JNIEnv *env, jobject obj, jint arg1)
{
	((QGridView*) QtSupport::getQt(env, obj))->setNumCols((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_cellWidth(JNIEnv *env, jobject obj)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->cellWidth();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_setCellWidth(JNIEnv *env, jobject obj, jint arg1)
{
	((QGridView*) QtSupport::getQt(env, obj))->setCellWidth((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_cellHeight(JNIEnv *env, jobject obj)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->cellHeight();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_setCellHeight(JNIEnv *env, jobject obj, jint arg1)
{
	((QGridView*) QtSupport::getQt(env, obj))->setCellHeight((int) arg1);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QGridView_cellRect(JNIEnv *env, jobject obj)
{
	QRect _r= ((QGridView*) QtSupport::getQt(env, obj))->cellRect();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QGridView_cellGeometry(JNIEnv *env, jobject obj, jint row, jint column)
{
	QRect _r= ((QGridView*) QtSupport::getQt(env, obj))->cellGeometry((int) row, (int) column);
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QGridView_gridSize(JNIEnv *env, jobject obj)
{
	QSize _s= ((QGridView*) QtSupport::getQt(env, obj))->gridSize();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_rowAt(JNIEnv *env, jobject obj, jint y)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->rowAt((int) y);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QGridView_columnAt(JNIEnv *env, jobject obj, jint x)
{
	return (jint) ((QGridView*) QtSupport::getQt(env, obj))->columnAt((int) x);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_repaintCell__IIZ(JNIEnv *env, jobject obj, jint row, jint column, jboolean erase)
{
	((QGridView*) QtSupport::getQt(env, obj))->repaintCell((int) row, (int) column, (bool) erase);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_repaintCell__II(JNIEnv *env, jobject obj, jint row, jint column)
{
	((QGridView*) QtSupport::getQt(env, obj))->repaintCell((int) row, (int) column, TRUE);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_updateCell(JNIEnv *env, jobject obj, jint row, jint column)
{
	((QGridView*) QtSupport::getQt(env, obj))->updateCell((int) row, (int) column);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QGridView_ensureCellVisible(JNIEnv *env, jobject obj, jint row, jint column)
{
	((QGridView*) QtSupport::getQt(env, obj))->ensureCellVisible((int) row, (int) column);
	return;
}

