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


@implementation  KProtocolManager

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


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

+ (NSString *) defaultUserAgent: (NSString *)keys
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_keys = 0L;
	_qstring = kde_KProtocolManager_defaultUserAgent1((qt_QString *) [keys toQString: &_qstring_keys]);
	return [NSString fromQString: _qstring];
}

+ (NSString *) userAgentForHost: (NSString *)arg1
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qstring = kde_KProtocolManager_userAgentForHost((qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return [NSString fromQString: _qstring];
}

+ (int) readTimeout
{
	return (int) kde_KProtocolManager_readTimeout();
}

+ (int) connectTimeout
{
	return (int) kde_KProtocolManager_connectTimeout();
}

+ (int) proxyConnectTimeout
{
	return (int) kde_KProtocolManager_proxyConnectTimeout();
}

+ (int) responseTimeout
{
	return (int) kde_KProtocolManager_responseTimeout();
}

//+ (int) defaultConnectTimeout
//{
//	return (int) kde_KProtocolManager_defaultConnectTimeout();
//}

+ (BOOL) useProxy
{
	return (BOOL) kde_KProtocolManager_useProxy();
}

+ (BOOL) useReverseProxy
{
	return (BOOL) kde_KProtocolManager_useReverseProxy();
}

+ (int) proxyType
{
	return (int) kde_KProtocolManager_proxyType();
}

+ (int) proxyAuthMode
{
	return (int) kde_KProtocolManager_proxyAuthMode();
}

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

+ (NSString *) proxyFor: (NSString *)arg1
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qstring = kde_KProtocolManager_proxyFor((qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return [NSString fromQString: _qstring];
}

+ (NSString *) proxyForURL: (KURL*)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KProtocolManager_proxyForURL((kde_KURL*) [arg1 qt]);
	return [NSString fromQString: _qstring];
}

+ badProxy: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	kde_KProtocolManager_badProxy((qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

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

+ (BOOL) useCache
{
	return (BOOL) kde_KProtocolManager_useCache();
}

+ (int) maxCacheAge
{
	return (int) kde_KProtocolManager_maxCacheAge();
}

+ (int) maxCacheSize
{
	return (int) kde_KProtocolManager_maxCacheSize();
}

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

+ (int) cacheControl
{
	return (int) kde_KProtocolManager_cacheControl();
}

+ (BOOL) autoResume
{
	return (BOOL) kde_KProtocolManager_autoResume();
}

+ (BOOL) markPartial
{
	return (BOOL) kde_KProtocolManager_markPartial();
}

+ (int) minimumKeepSize
{
	return (int) kde_KProtocolManager_minimumKeepSize();
}

+ (BOOL) persistentConnections
{
	return (BOOL) kde_KProtocolManager_persistentConnections();
}

+ reparseConfiguration
{
	kde_KProtocolManager_reparseConfiguration();
	return self;
}

+ (NSString *) slaveProtocol: (KURL*)url proxy: (NSString *)proxy
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_proxy = 0L;
	_qstring = kde_KProtocolManager_slaveProtocol((kde_KURL*) [url qt], (qt_QString *) [proxy toQString: &_qstring_proxy]);
	return [NSString fromQString: _qstring];
}

+ (KConfig*) config
{
	return (KConfig*) [QtSupport objectForQtKey: kde_KProtocolManager_config() withClass: [KConfig class] allocatedInObjcWorld: YES];
}

+ (int) NoProxy
{
	return (int) KPROTOCOLMANAGER_NoProxy;
}

+ (int) ManualProxy
{
	return (int) KPROTOCOLMANAGER_ManualProxy;
}

+ (int) PACProxy
{
	return (int) KPROTOCOLMANAGER_PACProxy;
}

+ (int) WPADProxy
{
	return (int) KPROTOCOLMANAGER_WPADProxy;
}

+ (int) EnvVarProxy
{
	return (int) KPROTOCOLMANAGER_EnvVarProxy;
}

+ (int) Prompt
{
	return (int) KPROTOCOLMANAGER_Prompt;
}

+ (int) Automatic
{
	return (int) KPROTOCOLMANAGER_Automatic;
}

@end
