/***************************************************************************
                            QIconSet.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_QIconSet.h>
#include <qtobjc/QIconSet.h>

@implementation  QIconSet

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


- init
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QIconSet()];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPixmap: (QPixmap *)arg1 int: (int)arg2
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QIconSet1((qt_QPixmap *) [arg1 qt], (int)arg2)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPixmap: (QPixmap *)arg1 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QIconSet1((qt_QPixmap *) [arg1 qt], [QIconSet Automatic])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPixmap: (QPixmap *)smallPix largePix: (QPixmap *)largePix
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QIconSet2((qt_QPixmap *) [smallPix qt], (qt_QPixmap *) [largePix qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- copyWithZone: (NSZone *) zone
{
	QIconSet * aCopy;
	aCopy = [[(QIconSet *)[[self class] allocWithZone: zone] setQt: qt_new_QIconSet3([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

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

- reset: (QPixmap *)arg1 int: (int)arg2
{
	qt_QIconSet_reset((qt_QIconSet *)[self qt], (qt_QPixmap *) [arg1 qt], (int)arg2);
	return self;
}

- setPixmap: (QPixmap *)arg1 int: (int)arg2 int: (int)arg3 int: (int)arg4
{
	qt_QIconSet_setPixmap((qt_QIconSet *)[self qt], (qt_QPixmap *) [arg1 qt], (int)arg2, (int)arg3, (int)arg4);
	return self;
}

- setPixmap: (QPixmap *)arg1 int: (int)arg2 
{
	qt_QIconSet_setPixmap((qt_QIconSet *)[self qt], (qt_QPixmap *) [arg1 qt], (int)arg2, [QIconSet Normal], [QIconSet Off]);
	return self;
}

- setPixmapFromString: (NSString *)arg1 int: (int)arg2 int: (int)arg3 int: (int)arg4
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QIconSet_setPixmap1((qt_QIconSet *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (int)arg2, (int)arg3, (int)arg4);
	return self;
}

- setPixmapFromString: (NSString *)arg1 int: (int)arg2
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QIconSet_setPixmap1((qt_QIconSet *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (int)arg2, [QIconSet Normal], [QIconSet Off]);
	return self;
}

- (QPixmap*) pixmap: (int)arg1 int: (int)arg2 int: (int)arg3
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QIconSet_pixmap((qt_QIconSet *)[self qt], (int)arg1, (int)arg2, (int)arg3) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) pixmap: (int)arg1 int: (int)arg2 
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QIconSet_pixmap((qt_QIconSet *)[self qt], (int)arg1, (int)arg2, [QIconSet Off]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) pixmap: (int)s enabled: (BOOL)enabled int: (int)arg1
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QIconSet_pixmap1((qt_QIconSet *)[self qt], (int)s, (int)enabled, (int)arg1) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) pixmap: (int)s enabled: (BOOL)enabled 
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QIconSet_pixmap1((qt_QIconSet *)[self qt], (int)s, (int)enabled, [QIconSet Off]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

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

- (BOOL) isGenerated: (int)arg1 int: (int)arg2 int: (int)arg3
{
	return (BOOL) qt_QIconSet_isGenerated((qt_QIconSet *)[self qt], (int)arg1, (int)arg2, (int)arg3);
}

- (BOOL) isGenerated: (int)arg1 int: (int)arg2 
{
	return (BOOL) qt_QIconSet_isGenerated((qt_QIconSet *)[self qt], (int)arg1, (int)arg2, [QIconSet Off]);
}

- clearGenerated
{
	qt_QIconSet_clearGenerated((qt_QIconSet *)[self qt]);
	return self;
}

- (BOOL) isNull
{
	return (BOOL) qt_QIconSet_isNull((qt_QIconSet *)[self qt]);
}

- detach
{
	qt_QIconSet_detach((qt_QIconSet *)[self qt]);
	return self;
}

+ setIconSize: (int)arg1 size: (QSize *)arg2
{
	qt_QIconSet_setIconSize((int)arg1, (qt_QSize *) [arg2 qt]);
	return self;
}

+ (QSize*) iconSize: (int)arg1
{
	return (QSize*) [QtSupport objectForQtKey: qt_QIconSet_iconSize((int)arg1) withClass: [QSize class] allocatedInObjcWorld: YES];
}

+ (int) Automatic
{
	return (int) QICONSET_Automatic;
}

+ (int) Small
{
	return (int) QICONSET_Small;
}

+ (int) Large
{
	return (int) QICONSET_Large;
}

+ (int) Normal
{
	return (int) QICONSET_Normal;
}

+ (int) Disabled
{
	return (int) QICONSET_Disabled;
}

+ (int) Active
{
	return (int) QICONSET_Active;
}

+ (int) On
{
	return (int) QICONSET_On;
}

+ (int) Off
{
	return (int) QICONSET_Off;
}

@end
