class KProtocolManager

Provides information about I/O (Internet, etc. More...

Definition#include <kprotocolmanager.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Static Methods


Detailed Description

Provides information about I/O (Internet, etc.) settings chosen/set by the end user.

KProtocolManager has a heap of static functions that allows only read access to KDE's IO related settings. These include proxy, cache, file transfer resumption, timeout and user-agent related settings.

The information provided by this class is generic enough to be applicable to any application that makes use of KDE's IO sub-system. Note that this mean the proxy, timeout etc. settings are saved in a separate user-specific config file and not in the config file of the application.

Original author:

Revised by:

QString  defaultUserAgent ()

defaultUserAgent

[static]

Returns the default user-agent string.

This function returns the default user-agent string

QString  defaultUserAgent (const QString &keys)

defaultUserAgent

[static]

Returns the default user-agent value.

This function returns the default user-agent value taking into account 'keys'

Keys can be any of the folliwing: 'o' Show OS 'v' Show OS Version 'p' Show platform 'm' Show machine architecture 'l' Show language

QString  userAgentForHost ( const QString& )

userAgentForHost

[static]

Returns the userAgent string configured for the specified host.

If hostname is not found or is empty (i.e. "" or QString::null) this function will return the default user agent.

Parameters:
hostnamename of the host

Returns: specified userAgent string

int  readTimeout ()

readTimeout

[static]

Returns the preferred timeout value for reading from remote connections in seconds.

Returns: timeout value for remote connection in secs.

int  connectTimeout ()

connectTimeout

[static]

Returns the preferred timeout value for remote connections in seconds.

Returns: timeout value for remote connection in secs.

int  proxyConnectTimeout ()

proxyConnectTimeout

[static]

Returns the preferred timeout value for proxy connections in seconds.

Returns: timeout value for proxy connection in secs.

int  responseTimeout ()

responseTimeout

[static]

Returns the preferred response timeout value for remote connecting in seconds.

Returns: timeout value for remote connection in seconds.

int  defaultConnectTimeout ()

defaultConnectTimeout

[static]

Returns the set default timeout value for connecting to remote machines.

Returns: timeout value in seconds

bool  useProxy ()

useProxy

[static]

Returns whether or not the user specified the use of proxy server to make connections.

bool  useReverseProxy ()

useReverseProxy

[static]

Returns whether or not the the proxy server lookup should be reversed or not.

enum ProxyType { NoProxy, ManualProxy, PACProxy, WPADProxy, EnvVarProxy }

ProxyType

Types of proxy configuration

ProxyType  proxyType ()

proxyType

[static]

Returns the type of proxy configuration that is used.

enum ProxyAuthMode { Prompt, Automatic }

ProxyAuthMode

Proxy authorization modes.

ProxyAuthMode  proxyAuthMode ()

proxyAuthMode

[static]

Returns the way proxy authorization should be handled.

See also: ProxyAuthMode

QString  noProxyFor ()

noProxyFor

[static]

Returns the strings for hosts that should contacted DIRECT bypassing any proxy settings.

QString  proxyFor ( const QString& )

proxyFor

[static]

QString  proxyForURL ( const KURL& )

proxyForURL

[static]

Returns the Proxy server address for a given URL If automatic proxy configuration is configured, KPAC is used to determine the proxy server, otherwise the return value of proxyFor for the URL's protocol is used. If an empty string is returned, the request is to be aborted, a return value of "DIRECT" requests a direct connection.

Parameters:
urlthe URL whose proxy info is needed

Returns: the proxy server address if one is available

void  badProxy ( const QString & )

badProxy

[static]

Marks this proxy as bad (down). It will not be used for the next 30 minutes. (The script may supply an alternate proxy)

QString  proxyConfigScript ()

proxyConfigScript

[static]

Returns: the URL of the script for automatic proxy configuration

bool  useCache ()

useCache

[static]

Returns true/false to indicate whether a cache should be used

Returns:

int  maxCacheAge ()

maxCacheAge

[static]

Returns the maximum age in seconds cached files should be kept before they are deleted as necessary.

Returns:

int  maxCacheSize ()

maxCacheSize

[static]

Returns the maximum size that can be used for caching.

By default this function returns the DEFAULT_MAX_CACHE_SIZE value as defined in http_slave_defaults.h. Not that the value returned is in bytes, hence a value of 5120 would mean 5 Kb.

Returns: the maximum cache size to

QString  cacheDir ()

cacheDir

[static]

The directory which contains the cache files

KIO::CacheControl  cacheControl ()

cacheControl

[static]

Returns the Cache control directive to be used.

bool  autoResume ()

autoResume

[static]

Returns true if partial downloads should be automatically resumed.

bool  markPartial ()

markPartial

[static]

Returns true if partial downloads should be marked with a ".part" extension.

int  minimumKeepSize ()

minimumKeepSize

[static]

Returns the minimum file size for keeping aborted downloads.

Any data downloaded that does not meet this minimum requirement will simply be discarded. The default size is 5 KB.

@ return the minimum keep size for aborted downloads in bytes.

bool  persistentConnections ()

persistentConnections

[static]

Returns true if connections should be persistent

void  reparseConfiguration ()

reparseConfiguration

[static]

Force a reload of the general config file of io-slaves ( kioslaverc).

QString  slaveProtocol (const KURL &url, QString &proxy)

slaveProtocol

[static]

Return the protocol to use in order to handle the given url It's usually the same, except that FTP, when handled by a proxy, needs an HTTP ioslave.

When a proxy is to be used, proxy contains the URL for the proxy.

KConfigconfig ()

config

[static]

(Shared with SlaveConfig)