class KProtocolInfo

# class KProtocolInfo | Information about I/O (Internet, etc. More...
Definition | `#include <kprotocolinfo.h>`
Inherits | KSycocaEntry (kdecore) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- typedef KSharedPtr Ptr
- enum Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR }

#### Public Methods

- KProtocolInfo ( const QString & path)
- virtual bool isValid () const
- virtual QString name () const
- KProtocolInfo ( QDataStream& _str, int offset)
- virtual ~KProtocolInfo ()
- virtual void load (QDataStream& )
- virtual void save (QDataStream& )

#### Public Static Methods

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

#### Protected Methods

- virtual void virtual_hook ( int id, void* data )

#### Protected Members

- QString m_name
- QString m_exec
- Type m_inputType
- Type m_outputType
- QStringList m_listing
- bool m_isSourceProtocol
- bool m_isHelperProtocol
- bool m_supportsListing
- bool m_supportsReading
- bool m_supportsWriting
- bool m_supportsMakeDir
- bool m_supportsDeleting
- bool m_supportsLinking
- bool m_supportsMoving
- QString m_defaultMimetype
- bool m_determineMimetypeFromExtension
- QString m_icon
- bool m_canCopyFromFile
- bool m_canCopyToFile
- QString m_config
- int m_maxSlaves

## 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.

typedef KSharedPtr<KProtocolInfo> Ptr | ### Ptr

KProtocolInfo ( const QString & path) | ### KProtocolInfo

Read a protocol description file

bool isValid () | ### isValid

[const virtual]

Returns: whether the protocol description file is valid.

Reimplemented from KSycocaEntry.

QString name () | ### name

[const virtual]

This corresponds to the "protocol=" field in the protocol description file.

Returns: the name of the protocol.

See also: KURL::protocol()

Reimplemented from KSycocaEntry.

QStringList protocols () | ### protocols

[static]

Returns: list of all known protocols

bool isKnownProtocol ( const KURL &url ) | ### isKnownProtocol

[static]

Returns: whether a protocol is installed that is able to handle `url`.

See also: name()

QString exec ( const QString& protocol ) | ### exec

[static]

This corresponds to the "exec=" field in the protocol description file.

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.

enum Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR } | ### Type

Type inputType ( const KURL &url ) | ### inputType

[static]

This corresponds to the "input=" field in the protocol description file. Valid values for this field are "filesystem", "stream" or "none" (default).

Returns: whether the protocol should be treated as a filesystem or as a stream when reading from it.

Type outputType ( const KURL &url ) | ### outputType

[static]

This corresponds to the "output=" field in the protocol description file. Valid values for this field are "filesystem", "stream" or "none" (default).

Returns: whether the protocol should be treated as a filesystem or as a stream when writing to it.

QStringList listing ( const KURL &url ) | ### listing

[static]

This corresponds to the "listing=" field in the protocol description file. The supported fields should be seperated with ',' in the protocol description file.

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

bool isSourceProtocol ( const KURL &url ) | ### isSourceProtocol

[static]

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.

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.

bool isHelperProtocol ( const KURL &url ) | ### isHelperProtocol

[static]

This corresponds to the "helper=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can act as a helper protocol. TODO: What does that mean?

bool isFilterProtocol ( const KURL &url ) | ### isFilterProtocol

[static]

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.

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.

bool supportsListing ( const KURL &url ) | ### supportsListing

[static]

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.)

Returns: whether the protocol can list files/objects. If a protocol supports listing it can be browsed in e.g. file-dialogs and konqueror.

See also: listing()

bool supportsReading ( const KURL &url ) | ### supportsReading

[static]

This corresponds to the "reading=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can retrieve data from URLs.

bool supportsWriting ( const KURL &url ) | ### supportsWriting

[static]

This corresponds to the "writing=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can store data to URLs.

bool supportsMakeDir ( const KURL &url ) | ### supportsMakeDir

[static]

This corresponds to the "makedir=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can create directories/folders.

bool supportsDeleting ( const KURL &url ) | ### supportsDeleting

[static]

This corresponds to the "deleting=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can delete files/objects.

bool supportsLinking ( const KURL &url ) | ### supportsLinking

[static]

This corresponds to the "linking=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can create links between files/objects.

bool supportsMoving ( const KURL &url ) | ### supportsMoving

[static]

This corresponds to the "moving=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

Returns: whether the protocol can move files/objects between different locations.

bool canCopyFromFile ( const KURL &url ) | ### canCopyFromFile

[static]

This corresponds to the "copyFromFile=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

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.

bool canCopyToFile ( const KURL &url ) | ### canCopyToFile

[static]

This corresponds to the "copyToFile=" field in the protocol description file. Valid values for this field are "true" or "false" (default).

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.

QString defaultMimetype ( const KURL& url ) | ### defaultMimetype

[static]

This corresponds to the "defaultMimetype=" field in the protocol description file.

Returns: default mimetype for this URL based on the protocol

QString icon ( const QString& protocol ) | ### icon

[static]

This corresponds to the "Icon=" field in the protocol description file.

Returns: the name of the icon, associated with the specified protocol

QString config ( const QString& protocol ) | ### config

[static]

This corresponds to the "config=" field in the protocol description file. The default is the protocol name, see name()

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.

int maxSlaves ( const QString& protocol ) | ### maxSlaves

[static]

This corresponds to the "maxInstances=" field in the protocol description file. The default is 1.

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.

bool determineMimetypeFromExtension ( const QString &protocol ) | ### determineMimetypeFromExtension

[static]

This corresponds to the "determineMimetypeFromExtension=" field in the protocol description file. Valid values for this field are "true" (default) or "false".

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.

KProtocolInfo ( QDataStream& _str, int offset) | ### KProtocolInfo

~KProtocolInfo () | ### ~KProtocolInfo

[virtual]

void load (QDataStream& ) | ### load

[virtual]

Load the protocol info from a stream.

Reimplemented from KSycocaEntry.

void save (QDataStream& ) | ### save

[virtual]

Save the protocol info to a stream.

Reimplemented from KSycocaEntry.

Type inputType ( const QString& protocol ) | ### inputType

[static]

Type outputType ( const QString& protocol ) | ### outputType

[static]

QStringList listing ( const QString& protocol ) | ### listing

[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

bool isSourceProtocol ( const QString& protocol ) | ### isSourceProtocol

[static]

bool isHelperProtocol ( const QString& protocol ) | ### isHelperProtocol

[static]

bool isFilterProtocol ( const QString& protocol ) | ### isFilterProtocol

[static]

bool isKnownProtocol ( const QString& protocol ) | ### isKnownProtocol

[static]

bool supportsListing ( const QString& protocol ) | ### supportsListing

[static]

bool supportsReading ( const QString& protocol ) | ### supportsReading

[static]

bool supportsWriting ( const QString& protocol ) | ### supportsWriting

[static]

bool supportsMakeDir ( const QString& protocol ) | ### supportsMakeDir

[static]

bool supportsDeleting ( const QString& protocol ) | ### supportsDeleting

[static]

bool supportsLinking ( const QString& protocol ) | ### supportsLinking

[static]

bool supportsMoving ( const QString& protocol ) | ### supportsMoving

[static]

bool canCopyFromFile ( const QString& protocol ) | ### canCopyFromFile

[static]

bool canCopyToFile ( const QString& protocol ) | ### canCopyToFile

[static]

QString defaultMimetype ( const QString& protocol) | ### defaultMimetype

[static]

QString m_name | ### m_name

[protected]

QString m_exec | ### m_exec

[protected]

Type m_inputType | ### m_inputType

[protected]

Type m_outputType | ### m_outputType

[protected]

QStringList m_listing | ### m_listing

[protected]

bool m_isSourceProtocol | ### m_isSourceProtocol

[protected]

bool m_isHelperProtocol | ### m_isHelperProtocol

[protected]

bool m_supportsListing | ### m_supportsListing

[protected]

bool m_supportsReading | ### m_supportsReading

[protected]

bool m_supportsWriting | ### m_supportsWriting

[protected]

bool m_supportsMakeDir | ### m_supportsMakeDir

[protected]

bool m_supportsDeleting | ### m_supportsDeleting

[protected]

bool m_supportsLinking | ### m_supportsLinking

[protected]

bool m_supportsMoving | ### m_supportsMoving

[protected]

QString m_defaultMimetype | ### m_defaultMimetype

[protected]

bool m_determineMimetypeFromExtension | ### m_determineMimetypeFromExtension

[protected]

QString m_icon | ### m_icon

[protected]

bool m_canCopyFromFile | ### m_canCopyFromFile

[protected]

bool m_canCopyToFile | ### m_canCopyToFile

[protected]

QString m_config | ### m_config

[protected]

int m_maxSlaves | ### m_maxSlaves

[protected]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Reimplemented from KSycocaEntry.

- Author: Torben Weis
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.