/***************************************************************************
                            QCheckTableItem.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_QCheckTableItem.h>
#include <qtobjc/QCheckTableItem.h>
#include <qtobjc/QColorGroup.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QRect.h>
#include <qtobjc/QTable.h>
#include <qtobjc/QWidget.h>


@implementation  QCheckTableItem


- initWithTable: (QTable*)table txt: (NSString *)txt
{
static qt_QString * _qstring_txt = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QCheckTableItem((qt_QTable*) [table qt], (qt_QString *) [txt toQString: &_qstring_txt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (QWidget*) createEditor
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QCheckTableItem_createEditor((qt_QCheckTableItem *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- setContentFromEditor: (QWidget *)w
{
	qt_QCheckTableItem_setContentFromEditor((qt_QCheckTableItem *)[self qt], (qt_QWidget *) [w qt]);
	return self;
}

- paint: (QPainter *)p cg: (QColorGroup *)cg cr: (QRect*)cr selected: (BOOL)selected
{
	qt_QCheckTableItem_paint((qt_QCheckTableItem *)[self qt], (qt_QPainter *) [p qt], (qt_QColorGroup *) [cg qt], (qt_QRect*) [cr qt], (int)selected);
	return self;
}

- setChecked: (BOOL)b
{
	qt_QCheckTableItem_setChecked((qt_QCheckTableItem *)[self qt], (int)b);
	return self;
}

- (BOOL) isChecked
{
	return (BOOL) qt_QCheckTableItem_isChecked((qt_QCheckTableItem *)[self qt]);
}

- (int) rtti
{
	return (int) qt_QCheckTableItem_rtti((qt_QCheckTableItem *)[self qt]);
}

@end
