/***************************************************************************
                            KKeyDialog.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_KKeyDialog.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KKeyDialog.h>
#include <kdeobjc/KAccel.h>
#include <kdeobjc/KGlobalAccel.h>
#include <kdeobjc/KActionCollection.h>


@implementation  KKeyDialog


- initWithBOOL: (BOOL)bAllowLetterShortcuts parent: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KKeyDialog((int)bAllowLetterShortcuts, (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KKeyDialog(1, 0, 0)];
		[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_KKeyDialog((kde_KKeyDialog *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (BOOL) insert: (KActionCollection*)arg1
{
	return (BOOL) kde_KKeyDialog_insert((kde_KKeyDialog *)[self qt], (kde_KActionCollection*) [arg1 qt]);
}

- (BOOL) configure: (BOOL)bSaveSettings
{
	return (BOOL) kde_KKeyDialog_configure((kde_KKeyDialog *)[self qt], (int)bSaveSettings);
}

- (BOOL) configure
{
	return (BOOL) kde_KKeyDialog_configure((kde_KKeyDialog *)[self qt], 1);
}

- commitChanges
{
	kde_KKeyDialog_commitChanges((kde_KKeyDialog *)[self qt]);
	return self;
}

+ (int) configureKeys: (KAccel*)keys parent: (QWidget *)parent bSaveSettings: (BOOL)bSaveSettings
{
	return (int) kde_KKeyDialog_configure1((kde_KAccel*) [keys qt], (qt_QWidget *) [parent qt], (int)bSaveSettings);
}

+ (int) configureKeys: (KAccel*)keys
{
	return (int) kde_KKeyDialog_configure1((kde_KAccel*) [keys qt], 0, 1);
}

+ (int) configureGlobalKeys: (KGlobalAccel*)keys parent: (QWidget *)parent bSaveSettings: (BOOL)bSaveSettings
{
	return (int) kde_KKeyDialog_configure2((kde_KGlobalAccel*) [keys qt], (qt_QWidget *) [parent qt], (int)bSaveSettings);
}

+ (int) configureGlobalKeys: (KGlobalAccel*)keys
{
	return (int) kde_KKeyDialog_configure2((kde_KGlobalAccel*) [keys qt], 0, 1);
}

+ (int) configureCollection: (KActionCollection*)coll parent: (QWidget *)parent bSaveSettings: (BOOL)bSaveSettings
{
	return (int) kde_KKeyDialog_configure3((kde_KActionCollection*) [coll qt], (qt_QWidget *) [parent qt], (int)bSaveSettings);
}

+ (int) configureCollection: (KActionCollection*)coll
{
	return (int) kde_KKeyDialog_configure3((kde_KActionCollection*) [coll qt], 0, 1);
}

+ (int) configureKeys: (KAccel*)keys save_settings: (BOOL)save_settings parent: (QWidget *)parent
{
	return (int) kde_KKeyDialog_configureKeys((kde_KAccel*) [keys qt], (int)save_settings, (qt_QWidget *) [parent qt]);
}

//+ (int) configureKeys: (KAccel*)keys
//{
//	return (int) kde_KKeyDialog_configureKeys((kde_KAccel*) [keys qt], 1, 0);
//}

+ (int) configureGlobalKeys: (KGlobalAccel*)keys save_settings: (BOOL)save_settings parent: (QWidget *)parent
{
	return (int) kde_KKeyDialog_configureKeys1((kde_KGlobalAccel*) [keys qt], (int)save_settings, (qt_QWidget *) [parent qt]);
}

//+ (int) configureGlobalKeys: (KGlobalAccel*)keys
//{
//	return (int) kde_KKeyDialog_configureKeys1((kde_KGlobalAccel*) [keys qt], 1, 0);
//}

+ (int) configureCollection: (KActionCollection*)coll string: (NSString *)arg1 save_settings: (BOOL)save_settings parent: (QWidget *)parent
{
static qt_QString * _qstring_arg1 = 0L;
	return (int) kde_KKeyDialog_configureKeys2((kde_KActionCollection*) [coll qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (int)save_settings, (qt_QWidget *) [parent qt]);
}

+ (int) configureCollection: (KActionCollection*)coll string: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	return (int) kde_KKeyDialog_configureKeys2((kde_KActionCollection*) [coll qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], 1, 0);
}

@end
