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

@implementation  KCharSelect


- initWithWidget: (QWidget *)parent name: (NSString *)name font: (NSString *)font chr: (unichar *)chr tableNum: (int)tableNum
{
static qt_QString * _qstring_font = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KCharSelect((qt_QWidget *) [parent qt], (char*) [name cString], (qt_QString *) [font toQString: &_qstring_font], (qt_QChar*)chr, (int)tableNum)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

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

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

- setFont: (NSString *)font
{
static qt_QString * _qstring_font = 0L;
	kde_KCharSelect_setFont((kde_KCharSelect *)[self qt], (qt_QString *) [font toQString: &_qstring_font]);
	return self;
}

- setChar: (unichar *)chr
{
	kde_KCharSelect_setChar((kde_KCharSelect *)[self qt], (qt_QChar*)chr);
	return self;
}

- setTableNum: (int)tableNum
{
	kde_KCharSelect_setTableNum((kde_KCharSelect *)[self qt], (int)tableNum);
	return self;
}

- (unichar*) chr
{
	return (unichar*) kde_KCharSelect_chr((kde_KCharSelect *)[self qt]);
}

- (NSString *) font
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KCharSelect_font((kde_KCharSelect *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (int) tableNum
{
	return (int) kde_KCharSelect_tableNum((kde_KCharSelect *)[self qt]);
}

- enableFontCombo: (BOOL)e
{
	kde_KCharSelect_enableFontCombo((kde_KCharSelect *)[self qt], (int)e);
	return self;
}

- enableTableSpinBox: (BOOL)e
{
	kde_KCharSelect_enableTableSpinBox((kde_KCharSelect *)[self qt], (int)e);
	return self;
}

- (BOOL) isFontComboEnabled
{
	return (BOOL) kde_KCharSelect_isFontComboEnabled((kde_KCharSelect *)[self qt]);
}

- (BOOL) isTableSpinBoxEnabled
{
	return (BOOL) kde_KCharSelect_isTableSpinBoxEnabled((kde_KCharSelect *)[self qt]);
}

- fillFontCombo
{
	kde_KCharSelect_fillFontCombo((kde_KCharSelect *)[self qt]);
	return self;
}

- fontSelected: (NSString *)_font
{
static qt_QString * _qstring__font = 0L;
	kde_KCharSelect_fontSelected((kde_KCharSelect *)[self qt], (qt_QString *) [_font toQString: &_qstring__font]);
	return self;
}

- tableChanged: (int)_value
{
	kde_KCharSelect_tableChanged((kde_KCharSelect *)[self qt], (int)_value);
	return self;
}

- charHighlighted: (unichar *)c
{
	kde_KCharSelect_charHighlighted((kde_KCharSelect *)[self qt], (qt_QChar*)c);
	return self;
}

- charHighlighted
{
	kde_KCharSelect_charHighlighted1((kde_KCharSelect *)[self qt]);
	return self;
}

- charActivated: (unichar *)c
{
	kde_KCharSelect_charActivated((kde_KCharSelect *)[self qt], (qt_QChar*)c);
	return self;
}

- charActivated
{
	kde_KCharSelect_charActivated1((kde_KCharSelect *)[self qt]);
	return self;
}

- charFocusItemChanged
{
	kde_KCharSelect_charFocusItemChanged((kde_KCharSelect *)[self qt]);
	return self;
}

- charFocusItemChanged: (unichar *)c
{
	kde_KCharSelect_charFocusItemChanged1((kde_KCharSelect *)[self qt], (qt_QChar*)c);
	return self;
}

- charTableUp
{
	kde_KCharSelect_charTableUp((kde_KCharSelect *)[self qt]);
	return self;
}

- charTableDown
{
	kde_KCharSelect_charTableDown((kde_KCharSelect *)[self qt]);
	return self;
}

- slotDoubleClicked
{
	kde_KCharSelect_slotDoubleClicked((kde_KCharSelect *)[self qt]);
	return self;
}

//+ cleanupFontDatabase
//{
//	kde_KCharSelect_cleanupFontDatabase();
//	return self;
//}

@end
