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

#include <kdeobjc/Job.h>


@implementation  KURLCompletion


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

- initWithInt: (int)arg1
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KURLCompletion1((int)arg1)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parent] == nil) {
			kde_del_KURLCompletion((kde_KURLCompletion *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) makeCompletion: (NSString *)arg1
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qstring = kde_KURLCompletion_makeCompletion((kde_KURLCompletion *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return [NSString fromQString: _qstring];
}

- setDir: (NSString *)dir
{
static qt_QString * _qstring_dir = 0L;
	kde_KURLCompletion_setDir((kde_KURLCompletion *)[self qt], (qt_QString *) [dir toQString: &_qstring_dir]);
	return self;
}

- (NSString *) dir
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KURLCompletion_dir((kde_KURLCompletion *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (BOOL) isRunning
{
	return (BOOL) kde_KURLCompletion_isRunning((kde_KURLCompletion *)[self qt]);
}

- stop
{
	kde_KURLCompletion_stop((kde_KURLCompletion *)[self qt]);
	return self;
}

- (int) mode
{
	return (int) kde_KURLCompletion_mode((kde_KURLCompletion *)[self qt]);
}

- setMode: (int)mode
{
	kde_KURLCompletion_setMode((kde_KURLCompletion *)[self qt], (int)mode);
	return self;
}

- (BOOL) replaceEnv
{
	return (BOOL) kde_KURLCompletion_replaceEnv((kde_KURLCompletion *)[self qt]);
}

- setReplaceEnv: (BOOL)replace
{
	kde_KURLCompletion_setReplaceEnv((kde_KURLCompletion *)[self qt], (int)replace);
	return self;
}

- (BOOL) replaceHome
{
	return (BOOL) kde_KURLCompletion_replaceHome((kde_KURLCompletion *)[self qt]);
}

- setReplaceHome: (BOOL)replace
{
	kde_KURLCompletion_setReplaceHome((kde_KURLCompletion *)[self qt], (int)replace);
	return self;
}

- (NSString *) replacedPath: (NSString *)text
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_text = 0L;
	_qstring = kde_KURLCompletion_replacedPath((kde_KURLCompletion *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return [NSString fromQString: _qstring];
}

- postProcessMatch: (NSString *)match
{
static qt_QString * _qstring_match = 0L;
	kde_KURLCompletion_postProcessMatch((kde_KURLCompletion *)[self qt], (qt_QString*) [match toQString: &_qstring_match]);
	return self;
}

- postProcessMatches: (NSArray *)matches
{
static qt_QStringList * _qlist_matches = 0L;
	kde_KURLCompletion_postProcessMatches((kde_KURLCompletion *)[self qt], (qt_QStringList*) [matches toQStringList: (void *)&_qlist_matches]);
	return self;
}

//- postProcessCompletionMatches: (KCompletionMatches*)matches
//{
//	kde_KURLCompletion_postProcessMatches1((kde_KURLCompletion *)[self qt], (kde_KCompletionMatches*) [matches qt]);
//	return self;
//}

//- slotEntries: (Job*)arg1 udsentrylist: (UDSEntryList*)arg2
//{
//	kde_KURLCompletion_slotEntries((kde_KURLCompletion *)[self qt], (kde_Job*) [arg1 qt], (kde_UDSEntryList*) [arg2 qt]);
//	return self;
//}

- slotIOFinished: (Job*)arg1
{
	kde_KURLCompletion_slotIOFinished((kde_KURLCompletion *)[self qt], (kde_Job*) [arg1 qt]);
	return self;
}

+ (int) ExeCompletion
{
	return (int) KURLCOMPLETION_ExeCompletion;
}

+ (int) FileCompletion
{
	return (int) KURLCOMPLETION_FileCompletion;
}

+ (int) DirCompletion
{
	return (int) KURLCOMPLETION_DirCompletion;
}

@end
