/***************************************************************************
                            QGridView.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 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 12:08:37 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QGridView.h>
#include <qtobjc/QGridView.h>

@implementation  QGridView


- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			qt_del_QGridView((qt_QGridView *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (int) numRows
{
	return (int) qt_QGridView_numRows((qt_QGridView *)[self qt]);
}

- setNumRows: (int)arg1
{
	qt_QGridView_setNumRows((qt_QGridView *)[self qt], (int)arg1);
	return self;
}

- (int) numCols
{
	return (int) qt_QGridView_numCols((qt_QGridView *)[self qt]);
}

- setNumCols: (int)arg1
{
	qt_QGridView_setNumCols((qt_QGridView *)[self qt], (int)arg1);
	return self;
}

- (int) cellWidth
{
	return (int) qt_QGridView_cellWidth((qt_QGridView *)[self qt]);
}

- setCellWidth: (int)arg1
{
	qt_QGridView_setCellWidth((qt_QGridView *)[self qt], (int)arg1);
	return self;
}

- (int) cellHeight
{
	return (int) qt_QGridView_cellHeight((qt_QGridView *)[self qt]);
}

- setCellHeight: (int)arg1
{
	qt_QGridView_setCellHeight((qt_QGridView *)[self qt], (int)arg1);
	return self;
}

- (QRect*) cellRect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QGridView_cellRect((qt_QGridView *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) cellGeometry: (int)row column: (int)column
{
	return (QRect*) [QtSupport objectForQtKey: qt_QGridView_cellGeometry((qt_QGridView *)[self qt], (int)row, (int)column) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QSize*) gridSize
{
	return (QSize*) [QtSupport objectForQtKey: qt_QGridView_gridSize((qt_QGridView *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (int) rowAt: (int)y
{
	return (int) qt_QGridView_rowAt((qt_QGridView *)[self qt], (int)y);
}

- (int) columnAt: (int)x
{
	return (int) qt_QGridView_columnAt((qt_QGridView *)[self qt], (int)x);
}

- repaintCell: (int)row column: (int)column erase: (BOOL)erase
{
	qt_QGridView_repaintCell((qt_QGridView *)[self qt], (int)row, (int)column, (int)erase);
	return self;
}

- repaintCell: (int)row column: (int)column 
{
	qt_QGridView_repaintCell((qt_QGridView *)[self qt], (int)row, (int)column, 1);
	return self;
}

- updateCell: (int)row column: (int)column
{
	qt_QGridView_updateCell((qt_QGridView *)[self qt], (int)row, (int)column);
	return self;
}

- ensureCellVisible: (int)row column: (int)column
{
	qt_QGridView_ensureCellVisible((qt_QGridView *)[self qt], (int)row, (int)column);
	return self;
}

@end
