# class KProtocolInfo

###

Module | kdecore
Namespace |
Class | KProtocolInfo
Inherits | KSycocaEntry

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

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. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan 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>

### enums

- FileNameUsedForCopying { Name, FromUrl }
- Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR }

enum details

### methods

- KProtocolInfo (_str, offset)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  _str | QDataStream |
  offset | int |

  Internal construct a KProtocolInfo from a stream

- KProtocolInfo (path)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  path | QString |

  Read a protocol description file

  path - the path of the description file

- archiveMimeTypes ( )

  returns QStringList
  KDE 4.1.0 and later only

  @internal. Use KProtocolManager instead.

- canDeleteRecursive ( )

  returns bool

- canRenameFromFile ( )

  returns bool

- canRenameToFile ( )

  returns bool

- capabilities (protocol)

  returns QStringList
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns the list of capabilities provided by the kioslave implementing this protocol.

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

  The capability names are not defined globally, they are up to each slave implementation. For example when adding support for a new special command for mounting, one would add the string "Mount" to the capabilities list, and applications could check for that string before sending a special() command that would otherwise do nothing on older kioslave implementations.

  protocol - the protocol to check Returns the list of capabilities.

- config (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns the name of the config file associated with the specified protocol. This is useful 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()

  protocol - the protocol to check Returns the config file, or null if unknown

- defaultMimeType ( )

  returns QString

  @internal. Use KProtocolManager instead.

- determineMimetypeFromExtension (protocol)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

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

  protocol - the protocol to check Returns true if the mime types can be determined by extension

- docPath (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns the documentation path for the specified protocol.

  This corresponds to the "X-DocPath=" or "DocPath=" field in the protocol description file.

  protocol - the protocol to check Returns the docpath of the protocol, or null if unknown

- exec (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  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.

  protocol - the protocol to check Returns the executable of library to open, or QString() for unsupported protocols

  See also KUrl.protocol()

- extraFields (url)

  returns KProtocolInfo.ExtraFieldList
  static

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Definition of extra fields in the UDS entries, returned by a listDir operation.

  This corresponds to the "ExtraNames=" and "ExtraTypes=" fields in the protocol description file. Those two lists should be separated with ',' in the protocol description file. See ExtraField for details about names and types

- fileNameUsedForCopying ( )

  returns KProtocolInfo.FileNameUsedForCopying

- icon (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

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

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

  protocol - the protocol to check Returns the icon of the protocol, or null if unknown

- isFilterProtocol (url)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Returns whether the protocol can act as a filter protocol.

  A filter protocol can operate on data that is passed to it but does not retrieve/store data itself, like gzip. 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.

  url - the url to check Returns true if the protocol is a filter (e.g. gzip), false if the protocol is a helper or source

- isFilterProtocol (protocol)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Same as above except you can supply just the protocol instead of the whole URL.

- isHelperProtocol (url)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Returns whether the protocol can act as a helper protocol. A helper protocol invokes an external application and does not return a file or stream.

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

  url - the url to check Returns true if the protocol is a helper protocol (e.g. vnc), false if not (e.g. http)

- isHelperProtocol (protocol)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Same as above except you can supply just the protocol instead of the whole URL.

- isKnownProtocol (url)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

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

  url - the url to check Returns true if the protocol is known

  See also name()

- isKnownProtocol (protocol)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Same as above except you can supply just the protocol instead of the whole URL.

- maxSlaves (protocol)

  returns int
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  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.

  protocol - the protocol to check Returns the maximum number of slaves, or 1 if unknown

- protocolClass (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns the protocol class for the specified protocol.

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

  The following classes are defined:

- ":internet" for common internet protocols
- ":local" for protocols that access local resources

Protocol classes always start with a ':' so that they can not be confused with the protocols themselves.

protocol - the protocol to check Returns the class of the protocol, or null if unknown

- protocols ( )

  returns QStringList
  static

  Returns list of all known protocols. Returns a list of all known protocols

- proxiedBy (protocol)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns the name of the protocol through which the request will be routed if proxy support is enabled.

  A good example of this is the ftp protocol for which proxy support is commonly handled by the http protocol.

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

- showFilePreview (protocol)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  protocol | QString |

  Returns whether file previews should be shown for the specified protocol.

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

  By default previews are shown if protocolClass is :local.

  protocol - the protocol to check Returns true if previews should be shown by default, false otherwise

- supportsListing ( )

  returns bool

  @internal. Use KProtocolManager instead.

### enums - detail

- FileNameUsedForCopying { Name, FromUrl }

  | Name | - | - |
  | FromUrl | - | - |

- Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR }

  Describes the type of a protocol.

  | T_STREAM | - | - |
  | T_FILESYSTEM | - | - |
  | T_NONE | - | - |
  | T_ERROR | - | - |