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

KProtocolInfo Class Reference

#include <kprotocolinfo.h>

Inheritance diagram for KProtocolInfo:

KSycocaEntry KShared List of all members.

Public Types

typedef KSharedPtr< KProtocolInfo > Ptr

Public Methods

 KProtocolInfo (const QString &path)
virtual bool isValid () const
virtual QString name () const
virtual void load (QDataStream &)
virtual void save (QDataStream &)

Static Public Methods

QStringList protocols ()
bool isKnownProtocol (const KURL &url)
QString exec (const QString &protocol)
Type inputType (const KURL &url)
Type outputType (const KURL &url)
QStringList listing (const KURL &url)
bool isSourceProtocol (const KURL &url)
bool isHelperProtocol (const KURL &url)
bool isFilterProtocol (const KURL &url)
bool supportsListing (const KURL &url)
bool supportsReading (const KURL &url)
bool supportsWriting (const KURL &url)
bool supportsMakeDir (const KURL &url)
bool supportsDeleting (const KURL &url)
bool supportsLinking (const KURL &url)
bool supportsMoving (const KURL &url)
bool canCopyFromFile (const KURL &url)
bool canCopyToFile (const KURL &url)
QString defaultMimetype (const KURL &url)
QString icon (const QString &protocol)
QString config (const QString &protocol)
int maxSlaves (const QString &protocol)
bool determineMimetypeFromExtension (const QString &protocol)
QStringList listing (const QString &protocol)

Protected Methods

virtual void virtual_hook (int id, void *data)

Detailed Description

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. KProtocolInfo scans the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
Torben Weis <weis@kde.org>

Definition at line 40 of file kprotocolinfo.h.


Constructor & Destructor Documentation

KProtocolInfo::KProtocolInfo const QString &    path
 

Read a protocol description file


Member Function Documentation

bool KProtocolInfo::canCopyFromFile const KURL   url [static]
 

Returns:
whether the protocol can copy files/objects directly from the filesystem itself. If not, the application will read files from the filesystem using the file-protocol and pass the data on to the destination protocol.
This corresponds to the "copyFromFile=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::canCopyToFile const KURL   url [static]
 

Returns:
whether the protocol can copy files/objects directly to the filesystem itself. If not, the application will receive the data from the source protocol and store it in the filesystem using the file-protocol.
This corresponds to the "copyToFile=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

QString KProtocolInfo::config const QString &    protocol [static]
 

Returns:
the name of the config file associated with the specified protocol. This is usefull if two similar protocols need to share a single config file, e.g. http and https.
This corresponds to the "config=" field in the protocol description file. The default is the protocol name, see name()

QString KProtocolInfo::defaultMimetype const KURL   url [static]
 

Returns:
default mimetype for this URL based on the protocol
This corresponds to the "defaultMimetype=" field in the protocol description file.

bool KProtocolInfo::determineMimetypeFromExtension const QString &    protocol [static]
 

Returns:
whether mimetypes can be determined based on extension for this protocol. For some protocols, e.g. http, the filename extension in the URL can not be trusted to truly reflect the file type.
This corresponds to the "determineMimetypeFromExtension=" field in the protocol description file. Valid values for this field are "true" (default) or "false".

QString KProtocolInfo::exec const QString &    protocol [static]
 

Returns:
the library / executable to open for the protocol protocol Example : "kio_ftp", meaning either the executable "kio_ftp" or the library "kio_ftp.la" (recommended), whichever is available.
This corresponds to the "exec=" field in the protocol description file.

QString KProtocolInfo::icon const QString &    protocol [static]
 

Returns:
the name of the icon, associated with the specified protocol
This corresponds to the "Icon=" field in the protocol description file.

Type KProtocolInfo::inputType const KURL   url [static]
 

Returns:
whether the protocol should be treated as a filesystem or as a stream when reading from it.
This corresponds to the "input=" field in the protocol description file. Valid values for this field are "filesystem", "stream" or "none" (default).

bool KProtocolInfo::isFilterProtocol const KURL   url [static]
 

Returns:
whether the protocol can act as a filter protocol. TODO: What does that mean? A filter protocol can operate on data that is passed to it but does not retrieve/store data itself. A filter protocol is the opposite of a source protocol.
The "source=" field in the protocol description file determines whether a protocol is a source protocol or a filter protocol. Valid values for this field are "true" (default) for source protocol or "false" for filter protocol.

bool KProtocolInfo::isHelperProtocol const KURL   url [static]
 

Returns:
whether the protocol can act as a helper protocol. TODO: What does that mean?
This corresponds to the "helper=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::isKnownProtocol const KURL   url [static]
 

Returns:
whether a protocol is installed that is able to handle url.
See also:
name()

bool KProtocolInfo::isSourceProtocol const KURL   url [static]
 

Returns:
whether the protocol can act as a source protocol. TODO: What does that mean? Obsolete? A source protocol retrieves data from or stores data to the location specified by a URL. A source protocol is the opposite of a filter protocol.
The "source=" field in the protocol description file determines whether a protocol is a source protocol or a filter protocol. Valid values for this field are "true" (default) for source protocol or "false" for filter protocol.

virtual bool KProtocolInfo::isValid   const [inline, virtual]
 

Returns:
whether the protocol description file is valid.

Implements KSycocaEntry.

Definition at line 57 of file kprotocolinfo.h.

QStringList KProtocolInfo::listing const QString &    protocol [static]
 

Returns:
the list of fields this protocol returns when listing The current possibilities are Name, Type, Size, Date, AccessDate, Access, Owner, Group, Link, URL, MimeType

QStringList KProtocolInfo::listing const KURL   url [static]
 

Returns:
the list of fields this protocol returns when listing The current possibilities are Name, Type, Size, Date, AccessDate, Access, Owner, Group, Link, URL, MimeType
This corresponds to the "listing=" field in the protocol description file. The supported fields should be seperated with ',' in the protocol description file.

int KProtocolInfo::maxSlaves const QString &    protocol [static]
 

Returns:
the soft limit on the number of slaves for this protocol. This limits the number of slaves used for a single operation, note that multiple operations may result in a number of instances that exceeds this soft limit.
This corresponds to the "maxInstances=" field in the protocol description file. The default is 1.

virtual QString KProtocolInfo::name   const [inline, virtual]
 

Returns:
the name of the protocol.
This corresponds to the "protocol=" field in the protocol description file.

See also:
KURL::protocol()

Implements KSycocaEntry.

Definition at line 66 of file kprotocolinfo.h.

Type KProtocolInfo::outputType const KURL   url [static]
 

Returns:
whether the protocol should be treated as a filesystem or as a stream when writing to it.
This corresponds to the "output=" field in the protocol description file. Valid values for this field are "filesystem", "stream" or "none" (default).

QStringList KProtocolInfo::protocols   [static]
 

Returns:
list of all known protocols

bool KProtocolInfo::supportsDeleting const KURL   url [static]
 

Returns:
whether the protocol can delete files/objects.
This corresponds to the "deleting=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::supportsLinking const KURL   url [static]
 

Returns:
whether the protocol can create links between files/objects.
This corresponds to the "linking=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::supportsListing const KURL   url [static]
 

Returns:
whether the protocol can list files/objects. If a protocol supports listing it can be browsed in e.g. file-dialogs and konqueror.
Whether a protocol supports listing is determined by the "listing=" field in the protocol description file. If the protocol support listing it should list the fields it provides in this field. If the protocol does not support listing this field should remain empty (default.)
See also:
listing()

bool KProtocolInfo::supportsMakeDir const KURL   url [static]
 

Returns:
whether the protocol can create directories/folders.
This corresponds to the "makedir=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::supportsMoving const KURL   url [static]
 

Returns:
whether the protocol can move files/objects between different locations.
This corresponds to the "moving=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::supportsReading const KURL   url [static]
 

Returns:
whether the protocol can retrieve data from URLs.
This corresponds to the "reading=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

bool KProtocolInfo::supportsWriting const KURL   url [static]
 

Returns:
whether the protocol can store data to URLs.
This corresponds to the "writing=" field in the protocol description file. Valid values for this field are "true" or "false" (default).


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