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

@implementation  KSpellConfig


- initWithWidget: (QWidget *)parent name: (NSString *)name spellConfig: (KSpellConfig*)spellConfig addHelpButton: (BOOL)addHelpButton
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KSpellConfig((qt_QWidget *) [parent qt], (char*) [name cString], (kde_KSpellConfig*) [spellConfig qt], (int)addHelpButton)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

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

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

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

- setIgnoreList: (NSArray *)_ignorelist
{
static qt_QStringList * _qlist__ignorelist = 0L;
	kde_KSpellConfig_setIgnoreList((kde_KSpellConfig *)[self qt], (qt_QStringList*) [_ignorelist toQStringList: (void *)&_qlist__ignorelist]);
	return self;
}

- setNoRootAffix: (BOOL)arg1
{
	kde_KSpellConfig_setNoRootAffix((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- setRunTogether: (BOOL)arg1
{
	kde_KSpellConfig_setRunTogether((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- setDictionary: (NSString *)qs
{
static qt_QString * _qstring_qs = 0L;
	kde_KSpellConfig_setDictionary((kde_KSpellConfig *)[self qt], (qt_QString *) [qs toQString: &_qstring_qs]);
	return self;
}

- setDictFromList: (BOOL)dfl
{
	kde_KSpellConfig_setDictFromList((kde_KSpellConfig *)[self qt], (int)dfl);
	return self;
}

- setEncoding: (int)enctype
{
	kde_KSpellConfig_setEncoding((kde_KSpellConfig *)[self qt], (int)enctype);
	return self;
}

- setClient: (int)client
{
	kde_KSpellConfig_setClient((kde_KSpellConfig *)[self qt], (int)client);
	return self;
}

- (BOOL) noRootAffix
{
	return (BOOL) kde_KSpellConfig_noRootAffix((kde_KSpellConfig *)[self qt]);
}

- (BOOL) runTogether
{
	return (BOOL) kde_KSpellConfig_runTogether((kde_KSpellConfig *)[self qt]);
}

- (NSString *) dictionary
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KSpellConfig_dictionary((kde_KSpellConfig *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (BOOL) dictFromList
{
	return (BOOL) kde_KSpellConfig_dictFromList((kde_KSpellConfig *)[self qt]);
}

- (int) encoding
{
	return (int) kde_KSpellConfig_encoding((kde_KSpellConfig *)[self qt]);
}

- (NSArray *) ignoreList
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KSpellConfig_ignoreList((kde_KSpellConfig *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (int) client
{
	return (int) kde_KSpellConfig_client((kde_KSpellConfig *)[self qt]);
}

- (BOOL) writeGlobalSettings
{
	return (BOOL) kde_KSpellConfig_writeGlobalSettings((kde_KSpellConfig *)[self qt]);
}

- activateHelp
{
	kde_KSpellConfig_activateHelp((kde_KSpellConfig *)[self qt]);
	return self;
}

- fillInDialog
{
	kde_KSpellConfig_fillInDialog((kde_KSpellConfig *)[self qt]);
	return self;
}

- (BOOL) readGlobalSettings
{
	return (BOOL) kde_KSpellConfig_readGlobalSettings((kde_KSpellConfig *)[self qt]);
}

- (BOOL) interpret: (NSString *)fname lname: (NSString *)lname hname: (NSString *)hname
{
static qt_QString * _qstring_hname = 0L;
static qt_QString * _qstring_lname = 0L;
static qt_QString * _qstring_fname = 0L;
	return (BOOL) kde_KSpellConfig_interpret((kde_KSpellConfig *)[self qt], (qt_QString *) [fname toQString: &_qstring_fname], (qt_QString *) [lname toQString: &_qstring_lname], (qt_QString *) [hname toQString: &_qstring_hname]);
}

- sHelp
{
	kde_KSpellConfig_sHelp((kde_KSpellConfig *)[self qt]);
	return self;
}

- sNoAff: (BOOL)arg1
{
	kde_KSpellConfig_sNoAff((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sRunTogether: (BOOL)arg1
{
	kde_KSpellConfig_sRunTogether((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sDictionary: (BOOL)arg1
{
	kde_KSpellConfig_sDictionary((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sPathDictionary: (BOOL)arg1
{
	kde_KSpellConfig_sPathDictionary((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sSetDictionary: (int)arg1
{
	kde_KSpellConfig_sSetDictionary((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sChangeEncoding: (int)arg1
{
	kde_KSpellConfig_sChangeEncoding((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

- sChangeClient: (int)arg1
{
	kde_KSpellConfig_sChangeClient((kde_KSpellConfig *)[self qt], (int)arg1);
	return self;
}

+ (int) rdictlist
{
	return (int) KSPELLCONFIG_rdictlist;
}

+ (int) rencoding
{
	return (int) KSPELLCONFIG_rencoding;
}

+ (int) rhelp
{
	return (int) KSPELLCONFIG_rhelp;
}

@end
