KProtocolManager Class Reference
Provides information about I/O (Internet, etc.) settings chosen/set by the end user. More...
#include <kprotocolmanager.h>
Public Types | |
enum | ProxyType { NoProxy, ManualProxy, PACProxy, WPADProxy, EnvVarProxy } |
Types of proxy configuration
| |
enum | ProxyAuthMode { Prompt, Automatic } |
Proxy authorization modes. More... | |
Static Public Member Functions | |
QString | defaultUserAgent () |
Returns the default user-agent string. | |
QString | defaultUserAgent (const QString &keys) |
Returns the default user-agent value. | |
QString | userAgentForHost (const QString &) |
Returns the userAgent string configured for the specified host. | |
int | readTimeout () |
Returns the preferred timeout value for reading from remote connections in seconds. | |
int | connectTimeout () |
Returns the preferred timeout value for remote connections in seconds. | |
int | proxyConnectTimeout () |
Returns the preferred timeout value for proxy connections in seconds. | |
int | responseTimeout () |
Returns the preferred response timeout value for remote connecting in seconds. | |
int | defaultConnectTimeout () |
Returns the set default timeout value for connecting to remote machines. | |
bool | useProxy () |
Returns whether or not the user specified the use of proxy server to make connections. | |
bool | useReverseProxy () |
Returns whether or not the the proxy server lookup should be reversed or not. | |
ProxyType | proxyType () |
Returns the type of proxy configuration that is used. | |
ProxyAuthMode | proxyAuthMode () |
Returns the way proxy authorization should be handled. | |
QString | noProxyFor () |
Returns the strings for hosts that should contacted DIRECT bypassing any proxy settings. | |
QString | proxyFor (const QString &) |
QString | proxyForURL (const KURL &) |
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. | |
void | badProxy (const QString &) |
Marks this proxy as bad (down). | |
QString | proxyConfigScript () |
bool | useCache () |
Returns true/false to indicate whether a cache should be used. | |
int | maxCacheAge () |
Returns the maximum age in seconds cached files should be kept before they are deleted as necessary. | |
int | maxCacheSize () |
Returns the maximum size that can be used for caching. | |
QString | cacheDir () |
The directory which contains the cache files. | |
KIO::CacheControl | cacheControl () |
Returns the Cache control directive to be used. | |
bool | autoResume () |
Returns true if partial downloads should be automatically resumed. | |
bool | markPartial () |
Returns true if partial downloads should be marked with a ".part" extension. | |
int | minimumKeepSize () |
Returns the minimum file size for keeping aborted downloads. | |
bool | persistentProxyConnection () |
Returns true if connections should be persistent
| |
bool | persistentConnections () |
Returns true if connections should be persistent. | |
void | reparseConfiguration () |
Force a reload of the general config file of io-slaves ( kioslaverc). | |
QString | slaveProtocol (const KURL &url, QString &proxy) |
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. | |
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>
Revised
by: - Author:
- Waldo Bastain <bastain@kde.org>
Dawit Alemayehu <adawit@kde.org>
Definition at line 54 of file kprotocolmanager.h.
Member Enumeration Documentation
|
Types of proxy configuration
Definition at line 167 of file kprotocolmanager.h. Referenced by proxyForURL(), proxyType(), and slaveProtocol(). |
|
Proxy authorization modes.
Definition at line 187 of file kprotocolmanager.h. Referenced by proxyAuthMode(). |
Member Function Documentation
|
Returns the default user-agent string. This function returns the default user-agent string Definition at line 429 of file kprotocolmanager.cpp. Referenced by userAgentForHost(). |
|
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 Definition at line 435 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 417 of file kprotocolmanager.cpp. References defaultUserAgent(), QString::isEmpty(), and QString::lower(). |
|
Returns the preferred timeout value for reading from remote connections in seconds.
Definition at line 152 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the preferred timeout value for remote connections in seconds.
Definition at line 160 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the preferred timeout value for proxy connections in seconds.
Definition at line 168 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the preferred response timeout value for remote connecting in seconds.
Definition at line 176 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the set default timeout value for connecting to remote machines.
|
|
Returns whether or not the user specified the use of proxy server to make connections.
Definition at line 186 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 191 of file kprotocolmanager.cpp. References KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). Referenced by slaveProtocol(). |
|
Returns the type of proxy configuration that is used.
Definition at line 198 of file kprotocolmanager.cpp. References ProxyType, KConfigBase::readNumEntry(), and KConfigBase::setGroup(). Referenced by proxyForURL(), slaveProtocol(), and useProxy(). |
|
Returns the way proxy authorization should be handled.
Definition at line 205 of file kprotocolmanager.cpp. References ProxyAuthMode, KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns the strings for hosts that should contacted DIRECT bypassing any proxy settings.
Definition at line 247 of file kprotocolmanager.cpp. References KConfigBase::readEntry(), and KConfigBase::setGroup(). Referenced by slaveProtocol(). |
|
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 268 of file kprotocolmanager.cpp. References QString::fromLatin1(), QString::fromLocal8Bit(), KURL::host(), QString::isEmpty(), QString::local8Bit(), KURL::protocol(), KPAC::proxyForURL(), proxyType(), ProxyType, and QString::stripWhiteSpace(). 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 294 of file kprotocolmanager.cpp. |
|
Definition at line 523 of file kprotocolmanager.cpp. References KConfigBase::readEntry(), and KConfigBase::setGroup(). |
|
Returns true/false to indicate whether a cache should be used.
Definition at line 214 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 235 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 241 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(). |
|
The directory which contains the cache files.
Definition at line 229 of file kprotocolmanager.cpp. References KGlobal::dirs(), and KConfigBase::readPathEntry(). |
|
Returns the Cache control directive to be used.
Definition at line 220 of file kprotocolmanager.cpp. References QString::isEmpty(), and KConfigBase::readEntry(). |
|
Returns true if partial downloads should be automatically resumed.
Definition at line 502 of file kprotocolmanager.cpp. References KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Returns true if partial downloads should be marked with a ".part" extension.
Definition at line 487 of file kprotocolmanager.cpp. References 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. @ return the minimum keep size for aborted downloads in bytes. Definition at line 494 of file kprotocolmanager.cpp. References KConfigBase::readNumEntry(), and KConfigBase::setGroup(). |
|
Returns true if connections should be persistent
Definition at line 516 of file kprotocolmanager.cpp. References KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Returns true if connections should be persistent.
Definition at line 509 of file kprotocolmanager.cpp. References KConfigBase::readBoolEntry(), and KConfigBase::setGroup(). |
|
Force a reload of the general config file of io-slaves ( kioslaverc).
Definition at line 81 of file kprotocolmanager.cpp. |
|
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 342 of file kprotocolmanager.cpp. References KURL::host(), QString::isEmpty(), QString::latin1(), QString::lower(), noProxyFor(), QString::number(), KURL::port(), KURL::protocol(), proxyForURL(), proxyType(), ProxyType, QString::startsWith(), QString::stripWhiteSpace(), useProxy(), and useReverseProxy(). |
The documentation for this class was generated from the following files: