.TH "KProtocolManager" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KProtocolManager \- Provides information about I/O (Internet, etc.) settings chosen/set by the end user.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kprotocolmanager.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBProxyType\fP { \fBNoProxy\fP, \fBManualProxy\fP, \fBPACProxy\fP, \fBWPADProxy\fP, \fBEnvVarProxy\fP }"
.br
.RI "\fITypes of proxy configuration 
.IP "\(bu" 2
NoProxy - No proxy is used 
.IP "\(bu" 2
ManualProxy - Proxies are manually configured 
.IP "\(bu" 2
PACProxy - A Proxy configuration URL has been given 
.IP "\(bu" 2
WPADProxy - A proxy should be automatically discovered 
.IP "\(bu" 2
EnvVarProxy - Use the proxy values set through environment variables. 
.PP
\fP"
.ti -1c
.RI "enum \fBProxyAuthMode\fP { \fBPrompt\fP, \fBAutomatic\fP }"
.br
.RI "\fIProxy authorization modes. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBdefaultUserAgent\fP ()"
.br
.RI "\fIReturns the default user-agent string. \fP"
.ti -1c
.RI "\fBQString\fP \fBdefaultUserAgent\fP (const  \fBQString\fP &keys)"
.br
.RI "\fIReturns the default user-agent value. \fP"
.ti -1c
.RI "\fBQString\fP \fBuserAgentForHost\fP (const  \fBQString\fP &)"
.br
.RI "\fIReturns the userAgent string configured for the specified host. \fP"
.ti -1c
.RI "int \fBreadTimeout\fP ()"
.br
.RI "\fIReturns the preferred timeout value for reading from remote connections in seconds. \fP"
.ti -1c
.RI "int \fBconnectTimeout\fP ()"
.br
.RI "\fIReturns the preferred timeout value for remote connections in seconds. \fP"
.ti -1c
.RI "int \fBproxyConnectTimeout\fP ()"
.br
.RI "\fIReturns the preferred timeout value for proxy connections in seconds. \fP"
.ti -1c
.RI "int \fBresponseTimeout\fP ()"
.br
.RI "\fIReturns the preferred response timeout value for remote connecting in seconds. \fP"
.ti -1c
.RI "int \fBdefaultConnectTimeout\fP ()"
.br
.RI "\fIReturns the set default timeout value for connecting to remote machines. \fP"
.ti -1c
.RI "bool \fBuseProxy\fP ()"
.br
.RI "\fIReturns whether or not the user specified the use of proxy server to make connections. \fP"
.ti -1c
.RI "bool \fBuseReverseProxy\fP ()"
.br
.RI "\fIReturns whether or not the the proxy server lookup should be reversed or not. \fP"
.ti -1c
.RI "\fBProxyType\fP \fBproxyType\fP ()"
.br
.RI "\fIReturns the type of proxy configuration that is used. \fP"
.ti -1c
.RI "\fBProxyAuthMode\fP \fBproxyAuthMode\fP ()"
.br
.RI "\fIReturns the way proxy authorization should be handled. \fP"
.ti -1c
.RI "\fBQString\fP \fBnoProxyFor\fP ()"
.br
.RI "\fIReturns the strings for hosts that should contacted DIRECT bypassing any proxy settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBproxyFor\fP (const  \fBQString\fP &)"
.br
.ti -1c
.RI "\fBQString\fP \fBproxyForURL\fP (const  \fBKURL\fP &)"
.br
.RI "\fIReturns the Proxy server address for a given URL If automatic proxy configuration is configured, \fBKPAC\fP is used to determine the proxy server, otherwise the return value of \fBproxyFor\fP for the URL's protocol is used. \fP"
.ti -1c
.RI "void \fBbadProxy\fP (const  \fBQString\fP &)"
.br
.RI "\fIMarks this proxy as bad (down). \fP"
.ti -1c
.RI "\fBQString\fP \fBproxyConfigScript\fP ()"
.br
.ti -1c
.RI "bool \fBuseCache\fP ()"
.br
.RI "\fIReturns true/false to indicate whether a cache should be used. \fP"
.ti -1c
.RI "int \fBmaxCacheAge\fP ()"
.br
.RI "\fIReturns the maximum age in seconds cached files should be kept before they are deleted as necessary. \fP"
.ti -1c
.RI "int \fBmaxCacheSize\fP ()"
.br
.RI "\fIReturns the maximum size that can be used for caching. \fP"
.ti -1c
.RI "\fBQString\fP \fBcacheDir\fP ()"
.br
.RI "\fIThe directory which contains the cache files. \fP"
.ti -1c
.RI "\fBKIO::CacheControl\fP \fBcacheControl\fP ()"
.br
.RI "\fIReturns the Cache control directive to be used. \fP"
.ti -1c
.RI "bool \fBautoResume\fP ()"
.br
.RI "\fIReturns true if partial downloads should be automatically resumed. \fP"
.ti -1c
.RI "bool \fBmarkPartial\fP ()"
.br
.RI "\fIReturns true if partial downloads should be marked with a '.part' extension. \fP"
.ti -1c
.RI "int \fBminimumKeepSize\fP ()"
.br
.RI "\fIReturns the minimum file size for keeping aborted downloads. \fP"
.ti -1c
.RI "bool \fBpersistentProxyConnection\fP ()"
.br
.RI "\fIReturns true if connections should be persistent 
.PP
\fBSince:\fP
.RS 4
3.1. 
.RE
.PP
\fP"
.ti -1c
.RI "bool \fBpersistentConnections\fP ()"
.br
.RI "\fIReturns true if connections should be persistent. \fP"
.ti -1c
.RI "void \fBreparseConfiguration\fP ()"
.br
.RI "\fIForce a reload of the general config file of io-slaves ( kioslaverc). \fP"
.ti -1c
.RI "\fBQString\fP \fBslaveProtocol\fP (const  \fBKURL\fP &url, \fBQString\fP &proxy)"
.br
.RI "\fIReturn the protocol to use in order to handle the given \fCurl\fP It's usually the same, except that FTP, when handled by a proxy, needs an HTTP ioslave. \fP"
.ti -1c
.RI "\fBKConfig\fP * \fBconfig\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
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.
.PP
\fCOriginal\fP author: 
.PP
\fBAuthor:\fP
.RS 4
Torben Weis <weis@kde.org>
.RE
.PP
\fCRevised\fP by: 
.PP
\fBAuthor:\fP
.RS 4
Waldo Bastain <bastain@kde.org> 
.PP
Dawit Alemayehu <adawit@kde.org> 
.RE
.PP

.PP
Definition at line 54 of file kprotocolmanager.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKProtocolManager::ProxyType\fP"
.PP
Types of proxy configuration 
.IP "\(bu" 2
NoProxy - No proxy is used 
.IP "\(bu" 2
ManualProxy - Proxies are manually configured 
.IP "\(bu" 2
PACProxy - A Proxy configuration URL has been given 
.IP "\(bu" 2
WPADProxy - A proxy should be automatically discovered 
.IP "\(bu" 2
EnvVarProxy - Use the proxy values set through environment variables. 
.PP
Definition at line 167 of file kprotocolmanager.h.
.PP
Referenced by proxyForURL(), proxyType(), and slaveProtocol().
.SS "enum \fBKProtocolManager::ProxyAuthMode\fP"
.PP
Proxy authorization modes. .IP "\(bu" 2
Prompt - Ask for authorization as needed 
.IP "\(bu" 2
Automatic - Use auto login as defined in kionetrc files. 
.PP
Definition at line 187 of file kprotocolmanager.h.
.PP
Referenced by proxyAuthMode().
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KProtocolManager::defaultUserAgent ()\fC [static]\fP"
.PP
Returns the default user-agent string. This function returns the default user-agent string Definition at line 429 of file kprotocolmanager.cpp.
.PP
Referenced by userAgentForHost().
.SS "\fBQString\fP KProtocolManager::defaultUserAgent (const \fBQString\fP & keys)\fC [static]\fP"
.PP
Returns the default user-agent value. This function returns the default user-agent value taking into account 'keys'
.PP
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.
.PP
References QString::arg(), QString::contains(), QString::fromLatin1(), QString::isEmpty(), QStringList::join(), KLocale::languageList(), KGlobal::locale(), and QString::lower().
.SS "\fBQString\fP KProtocolManager::userAgentForHost (const \fBQString\fP &)\fC [static]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIhostname\fP name of the host 
.RE
.PP
\fBReturns:\fP
.RS 4
specified userAgent string 
.RE
.PP
Definition at line 417 of file kprotocolmanager.cpp.
.PP
References defaultUserAgent(), QString::isEmpty(), and QString::lower().
.SS "int KProtocolManager::readTimeout ()\fC [static]\fP"
.PP
Returns the preferred timeout value for reading from remote connections in seconds. \fBReturns:\fP
.RS 4
timeout value for remote connection in secs. 
.RE
.PP
Definition at line 152 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "int KProtocolManager::connectTimeout ()\fC [static]\fP"
.PP
Returns the preferred timeout value for remote connections in seconds. \fBReturns:\fP
.RS 4
timeout value for remote connection in secs. 
.RE
.PP
Definition at line 160 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "int KProtocolManager::proxyConnectTimeout ()\fC [static]\fP"
.PP
Returns the preferred timeout value for proxy connections in seconds. \fBReturns:\fP
.RS 4
timeout value for proxy connection in secs. 
.RE
.PP
Definition at line 168 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "int KProtocolManager::responseTimeout ()\fC [static]\fP"
.PP
Returns the preferred response timeout value for remote connecting in seconds. \fBReturns:\fP
.RS 4
timeout value for remote connection in seconds. 
.RE
.PP
Definition at line 176 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "int KProtocolManager::defaultConnectTimeout ()\fC [static]\fP"
.PP
Returns the set default timeout value for connecting to remote machines. \fBReturns:\fP
.RS 4
timeout value in seconds 
.RE
.PP

.SS "bool KProtocolManager::useProxy ()\fC [static]\fP"
.PP
Returns whether or not the user specified the use of proxy server to make connections. Definition at line 186 of file kprotocolmanager.cpp.
.PP
References proxyType().
.PP
Referenced by slaveProtocol().
.SS "bool KProtocolManager::useReverseProxy ()\fC [static]\fP"
.PP
Returns whether or not the the proxy server lookup should be reversed or not. Definition at line 191 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.PP
Referenced by slaveProtocol().
.SS "\fBKProtocolManager::ProxyType\fP KProtocolManager::proxyType ()\fC [static]\fP"
.PP
Returns the type of proxy configuration that is used. Definition at line 198 of file kprotocolmanager.cpp.
.PP
References ProxyType, KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.PP
Referenced by proxyForURL(), slaveProtocol(), and useProxy().
.SS "\fBKProtocolManager::ProxyAuthMode\fP KProtocolManager::proxyAuthMode ()\fC [static]\fP"
.PP
Returns the way proxy authorization should be handled. \fBSee also:\fP
.RS 4
\fBProxyAuthMode\fP 
.RE
.PP
Definition at line 205 of file kprotocolmanager.cpp.
.PP
References ProxyAuthMode, KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "\fBQString\fP KProtocolManager::noProxyFor ()\fC [static]\fP"
.PP
Returns the strings for hosts that should contacted DIRECT bypassing any proxy settings. Definition at line 247 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readEntry(), and KConfigBase::setGroup().
.PP
Referenced by slaveProtocol().
.SS "\fBQString\fP KProtocolManager::proxyForURL (const \fBKURL\fP &)\fC [static]\fP"
.PP
Returns the Proxy server address for a given URL If automatic proxy configuration is configured, \fBKPAC\fP is used to determine the proxy server, otherwise the return value of \fBproxyFor\fP 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.
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the URL whose proxy info is needed 
.RE
.PP
\fBReturns:\fP
.RS 4
the proxy server address if one is available 
.RE
.PP
Definition at line 268 of file kprotocolmanager.cpp.
.PP
References QString::fromLatin1(), QString::fromLocal8Bit(), KURL::host(), QString::isEmpty(), QString::local8Bit(), KURL::protocol(), KPAC::proxyForURL(), proxyType(), ProxyType, and QString::stripWhiteSpace().
.PP
Referenced by slaveProtocol().
.SS "void KProtocolManager::badProxy (const \fBQString\fP &)\fC [static]\fP"
.PP
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.
.SS "\fBQString\fP KProtocolManager::proxyConfigScript ()\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
the URL of the script for automatic proxy configuration 
.RE
.PP
Definition at line 523 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readEntry(), and KConfigBase::setGroup().
.SS "bool KProtocolManager::useCache ()\fC [static]\fP"
.PP
Returns true/false to indicate whether a cache should be used. \fBReturns:\fP
.RS 4
.RE
.PP
Definition at line 214 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry().
.SS "int KProtocolManager::maxCacheAge ()\fC [static]\fP"
.PP
Returns the maximum age in seconds cached files should be kept before they are deleted as necessary. \fBReturns:\fP
.RS 4
.RE
.PP
Definition at line 235 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry().
.SS "int KProtocolManager::maxCacheSize ()\fC [static]\fP"
.PP
Returns the maximum size that can be used for caching. By default this function returns the DEFAULT_MAX_CACHE_SIZE value as defined in \fBhttp_slave_defaults.h\fP. Not that the value returned is in bytes, hence a value of 5120 would mean 5 Kb.
.PP
\fBReturns:\fP
.RS 4
the maximum cache size to 
.RE
.PP
Definition at line 241 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry().
.SS "\fBQString\fP KProtocolManager::cacheDir ()\fC [static]\fP"
.PP
The directory which contains the cache files. Definition at line 229 of file kprotocolmanager.cpp.
.PP
References KGlobal::dirs(), and KConfigBase::readPathEntry().
.SS "\fBKIO::CacheControl\fP KProtocolManager::cacheControl ()\fC [static]\fP"
.PP
Returns the Cache control directive to be used. Definition at line 220 of file kprotocolmanager.cpp.
.PP
References QString::isEmpty(), and KConfigBase::readEntry().
.SS "bool KProtocolManager::autoResume ()\fC [static]\fP"
.PP
Returns true if partial downloads should be automatically resumed. Definition at line 502 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.SS "bool KProtocolManager::markPartial ()\fC [static]\fP"
.PP
Returns true if partial downloads should be marked with a '.part' extension. Definition at line 487 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.SS "int KProtocolManager::minimumKeepSize ()\fC [static]\fP"
.PP
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.
.PP
@ return the minimum keep size for aborted downloads in bytes. Definition at line 494 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "bool KProtocolManager::persistentProxyConnection ()\fC [static]\fP"
.PP
Returns true if connections should be persistent 
.PP
\fBSince:\fP
.RS 4
3.1. 
.RE
.PP
Definition at line 516 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.SS "bool KProtocolManager::persistentConnections ()\fC [static]\fP"
.PP
Returns true if connections should be persistent. Definition at line 509 of file kprotocolmanager.cpp.
.PP
References KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.SS "void KProtocolManager::reparseConfiguration ()\fC [static]\fP"
.PP
Force a reload of the general config file of io-slaves ( kioslaverc). Definition at line 81 of file kprotocolmanager.cpp.
.SS "\fBQString\fP KProtocolManager::slaveProtocol (const \fBKURL\fP & url, \fBQString\fP & proxy)\fC [static]\fP"
.PP
Return the protocol to use in order to handle the given \fCurl\fP 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. Definition at line 342 of file kprotocolmanager.cpp.
.PP
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().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
