KProtocolManager Class Reference
Provides information about I/O (Internet, etc. More...
#include <kprotocolmanager.h>
Public Types | |
enum | ProxyType { NoProxy, ManualProxy, PACProxy, WPADProxy, EnvVarProxy } |
enum | ProxyAuthMode { Prompt, Automatic } |
Static Public Member Functions | |
static QString | defaultUserAgent () |
static QString | defaultUserAgent (const QString &keys) |
static QString | userAgentForHost (const QString &hostname) |
static int | readTimeout () |
static int | connectTimeout () |
static int | proxyConnectTimeout () |
static int | responseTimeout () |
static bool | useProxy () |
static bool | useReverseProxy () |
static ProxyType | proxyType () |
static ProxyAuthMode | proxyAuthMode () |
static QString | noProxyFor () |
static QString | proxyFor (const QString &protocol) |
static QString | proxyForURL (const KURL &url) |
static void | badProxy (const QString &proxy) |
static QString | proxyConfigScript () |
static bool | useCache () |
static int | maxCacheAge () |
static int | maxCacheSize () |
static QString | cacheDir () |
static KIO::CacheControl | cacheControl () |
static bool | autoResume () |
static bool | markPartial () |
static int | minimumKeepSize () |
static bool | persistentProxyConnection () |
static bool | persistentConnections () |
static void | reparseConfiguration () |
static QString | slaveProtocol (const KURL &url, QString &proxy) |
static KConfig * | config () |
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>
- Author:
- Waldo Bastain <bastain@kde.org>
Dawit Alemayehu <adawit@kde.org>
- See also:
- KPAC
Definition at line 54 of file kprotocolmanager.h.
Member Enumeration Documentation
|
Types of proxy configuration.
Definition at line 157 of file kprotocolmanager.h. |
|
Proxy authorization modes.
Definition at line 178 of file kprotocolmanager.h. |
Member Function Documentation
|
Returns the default user-agent string.
Definition at line 431 of file kprotocolmanager.cpp. References KIO::SlaveConfig::self(). Referenced by KIO::SessionData::configDataFor(), and userAgentForHost(). |
|
Returns the default user-agent value.
Definition at line 437 of file kprotocolmanager.cpp. References QString::arg(), QString::contains(), QString::fromLatin1(), QString::isEmpty(), QStringList::join(), KLocale::languageList(), KGlobal::locale(), and QString::lower(). |
|
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.
Definition at line 415 of file kprotocolmanager.cpp. References defaultUserAgent(), QString::isEmpty(), QString::lower(), and KIO::SlaveConfig::self(). |
|
Returns the preferred timeout value for reading from remote connections in seconds.
Definition at line 112 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the preferred timeout value for remote connections in seconds.
Definition at line 120 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). Referenced by KIO::rawErrorDetail(). |
|
Returns the preferred timeout value for proxy connections in seconds.
Definition at line 128 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). Referenced by KIO::rawErrorDetail(). |
|
Returns the preferred response timeout value for remote connecting in seconds.
Definition at line 136 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). Referenced by KIO::rawErrorDetail(). |
|
Returns whether or not the user specified the use of proxy server to make connections.
Definition at line 146 of file kprotocolmanager.cpp. References proxyType(). Referenced by slaveProtocol(). |
|
Returns whether or not the the proxy server lookup should be reversed or not.
Definition at line 151 of file kprotocolmanager.cpp. References config(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). Referenced by slaveProtocol(). |
|
Returns the type of proxy configuration that is used.
Definition at line 158 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). Referenced by noProxyFor(), proxyForURL(), slaveProtocol(), and useProxy(). |
|
Returns the way proxy authorization should be handled.
Definition at line 165 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the strings for hosts that should contacted DIRECTLY, bypassing any proxy settings.
Definition at line 207 of file kprotocolmanager.cpp. References config(), QString::fromLocal8Bit(), QString::local8Bit(), proxyType(), KConfigBase::readEntry(), and KConfigBase::setGroup(). Referenced by slaveProtocol(). |
|
Returns the proxy server address for a given protocol.
Definition at line 221 of file kprotocolmanager.cpp. References config(), QString::lower(), KConfigBase::readEntry(), and KConfigBase::setGroup(). Referenced by proxyForURL(). |
|
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.
Definition at line 235 of file kprotocolmanager.cpp. References QString::fromLatin1(), QString::fromLocal8Bit(), KURL::host(), QString::isEmpty(), QString::local8Bit(), QString::lower(), KURL::protocol(), proxyFor(), proxyType(), KURL::setProtocol(), and QString::startsWith(). Referenced by slaveProtocol(). |
|
Marks this proxy as bad (down). It will not be used for the next 30 minutes. (The script may supply an alternate proxy)
Definition at line 280 of file kprotocolmanager.cpp. |
|
Returns the URL of the script for automatic proxy configuration.
Definition at line 530 of file kprotocolmanager.cpp. References config(), KConfigBase::readEntry(), and KConfigBase::setGroup(). |
|
Returns true/false to indicate whether a cache should be used.
Definition at line 174 of file kprotocolmanager.cpp. References KConfigBase::readBoolEntry(). |
|
Returns the maximum age in seconds cached files should be kept before they are deleted as necessary.
Definition at line 195 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(). |
|
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.
Definition at line 201 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(). |
|
The directory which contains the cache files.
Definition at line 189 of file kprotocolmanager.cpp. References KGlobal::dirs(), and KConfigBase::readPathEntry(). |
|
Returns the Cache control directive to be used.
Definition at line 180 of file kprotocolmanager.cpp. References QString::isEmpty(), KIO::parseCacheControl(), and KConfigBase::readEntry(). |
|
Returns true if partial downloads should be automatically resumed.
Definition at line 509 of file kprotocolmanager.cpp. References config(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Returns true if partial downloads should be marked with a ".part" extension.
Definition at line 494 of file kprotocolmanager.cpp. References config(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
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.
Definition at line 501 of file kprotocolmanager.cpp. References config(), KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns true if proxy connections should be persistent.
Definition at line 523 of file kprotocolmanager.cpp. References config(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Returns true if connections should be persistent.
Definition at line 516 of file kprotocolmanager.cpp. References config(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Force a reload of the general config file of io-slaves ( kioslaverc).
Definition at line 78 of file kprotocolmanager.cpp. References KStaticDeleter< type >::destructObject(), and KIO::SlaveConfig::self(). Referenced by KIO::Scheduler::process(), and KIO::SessionData::reset(). |
|
Return the protocol to use in order to handle the given When a proxy is to be used, proxy contains the URL for the proxy.
Definition at line 326 of file kprotocolmanager.cpp. References endl(), QValueList::fromLast(), KURL::hasSubURL(), KURL::host(), QString::isEmpty(), QValueList< KURL >::Iterator(), kdDebug(), QString::latin1(), QString::lower(), noProxyFor(), QString::number(), KURL::port(), KURL::protocol(), proxyForURL(), proxyType(), KURL::split(), QString::startsWith(), QString::stripWhiteSpace(), useProxy(), and useReverseProxy(). Referenced by KProtocolInfo::findProtocol(). |
The documentation for this class was generated from the following files: