Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KProtocolManager Class Reference

#include <kprotocolmanager.h>

List of all members.

Public Types

enum  ProxyType
enum  ProxyAuthMode

Static Public Methods

QString defaultUserAgent ()
QString defaultUserAgent (const QString &keys)
QString userAgentForHost (const QString &)
int readTimeout ()
int connectTimeout ()
int proxyConnectTimeout ()
int responseTimeout ()
int defaultConnectTimeout ()
bool useProxy ()
bool useReverseProxy ()
ProxyType proxyType ()
ProxyAuthMode proxyAuthMode ()
QString noProxyFor ()
QString proxyForURL (const KURL &)
void badProxy (const QString &)
QString proxyConfigScript ()
bool useCache ()
int maxCacheAge ()
int maxCacheSize ()
QString cacheDir ()
KIO::CacheControl cacheControl ()
bool autoResume ()
bool markPartial ()
int minimumKeepSize ()
bool persistentProxyConnection ()
bool persistentConnections ()
void reparseConfiguration ()
QString slaveProtocol (const KURL &url, QString &proxy)


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:

Author:
Torben Weis <weis@kde.org>
Revised by:
Author:
Waldo Bastain <bastain@kde.org> , Dawit Alemayehu <adawit@kde.org>

Definition at line 54 of file kprotocolmanager.h.


Member Enumeration Documentation

enum KProtocolManager::ProxyAuthMode
 

Proxy authorization modes.

  • Prompt - Ask for authorization as needed
  • Automatic - Use auto login as defined in kionetrc files.

Definition at line 187 of file kprotocolmanager.h.

enum KProtocolManager::ProxyType
 

Types of proxy configuration

  • NoProxy - No proxy is used
  • ManualProxy - Proxies are manually configured
  • PACProxy - A Proxy configuration URL has been given
  • WPADProxy - A proxy should be automatically discovered
  • EnvVarProxy - Use the proxy values set through environment variables.

Definition at line 167 of file kprotocolmanager.h.


Member Function Documentation

bool KProtocolManager::autoResume   [static]
 

Returns true if partial downloads should be automatically resumed.

void KProtocolManager::badProxy const QString &    [static]
 

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

KIO::CacheControl KProtocolManager::cacheControl   [static]
 

Returns the Cache control directive to be used.

QString KProtocolManager::cacheDir   [static]
 

The directory which contains the cache files

int KProtocolManager::connectTimeout   [static]
 

Returns the preferred timeout value for remote connections in seconds.

Returns:
timeout value for remote connection in secs.

int KProtocolManager::defaultConnectTimeout   [static]
 

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

Returns:
timeout value in seconds

QString KProtocolManager::defaultUserAgent const QString &    keys [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 KProtocolManager::defaultUserAgent   [static]
 

Returns the default user-agent string.

This function returns the default user-agent string

bool KProtocolManager::markPartial   [static]
 

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

int KProtocolManager::maxCacheAge   [static]
 

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

Returns:

int KProtocolManager::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

int KProtocolManager::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.

QString KProtocolManager::noProxyFor   [static]
 

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

bool KProtocolManager::persistentConnections   [static]
 

Returns true if connections should be persistent

bool KProtocolManager::persistentProxyConnection   [static]
 

Returns true if connections should be persistent

Since:
3.1

ProxyAuthMode KProtocolManager::proxyAuthMode   [static]
 

Returns the way proxy authorization should be handled.

See also:
ProxyAuthMode

QString KProtocolManager::proxyConfigScript   [static]
 

Returns:
the URL of the script for automatic proxy configuration

int KProtocolManager::proxyConnectTimeout   [static]
 

Returns the preferred timeout value for proxy connections in seconds.

Returns:
timeout value for proxy connection in secs.

QString KProtocolManager::proxyForURL const KURL   [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:
url  the URL whose proxy info is needed
Returns:
the proxy server address if one is available

ProxyType KProtocolManager::proxyType   [static]
 

Returns the type of proxy configuration that is used.

int KProtocolManager::readTimeout   [static]
 

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

Returns:
timeout value for remote connection in secs.

void KProtocolManager::reparseConfiguration   [static]
 

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

int KProtocolManager::responseTimeout   [static]
 

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

Returns:
timeout value for remote connection in seconds.

QString KProtocolManager::slaveProtocol const KURL   url,
QString &    proxy
[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.

bool KProtocolManager::useCache   [static]
 

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

Returns:

bool KProtocolManager::useProxy   [static]
 

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

QString KProtocolManager::userAgentForHost const QString &    [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:
hostname  name of the host
Returns:
specified userAgent string

bool KProtocolManager::useReverseProxy   [static]
 

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


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:21 2003 for kdelibs by doxygen1.2.18