/***************************************************************************
                            KIconViewItem.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, 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 <kdec/kde_KIconViewItem.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KIconViewItem.h>
#include <qtobjc/QColorGroup.h>
#include <qtobjc/QIconView.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QPicture.h>
#include <qtobjc/QPixmap.h>


@implementation  KIconViewItem


- initWithIconView: (QIconView*)parent
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem((qt_QIconView*) [parent qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithIconView: (QIconView*)parent after: (QIconViewItem*)after
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem1((qt_QIconView*) [parent qt], (qt_QIconViewItem*) [after qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

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

- initWithIconView: (QIconView*)parent after: (QIconViewItem*)after text: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem3((qt_QIconView*) [parent qt], (qt_QIconViewItem*) [after qt], (qt_QString *) [text toQString: &_qstring_text])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithIconView: (QIconView*)parent text: (NSString *)text icon: (QPixmap *)icon
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem4((qt_QIconView*) [parent qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QPixmap *) [icon qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithIconView: (QIconView*)parent after: (QIconViewItem*)after text: (NSString *)text icon: (QPixmap *)icon
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem5((qt_QIconView*) [parent qt], (qt_QIconViewItem*) [after qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QPixmap *) [icon qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithIconView: (QIconView*)parent text: (NSString *)text picture: (QPicture *)picture
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem6((qt_QIconView*) [parent qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QPicture *) [picture qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithIconView: (QIconView*)parent after: (QIconViewItem*)after text: (NSString *)text picture: (QPicture *)picture
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KIconViewItem7((qt_QIconView*) [parent qt], (qt_QIconViewItem*) [after qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QPicture *) [picture qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			kde_del_KIconViewItem((kde_KIconViewItem *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- init
{
	kde_KIconViewItem_init((kde_KIconViewItem *)[self qt]);
	return self;
}

- calcRect: (NSString *)text_
{
static qt_QString * _qstring_text_ = 0L;
	kde_KIconViewItem_calcRect((kde_KIconViewItem *)[self qt], (qt_QString *) [text_ toQString: &_qstring_text_]);
	return self;
}

- calcRect
{
	kde_KIconViewItem_calcRect((kde_KIconViewItem *)[self qt], qt_QString_null());
	return self;
}

- paintItem: (QPainter *)p c: (QColorGroup *)c
{
	kde_KIconViewItem_paintItem((kde_KIconViewItem *)[self qt], (qt_QPainter *) [p qt], (qt_QColorGroup *) [c qt]);
	return self;
}

@end
