class KProtocolManager

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

Information about I/O (Internet, etc.) settings.

KProtocolManager has a heap of static functions that allows you to read and write IO related KDE settings. These include proxy settings, file transfer resuming, and general timeout settings.

Note however that these settings apply to all applications. This means that the proxy, timeouts etc. are saved in the users config file and not in the config file of the application.

Original author:

Revised by:

QString  defaultUserAgent ()

defaultUserAgent

[static]

Returns the default user-agent value.

This function returns the default user-agent value

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

void  setUserAgentList ( const QStringList& )

setUserAgentList

[static]

TODO KDE 3.0: remove me

QStringList  userAgentList ()

userAgentList

[static]

TODO KDE 3.0: remove me

int  readTimeout ()

readTimeout

[static]

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

The minimum value that is accept is set above or below the threshold limit, this function will return the default value given by defaultConnectTimeout().

Returns: timeout value for remote connection in secs.

int  connectTimeout ()

connectTimeout

[static]

Returns the preferred timeout value for remote connections in secs.

The maximum value that can be set by the user is 6 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultConnectTimeout().

Returns: timeout value for remote connection in secs.

int  proxyConnectTimeout ()

proxyConnectTimeout

[static]

Returns the preferred timeout value for proxy connections in secs.

The maximum value that can be set by the user is 2 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultProxyConnectTimeout()

Returns: timeout value for proxy connection in secs.

int  responseTimeout ()

responseTimeout

[static]

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

The maximum value that can be set by the user is 6 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultResponseTimeout()

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

int  defaultReadTimeout ()

defaultReadTimeout

[static]

TODO KDE 3.0: Remove

int  defaultProxyConnectTimeout ()

defaultProxyConnectTimeout

[static]

TODO KDE 3.0: Remove

int  defaultResponseTimeout ()

defaultResponseTimeout

[static]

TODO KDE 3.0: Remove

int  minimumTimeoutThreshold ()

minimumTimeoutThreshold

[static]

TODO KDE 3.0: Remove

void  setReadTimeout ( int timeout )

setReadTimeout

[static]

Sets the amount of time to wait for a response from the socket

Parameters:
timeout, the timeout value in seconds.

void  setConnectTimeout ( int timeout )

setConnectTimeout

[static]

Sets the amount of time to wait for data arrival from the remote/peer machine.

Parameters:
timeout, the timeout value in seconds.

void  setProxyConnectTimeout ( int timeout )

setProxyConnectTimeout

[static]

Sets the amount of time to wait for data arrival from the remote/peer machine.

Parameters:
timeout, the timeout value in seconds.

void  setResponseTimeout ( int timeout )

setResponseTimeout

[static]

Sets the amount of time to wait for data arrival from the remote/peer machine.

Parameters:
timeout, the 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  ftpProxy ()

ftpProxy

[static]

QString  httpProxy ()

httpProxy

[static]

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)

void  setUseProxy ( bool _mode )

setUseProxy

[static]

This method has been deprecated. Use setProxyType instead.

void  setUseReverseProxy ( bool _mode )

setUseReverseProxy

[static]

Sets the proxy exception lookup to be reversed and only URLs matching addresses in that list use proxy servers.

Note that this flag only applies if the chosen proxy configuration type is either ManualProxy or EnvVarProxy. See ProxyType.

Parameters:
iftrue do a reverse proxy lookup.

void  setProxyType ( ProxyType type )

setProxyType

[static]

Set the type of proxy configuration to use.

Parameters:
typethe ProxyType to use.

void  setProxyAuthMode ( ProxyAuthMode mode )

setProxyAuthMode

[static]

Sets the proxy authorization mode to use.

Parameters:
modeProxyAuthMode

void  setFtpProxy ( const QString& _proxy )

setFtpProxy

[static]

Set the proxy for FTP transfer.

This method has been deprecated, please use setProxyFor.

void  setHttpProxy ( const QString& _proxy )

setHttpProxy

[static]

Set the proxy for HTTP transfer

This method has been deprecated, please use setProxyFor.

void  setProxyFor ( const QString& , const QString& )

setProxyFor

[static]

void  setNoProxyFor ( const QString& _noproxy )

setNoProxyFor

[static]

Set the URLs for which we should or should not use a proxy server.

In reverse lookup mode only the URL matching addresses in this list are allowed to use proxy servers.

QString  proxyConfigScript ()

proxyConfigScript

[static]

Returns: the URL of the script for automatic proxy configuration

void  setProxyConfigScript ( const QString & )

setProxyConfigScript

[static]

Set the URL of the script for automatic proxy configuration

bool  useCache ()

useCache

[static]

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

void  setUseCache ( bool _mode )

setUseCache

[static]

int  maxCacheAge ()

maxCacheAge

[static]

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

void  setMaxCacheAge ( int cache_age )

setMaxCacheAge

[static]

int  maxCacheSize ()

maxCacheSize

[static]

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

void  setMaxCacheSize ( int cache_size )

setMaxCacheSize

[static]

QString  cacheDir ()

cacheDir

[static]

The directory which contains the cache files

KIO::CacheControl  cacheControl ()

cacheControl

[static]

Returns the Cache control directive to be used.

void  setCacheControl (KIO::CacheControl)

setCacheControl

[static]

Sets the Cache control directive.

bool  autoResume ()

autoResume

[static]

bool  markPartial ()

markPartial

[static]

int  minimumKeepSize ()

minimumKeepSize

[static]

bool  persistentConnections ()

persistentConnections

[static]

void  setMarkPartial ( bool _mode )

setMarkPartial

[static]

Set this flag if you want slaves to add the extension .PART to all files during transfer. This extension will be removed when file is fully transferred.

This is a better way to discern finished transfers in case of transfer errors.

Parameters:
_modeDefault value is false: Don't add the extension .PART.

void  setMinimumKeepSize ( int _size )

setMinimumKeepSize

[static]

Set the minimum size for keeping an interrupted transfer.

A downloaded file whose transfer was interrupted will only be kept if its size is bigger than @ _size, otherwise it will be deleted.

Default value is 5000 bytes

void  setAutoResume ( bool _mode )

setAutoResume

[static]

Set this flag if you want slaves to automatically resume downloading files without asking the user in the "rename" dialog.

Parameters:
_modeDefault value is false: Don't resume automatically.

void  setPersistentConnections ( bool _mode )

setPersistentConnections

[static]

Set this flag if you want slaves to have persistent connections (FTP).

Parameters:
_modeDefault value is true: Keep persistent connections.

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.

QString  slaveProtocol ( const QString & protocol )

slaveProtocol

[static]