/***************************************************************************
                            NetAccess.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_NetAccess.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/NetAccess.h>
#include <kdeobjc/KURL.h>


@implementation  NetAccess


+ (BOOL) download: (KURL*)src target: (NSString *)target
{
static qt_QString * _qstring_target = 0L;
	return (BOOL) kde_NetAccess_download((kde_KURL*) [src qt], (qt_QString *) [target toQString: &_qstring_target]);
}

+ removeTempFile: (NSString *)name
{
static qt_QString * _qstring_name = 0L;
	kde_NetAccess_removeTempFile((qt_QString *) [name toQString: &_qstring_name]);
	return self;
}

+ (BOOL) upload: (NSString *)src target: (KURL*)target
{
static qt_QString * _qstring_src = 0L;
	return (BOOL) kde_NetAccess_upload((qt_QString *) [src toQString: &_qstring_src], (kde_KURL*) [target qt]);
}

+ (BOOL) copy: (KURL*)src target: (KURL*)target
{
	return (BOOL) kde_NetAccess_copy((kde_KURL*) [src qt], (kde_KURL*) [target qt]);
}

+ (BOOL) dircopy: (KURL*)src target: (KURL*)target
{
	return (BOOL) kde_NetAccess_dircopy((kde_KURL*) [src qt], (kde_KURL*) [target qt]);
}

+ (BOOL) exists: (KURL*)url
{
	return (BOOL) kde_NetAccess_exists((kde_KURL*) [url qt]);
}

//+ (BOOL) stat: (KURL*)url entry: (UDSEntry*)entry
//{
//	return (BOOL) kde_NetAccess_stat((kde_KURL*) [url qt], (kde_UDSEntry*) [entry qt]);
//}

+ (BOOL) del: (KURL*)url
{
	return (BOOL) kde_NetAccess_del((kde_KURL*) [url qt]);
}

+ (BOOL) mkdir: (KURL*)url permissions: (int)permissions
{
	return (BOOL) kde_NetAccess_mkdir((kde_KURL*) [url qt], (int)permissions);
}

+ (BOOL) mkdir: (KURL*)url 
{
	return (BOOL) kde_NetAccess_mkdir((kde_KURL*) [url qt], -1);
}

//+ (NSString *) mimetype: (KURL*)url
//{
//static qt_QString * _qstring = 0L;
//	_qstring = kde_NetAccess_mimetype((kde_KURL*) [url qt]);
//	return [NSString fromQString: _qstring];
//}

+ (NSString *) lastErrorString
{
static qt_QString * _qstring = 0L;
	_qstring = kde_NetAccess_lastErrorString();
	return [NSString fromQString: _qstring];
}

@end
