/***************************************************************************
                            QIconViewItem.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_QIconViewItem.h>
#include <qtobjc/QIconView.h>
#include <qtobjc/QPixmap.h>
#include <qtobjc/QPoint.h>
#include <qtobjc/QRect.h>
#include <qtobjc/QSize.h>
#include <qtobjc/QMimeSource.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QColorGroup.h>
#include <qtobjc/QPicture.h>

@implementation  QIconViewItem


- initWithIconView: (QIconView*)parent
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QIconViewItem((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: qt_new_QIconViewItem1((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: qt_new_QIconViewItem2((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: qt_new_QIconViewItem3((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: qt_new_QIconViewItem4((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: qt_new_QIconViewItem5((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: qt_new_QIconViewItem6((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: qt_new_QIconViewItem7((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]) {
			qt_del_QIconViewItem((qt_QIconViewItem *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setRenameEnabled: (BOOL)allow
{
	qt_QIconViewItem_setRenameEnabled((qt_QIconViewItem *)[self qt], (int)allow);
	return self;
}

- setDragEnabled: (BOOL)allow
{
	qt_QIconViewItem_setDragEnabled((qt_QIconViewItem *)[self qt], (int)allow);
	return self;
}

- setDropEnabled: (BOOL)allow
{
	qt_QIconViewItem_setDropEnabled((qt_QIconViewItem *)[self qt], (int)allow);
	return self;
}

- (NSString *) text
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QIconViewItem_text((qt_QIconViewItem *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (QPixmap*) pixmap
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QIconViewItem_pixmap((qt_QIconViewItem *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPicture*) picture
{
	return (QPicture*) [QtSupport objectForQtKey: qt_QIconViewItem_picture((qt_QIconViewItem *)[self qt]) withClass: [QPicture class] allocatedInObjcWorld: YES];
}

- (NSString *) key
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QIconViewItem_key((qt_QIconViewItem *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (BOOL) renameEnabled
{
	return (BOOL) qt_QIconViewItem_renameEnabled((qt_QIconViewItem *)[self qt]);
}

- (BOOL) dragEnabled
{
	return (BOOL) qt_QIconViewItem_dragEnabled((qt_QIconViewItem *)[self qt]);
}

- (BOOL) dropEnabled
{
	return (BOOL) qt_QIconViewItem_dropEnabled((qt_QIconViewItem *)[self qt]);
}

- (QIconView*) iconView
{
	return (QIconView*) [QtSupport objectForQtKey: qt_QIconViewItem_iconView((qt_QIconViewItem *)[self qt]) withClass: [QIconView class] allocatedInObjcWorld: YES];
}

- (QIconViewItem*) prevItem
{
	return (QIconViewItem*) [QtSupport objectForQtKey: qt_QIconViewItem_prevItem((qt_QIconViewItem *)[self qt]) withClass: [QIconViewItem class] allocatedInObjcWorld: YES];
}

- (QIconViewItem*) nextItem
{
	return (QIconViewItem*) [QtSupport objectForQtKey: qt_QIconViewItem_nextItem((qt_QIconViewItem *)[self qt]) withClass: [QIconViewItem class] allocatedInObjcWorld: YES];
}

- (int) index
{
	return (int) qt_QIconViewItem_index((qt_QIconViewItem *)[self qt]);
}

- setSelected: (BOOL)s cb: (BOOL)cb
{
	qt_QIconViewItem_setSelected((qt_QIconViewItem *)[self qt], (int)s, (int)cb);
	return self;
}

- setSelected: (BOOL)s
{
	qt_QIconViewItem_setSelected1((qt_QIconViewItem *)[self qt], (int)s);
	return self;
}

- setSelectable: (BOOL)s
{
	qt_QIconViewItem_setSelectable((qt_QIconViewItem *)[self qt], (int)s);
	return self;
}

- (BOOL) isSelected
{
	return (BOOL) qt_QIconViewItem_isSelected((qt_QIconViewItem *)[self qt]);
}

- (BOOL) isSelectable
{
	return (BOOL) qt_QIconViewItem_isSelectable((qt_QIconViewItem *)[self qt]);
}

- repaint
{
	qt_QIconViewItem_repaint((qt_QIconViewItem *)[self qt]);
	return self;
}

- (BOOL) move: (int)x y: (int)y
{
	return (BOOL) qt_QIconViewItem_move((qt_QIconViewItem *)[self qt], (int)x, (int)y);
}

- moveBy: (int)dx dy: (int)dy
{
	qt_QIconViewItem_moveBy((qt_QIconViewItem *)[self qt], (int)dx, (int)dy);
	return self;
}

- (BOOL) move: (QPoint*)pnt
{
	return (BOOL) qt_QIconViewItem_move1((qt_QIconViewItem *)[self qt], (qt_QPoint*) [pnt qt]);
}

- moveBy: (QPoint*)pnt
{
	qt_QIconViewItem_moveBy1((qt_QIconViewItem *)[self qt], (qt_QPoint*) [pnt qt]);
	return self;
}

- (QRect*) rect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QIconViewItem_rect((qt_QIconViewItem *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (int) x
{
	return (int) qt_QIconViewItem_x((qt_QIconViewItem *)[self qt]);
}

- (int) y
{
	return (int) qt_QIconViewItem_y((qt_QIconViewItem *)[self qt]);
}

- (int) width
{
	return (int) qt_QIconViewItem_width((qt_QIconViewItem *)[self qt]);
}

- (int) height
{
	return (int) qt_QIconViewItem_height((qt_QIconViewItem *)[self qt]);
}

- (QSize*) size
{
	return (QSize*) [QtSupport objectForQtKey: qt_QIconViewItem_size((qt_QIconViewItem *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QPoint*) pos
{
	return (QPoint*) [QtSupport objectForQtKey: qt_QIconViewItem_pos((qt_QIconViewItem *)[self qt]) withClass: [QPoint class] allocatedInObjcWorld: YES];
}

- (QRect*) textRect: (BOOL)relative
{
	return (QRect*) [QtSupport objectForQtKey: qt_QIconViewItem_textRect((qt_QIconViewItem *)[self qt], (int)relative) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) textRect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QIconViewItem_textRect((qt_QIconViewItem *)[self qt], 1) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) pixmapRect: (BOOL)relative
{
	return (QRect*) [QtSupport objectForQtKey: qt_QIconViewItem_pixmapRect((qt_QIconViewItem *)[self qt], (int)relative) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) pixmapRect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QIconViewItem_pixmapRect((qt_QIconViewItem *)[self qt], 1) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (BOOL) contains: (QPoint*)pnt
{
	return (BOOL) qt_QIconViewItem_contains((qt_QIconViewItem *)[self qt], (qt_QPoint*) [pnt qt]);
}

- (BOOL) intersects: (QRect*)r
{
	return (BOOL) qt_QIconViewItem_intersects((qt_QIconViewItem *)[self qt], (qt_QRect*) [r qt]);
}

- (BOOL) acceptDrop: (QMimeSource*)mime
{
	return (BOOL) qt_QIconViewItem_acceptDrop((qt_QIconViewItem *)[self qt], (qt_QMimeSource*) [mime qt]);
}

- rename
{
	qt_QIconViewItem_rename((qt_QIconViewItem *)[self qt]);
	return self;
}

- (int) compare: (QIconViewItem*)i
{
	return (int) qt_QIconViewItem_compare((qt_QIconViewItem *)[self qt], (qt_QIconViewItem*) [i qt]);
}

- setText: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QIconViewItem_setText((qt_QIconViewItem *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setPixmap: (QPixmap *)icon
{
	qt_QIconViewItem_setPixmap((qt_QIconViewItem *)[self qt], (qt_QPixmap *) [icon qt]);
	return self;
}

- setPicture: (QPicture *)icon
{
	qt_QIconViewItem_setPicture((qt_QIconViewItem *)[self qt], (qt_QPicture *) [icon qt]);
	return self;
}

- setText: (NSString *)text recalc: (BOOL)recalc redraw: (BOOL)redraw
{
static qt_QString * _qstring_text = 0L;
	qt_QIconViewItem_setText1((qt_QIconViewItem *)[self qt], (qt_QString *) [text toQString: &_qstring_text], (int)recalc, (int)redraw);
	return self;
}

- setText: (NSString *)text recalc: (BOOL)recalc 
{
static qt_QString * _qstring_text = 0L;
	qt_QIconViewItem_setText1((qt_QIconViewItem *)[self qt], (qt_QString *) [text toQString: &_qstring_text], (int)recalc, 1);
	return self;
}

- setPixmap: (QPixmap *)icon recalc: (BOOL)recalc redraw: (BOOL)redraw
{
	qt_QIconViewItem_setPixmap1((qt_QIconViewItem *)[self qt], (qt_QPixmap *) [icon qt], (int)recalc, (int)redraw);
	return self;
}

- setPixmap: (QPixmap *)icon recalc: (BOOL)recalc 
{
	qt_QIconViewItem_setPixmap1((qt_QIconViewItem *)[self qt], (qt_QPixmap *) [icon qt], (int)recalc, 1);
	return self;
}

- setKey: (NSString *)k
{
static qt_QString * _qstring_k = 0L;
	qt_QIconViewItem_setKey((qt_QIconViewItem *)[self qt], (qt_QString *) [k toQString: &_qstring_k]);
	return self;
}

- (int) rtti
{
	return (int) qt_QIconViewItem_rtti((qt_QIconViewItem *)[self qt]);
}

- removeRenameBox
{
	qt_QIconViewItem_removeRenameBox((qt_QIconViewItem *)[self qt]);
	return self;
}

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

- calcRect
{
	qt_QIconViewItem_calcRect((qt_QIconViewItem *)[self qt], qt_QString_null());
	return self;
}

- paintItem: (QPainter *)p cg: (QColorGroup *)cg
{
	qt_QIconViewItem_paintItem((qt_QIconViewItem *)[self qt], (qt_QPainter *) [p qt], (qt_QColorGroup *) [cg qt]);
	return self;
}

- paintFocus: (QPainter *)p cg: (QColorGroup *)cg
{
	qt_QIconViewItem_paintFocus((qt_QIconViewItem *)[self qt], (qt_QPainter *) [p qt], (qt_QColorGroup *) [cg qt]);
	return self;
}

- dragEntered
{
	qt_QIconViewItem_dragEntered((qt_QIconViewItem *)[self qt]);
	return self;
}

- dragLeft
{
	qt_QIconViewItem_dragLeft((qt_QIconViewItem *)[self qt]);
	return self;
}

- setItemRect: (QRect*)r
{
	qt_QIconViewItem_setItemRect((qt_QIconViewItem *)[self qt], (qt_QRect*) [r qt]);
	return self;
}

- setTextRect: (QRect*)r
{
	qt_QIconViewItem_setTextRect((qt_QIconViewItem *)[self qt], (qt_QRect*) [r qt]);
	return self;
}

- setPixmapRect: (QRect*)r
{
	qt_QIconViewItem_setPixmapRect((qt_QIconViewItem *)[self qt], (qt_QRect*) [r qt]);
	return self;
}

- calcTmpText
{
	qt_QIconViewItem_calcTmpText((qt_QIconViewItem *)[self qt]);
	return self;
}

@end
