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

@implementation  KOpenWithDlg


- initWithArray: (NSArray *)urls parent: (QWidget *)parent
{
static kde_KURLList * _qlist_urls = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg((kde_KURLList*) [urls toKURLList: (void *)&_qlist_urls], (qt_QWidget *) [parent qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithArray: (NSArray *)urls 
{
static kde_KURLList * _qlist_urls = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg((kde_KURLList*) [urls toKURLList: (void *)&_qlist_urls], 0L)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithArray: (NSArray *)urls text: (NSString *)text value: (NSString *)value parent: (QWidget *)parent
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_text = 0L;
static kde_KURLList * _qlist_urls = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg1((kde_KURLList*) [urls toKURLList: (void *)&_qlist_urls], (qt_QString *) [text toQString: &_qstring_text], (qt_QString *) [value toQString: &_qstring_value], (qt_QWidget *) [parent qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithArray: (NSArray *)urls text: (NSString *)text value: (NSString *)value 
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_text = 0L;
static kde_KURLList * _qlist_urls = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg1((kde_KURLList*) [urls toKURLList: (void *)&_qlist_urls], (qt_QString *) [text toQString: &_qstring_text], (qt_QString *) [value toQString: &_qstring_value], 0L)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)serviceType value: (NSString *)value parent: (QWidget *)parent
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_serviceType = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg2((qt_QString *) [serviceType toQString: &_qstring_serviceType], (qt_QString *) [value toQString: &_qstring_value], (qt_QWidget *) [parent qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)serviceType value: (NSString *)value 
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_serviceType = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KOpenWithDlg2((qt_QString *) [serviceType toQString: &_qstring_serviceType], (qt_QString *) [value toQString: &_qstring_value], 0L)];
		[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_KOpenWithDlg((kde_KOpenWithDlg *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) text
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KOpenWithDlg_text((kde_KOpenWithDlg *)[self qt]);
	return [NSString fromQString: _qstring];
}

//- (KService_Ptr*) service
//{
//	return (KService_Ptr*) kde_KOpenWithDlg_service((kde_KOpenWithDlg *)[self qt]);
//}

- slotClear
{
	kde_KOpenWithDlg_slotClear((kde_KOpenWithDlg *)[self qt]);
	return self;
}

- slotSelected: (NSString *)_name _exec: (NSString *)_exec
{
static qt_QString * _qstring__exec = 0L;
static qt_QString * _qstring__name = 0L;
	kde_KOpenWithDlg_slotSelected((kde_KOpenWithDlg *)[self qt], (qt_QString *) [_name toQString: &_qstring__name], (qt_QString *) [_exec toQString: &_qstring__exec]);
	return self;
}

- slotHighlighted: (NSString *)_name _exec: (NSString *)_exec
{
static qt_QString * _qstring__exec = 0L;
static qt_QString * _qstring__name = 0L;
	kde_KOpenWithDlg_slotHighlighted((kde_KOpenWithDlg *)[self qt], (qt_QString *) [_name toQString: &_qstring__name], (qt_QString *) [_exec toQString: &_qstring__exec]);
	return self;
}

- slotTextChanged
{
	kde_KOpenWithDlg_slotTextChanged((kde_KOpenWithDlg *)[self qt]);
	return self;
}

- slotTerminalToggled: (BOOL)arg1
{
	kde_KOpenWithDlg_slotTerminalToggled((kde_KOpenWithDlg *)[self qt], (int)arg1);
	return self;
}

- slotDbClick
{
	kde_KOpenWithDlg_slotDbClick((kde_KOpenWithDlg *)[self qt]);
	return self;
}

- slotOK
{
	kde_KOpenWithDlg_slotOK((kde_KOpenWithDlg *)[self qt]);
	return self;
}

- setServiceType: (NSArray *)_urls
{
static kde_KURLList * _qlist__urls = 0L;
	kde_KOpenWithDlg_setServiceType((kde_KOpenWithDlg *)[self qt], (kde_KURLList*) [_urls toKURLList: (void *)&_qlist__urls]);
	return self;
}

- init: (NSString *)text value: (NSString *)value
{
static qt_QString * _qstring_value = 0L;
static qt_QString * _qstring_text = 0L;
	kde_KOpenWithDlg_init((kde_KOpenWithDlg *)[self qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QString *) [value toQString: &_qstring_value]);
	return self;
}

- accept
{
	kde_KOpenWithDlg_accept((kde_KOpenWithDlg *)[self qt]);
	return self;
}

@end
