/***************************************************************************
                            QCheckBox.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_QCheckBox.h>
#include <qtobjc/QCheckBox.h>
#include <qtobjc/QPainter.h>

@implementation  QCheckBox


- initWithWidget: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QCheckBox((qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QCheckBox((qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent name: (NSString *)name
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QCheckBox1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent 
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QCheckBox1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (BOOL) isChecked
{
	return (BOOL) qt_QCheckBox_isChecked((qt_QCheckBox *)[self qt]);
}

- setNoChange
{
	qt_QCheckBox_setNoChange((qt_QCheckBox *)[self qt]);
	return self;
}

- setTristate: (BOOL)y
{
	qt_QCheckBox_setTristate((qt_QCheckBox *)[self qt], (int)y);
	return self;
}

- setTristate
{
	qt_QCheckBox_setTristate((qt_QCheckBox *)[self qt], 1);
	return self;
}

- (BOOL) isTristate
{
	return (BOOL) qt_QCheckBox_isTristate((qt_QCheckBox *)[self qt]);
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QCheckBox_sizeHint((qt_QCheckBox *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- setChecked: (BOOL)check
{
	qt_QCheckBox_setChecked((qt_QCheckBox *)[self qt], (int)check);
	return self;
}

- drawButton: (QPainter *)arg1
{
	qt_QCheckBox_drawButton((qt_QCheckBox *)[self qt], (qt_QPainter *) [arg1 qt]);
	return self;
}

- drawButtonLabel: (QPainter *)arg1
{
	qt_QCheckBox_drawButtonLabel((qt_QCheckBox *)[self qt], (qt_QPainter *) [arg1 qt]);
	return self;
}

- updateMask
{
	qt_QCheckBox_updateMask((qt_QCheckBox *)[self qt]);
	return self;
}

@end
