• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

Public Types | Static Public Member Functions | List of all members
KProtocolManager Class Reference

#include <tdeprotocolmanager.h>

Public Types

enum  ProxyType {
  NoProxy, ManualProxy, PACProxy, WPADProxy,
  EnvVarProxy
}
 
enum  ProxyAuthMode { Prompt, Automatic }
 

Static Public Member Functions

static TQString defaultUserAgent ()
 
static TQString defaultUserAgent (const TQString &keys)
 
static TQString userAgentForHost (const TQString &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 TQString noProxyFor ()
 
static TQString noProxyForRaw ()
 
static TQString proxyFor (const TQString &protocol)
 
static TQString proxyForURL (const KURL &url)
 
static void badProxy (const TQString &proxy)
 
static TQString proxyConfigScript ()
 
static bool useCache ()
 
static int maxCacheAge ()
 
static int maxCacheSize ()
 
static TQString cacheDir ()
 
static TDEIO::CacheControl cacheControl ()
 
static bool autoResume ()
 
static bool markPartial ()
 
static int minimumKeepSize ()
 
static bool persistentProxyConnection ()
 
static bool persistentConnections ()
 
static void reparseConfiguration ()
 
static TQString slaveProtocol (const KURL &url, TQString &proxy)
 
static TDEConfig * 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@.nosp@m.kde..nosp@m.org

Revised by:

Author
Waldo Bastain basta.nosp@m.in@k.nosp@m.de.or.nosp@m.g
Dawit Alemayehu adawi.nosp@m.t@kd.nosp@m.e.org
See also
KPAC

Definition at line 54 of file tdeprotocolmanager.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.

NOTE: .kionetrc files have the same format as ftp .netrc files. Please note the use of .kionetrc files is highly discouraged since password is stored in clear text. For future releases the ability to store preset password for proxy servers will probably be supported through TDEWallet integration.

Definition at line 194 of file tdeprotocolmanager.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 166 of file tdeprotocolmanager.h.

Member Function Documentation

bool KProtocolManager::autoResume ( )
static

Returns true if partial downloads should be automatically resumed.

Returns
true to resume partial downloads

Definition at line 508 of file tdeprotocolmanager.cpp.

void KProtocolManager::badProxy ( const TQString &  proxy)
static

Marks this proxy as bad (down).

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

Parameters
proxythe proxy to mark as bad (as URL)

Definition at line 283 of file tdeprotocolmanager.cpp.

TDEIO::CacheControl KProtocolManager::cacheControl ( )
static

Returns the Cache control directive to be used.

Returns
the cache control value

Definition at line 180 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::cacheDir ( )
static

The directory which contains the cache files.

Returns
the directory that contains the cache files

Definition at line 189 of file tdeprotocolmanager.cpp.

int KProtocolManager::connectTimeout ( )
static

Returns the preferred timeout value for remote connections in seconds.

Returns
timeout value for remote connection in secs.

Definition at line 120 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::defaultUserAgent ( )
static

Returns the default user-agent string.

Returns
the default user-agent string

Definition at line 434 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::defaultUserAgent ( const TQString &  keys)
static

Returns the default user-agent value.

Parameters
keyscan be any of the following:
  • 'o' Show OS
  • 'v' Show OS Version
  • 'p' Show platform
  • 'm' Show machine architecture
  • 'l' Show language
Returns
the default user-agent value with the given keys

Definition at line 440 of file tdeprotocolmanager.cpp.

bool KProtocolManager::markPartial ( )
static

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

Returns
true if partial downloads should get an ".part" extension

Definition at line 493 of file tdeprotocolmanager.cpp.

int KProtocolManager::maxCacheAge ( )
static

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

Returns
the maximum cache age in seconds

Definition at line 195 of file tdeprotocolmanager.cpp.

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 in bytes

Definition at line 201 of file tdeprotocolmanager.cpp.

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.

Returns
the minimum keep size for aborted downloads in bytes

Definition at line 500 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::noProxyFor ( )
static

Returns a comma-separated list of hostnames or partial host-names that should bypass any proxy settings.

This function as well as useReverseProxy only apply when proxyType is ManualProxy.

See also
useReverseProxy, proxyFor, proxyForURL, slaveProtocol

Definition at line 215 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::noProxyForRaw ( )
static

Same as above except the environment variable name is returned instead of the variable value when proxyType is EnvVarProxy.

See also
noProxyFor
Since
3.5.x

Definition at line 207 of file tdeprotocolmanager.cpp.

bool KProtocolManager::persistentConnections ( )
static

Returns true if connections should be persistent.

Returns
true if the connections should be persistent

Definition at line 515 of file tdeprotocolmanager.cpp.

bool KProtocolManager::persistentProxyConnection ( )
static

Returns true if proxy connections should be persistent.

Returns
true if proxy connections should be persistent
Since
3.1

Definition at line 522 of file tdeprotocolmanager.cpp.

KProtocolManager::ProxyAuthMode KProtocolManager::proxyAuthMode ( )
static

Returns the way proxy authorization should be handled.

See also
ProxyAuthMode

Definition at line 165 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::proxyConfigScript ( )
static

Returns the URL of the script for automatic proxy configuration.

Returns
the proxy configuration script

Definition at line 529 of file tdeprotocolmanager.cpp.

int KProtocolManager::proxyConnectTimeout ( )
static

Returns the preferred timeout value for proxy connections in seconds.

Returns
timeout value for proxy connection in secs.

Definition at line 128 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::proxyFor ( const TQString &  protocol)
static

Returns the proxy server address for a given protocol.

NOTE: This function does not take the useReverseProxy() settings into account.

See also
useReverseProxy, slaveProtocol
Parameters
protocolthe protocol whose proxy info is needed
Returns
the proxy server address if one is available, or TQString::null if not available

Definition at line 224 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::proxyForURL ( const KURL &  url)
static

Returns the proxy server address for a given URL.

If proxyType returns Automatic, an external service called KPAC (a kded module) is used to determine the proxy server. Otherwise, proxyFor is invoked to determine whether the URL needs to be routed through a proxy server.

NOTE: This function does not take the useReverseProxy() or the noProxyFor() settings into account.

See also
useReverseProxy, slaveProtocol, noProxyFor
Parameters
urlthe URL whose proxy info is needed
Returns
the proxy server address or the text "DIRECT" if no proxying is needed for the given address.

Definition at line 238 of file tdeprotocolmanager.cpp.

KProtocolManager::ProxyType KProtocolManager::proxyType ( )
static

Returns the type of proxy configuration that is used.

See also
ProxyType

Definition at line 158 of file tdeprotocolmanager.cpp.

int KProtocolManager::readTimeout ( )
static

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

Returns
timeout value for remote connection in secs.

Definition at line 112 of file tdeprotocolmanager.cpp.

void KProtocolManager::reparseConfiguration ( )
static

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

Definition at line 78 of file tdeprotocolmanager.cpp.

int KProtocolManager::responseTimeout ( )
static

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

Returns
timeout value for remote connection in seconds.

Definition at line 136 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::slaveProtocol ( const KURL &  url,
TQString &  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.

Parameters
urlthe url to check
proxythe URL of the proxy to use
Returns
the slave protocol (e.g. 'http'), can be null if unknown

Definition at line 329 of file tdeprotocolmanager.cpp.

bool KProtocolManager::useCache ( )
static

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

Returns
true to use the cache, false otherwisea

Definition at line 174 of file tdeprotocolmanager.cpp.

bool KProtocolManager::useProxy ( )
static

Returns true if the user specified a proxy server to make connections.

See also
slaveProtocol, proxyForURL, proxyFor

Definition at line 146 of file tdeprotocolmanager.cpp.

TQString KProtocolManager::userAgentForHost ( const TQString &  hostname)
static

Returns the userAgent string configured for the specified host.

If hostname is not found or is empty (i.e. "" or TQString::null) this function will return the default user agent.

Parameters
hostnamename of the host
Returns
specified userAgent string

Definition at line 418 of file tdeprotocolmanager.cpp.

bool KProtocolManager::useReverseProxy ( )
static

Returns true if the proxy settings should apply to the list returned by noProxyFor.

Normally addresses listed in the noProxyFor list are not routed through a proxy server. However, if this function returns true, then all addresses listed in the noProxyFor list are to be routed through a proxy server where as those that are not should bypass it.

This function as well as noProxyFor only apply when proxyType is ManualProxy.

See also
proxyForURL, proxyFor, slaveProtocol

Definition at line 151 of file tdeprotocolmanager.cpp.


The documentation for this class was generated from the following files:
  • tdeprotocolmanager.h
  • tdeprotocolmanager.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.