/***************************************************************************
                            KPaletteTable.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_KPaletteTable.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KPaletteTable.h>

@implementation  KPaletteTable


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

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

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			kde_del_KPaletteTable((kde_KPaletteTable *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- addToCustomColors: (QColor *)arg1
{
	kde_KPaletteTable_addToCustomColors((kde_KPaletteTable *)[self qt], (qt_QColor *) [arg1 qt]);
	return self;
}

- addToRecentColors: (QColor *)arg1
{
	kde_KPaletteTable_addToRecentColors((kde_KPaletteTable *)[self qt], (qt_QColor *) [arg1 qt]);
	return self;
}

- (NSString *) palette
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KPaletteTable_palette((kde_KPaletteTable *)[self qt]);
	return [NSString fromQString: _qstring];
}

- setPalette: (NSString *)paletteName
{
static qt_QString * _qstring_paletteName = 0L;
	kde_KPaletteTable_setPalette((kde_KPaletteTable *)[self qt], (qt_QString *) [paletteName toQString: &_qstring_paletteName]);
	return self;
}

- readNamedColor
{
	kde_KPaletteTable_readNamedColor((kde_KPaletteTable *)[self qt]);
	return self;
}

- slotColorCellSelected: (int)arg1
{
	kde_KPaletteTable_slotColorCellSelected((kde_KPaletteTable *)[self qt], (int)arg1);
	return self;
}

- slotColorTextSelected: (NSString *)colorText
{
static qt_QString * _qstring_colorText = 0L;
	kde_KPaletteTable_slotColorTextSelected((kde_KPaletteTable *)[self qt], (qt_QString *) [colorText toQString: &_qstring_colorText]);
	return self;
}

- slotSetPalette: (NSString *)_paletteName
{
static qt_QString * _qstring__paletteName = 0L;
	kde_KPaletteTable_slotSetPalette((kde_KPaletteTable *)[self qt], (qt_QString *) [_paletteName toQString: &_qstring__paletteName]);
	return self;
}

- slotShowNamedColorReadError
{
	kde_KPaletteTable_slotShowNamedColorReadError((kde_KPaletteTable *)[self qt]);
	return self;
}

@end
