• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KProtocolInfo Class Reference

Information about I/O (Internet, etc. More...

#include <KProtocolInfo>

Inheritance diagram for KProtocolInfo:
KSycocaEntry

List of all members.

Classes

struct  ExtraField
 Definition of an extra field in the UDS entries, returned by a listDir operation. More...

Public Types

typedef QList< ExtraField > ExtraFieldList
enum  FileNameUsedForCopying { Name, FromUrl }
typedef QList< Ptr > List
typedef KSharedPtr< KProtocolInfo > Ptr
enum  Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR }

Public Member Functions

QStringList archiveMimeTypes () const
QString defaultMimeType () const
 KProtocolInfo (QDataStream &_str, int offset)
bool supportsListing () const
virtual ~KProtocolInfo ()

Static Public Member Functions

static QStringList capabilities (const QString &protocol)
static QString config (const QString &protocol)
static bool determineMimetypeFromExtension (const QString &protocol)
static QString docPath (const QString &protocol)
static QString exec (const QString &protocol)
static ExtraFieldList extraFields (const KUrl &url)
static QString icon (const QString &protocol)
static bool isFilterProtocol (const QString &protocol)
static bool isFilterProtocol (const KUrl &url)
static bool isHelperProtocol (const QString &protocol)
static bool isHelperProtocol (const KUrl &url)
static bool isKnownProtocol (const QString &protocol)
static bool isKnownProtocol (const KUrl &url)
static int maxSlaves (const QString &protocol)
static QString protocolClass (const QString &protocol)
static QStringList protocols ()
static QString proxiedBy (const QString &protocol)
static bool showFilePreview (const QString &protocol)

Protected Member Functions

bool canDeleteRecursive () const
bool canRenameFromFile () const
bool canRenameToFile () const
FileNameUsedForCopying fileNameUsedForCopying () const

Protected Attributes

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

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

Definition at line 49 of file kprotocolinfo.h.


Member Typedef Documentation

typedef QList<ExtraField> KProtocolInfo::ExtraFieldList

Definition at line 130 of file kprotocolinfo.h.

typedef QList<Ptr> KProtocolInfo::List

Reimplemented from KSycocaEntry.

Definition at line 56 of file kprotocolinfo.h.

typedef KSharedPtr<KProtocolInfo> KProtocolInfo::Ptr

Reimplemented from KSycocaEntry.

Definition at line 55 of file kprotocolinfo.h.


Member Enumeration Documentation

enum KProtocolInfo::FileNameUsedForCopying
Enumerator:
Name 
FromUrl 

Definition at line 326 of file kprotocolinfo.h.

enum KProtocolInfo::Type

Describes the type of a protocol.

For instance ftp:// appears as a filesystem with folders and files, while bzip2:// appears as a single file (a stream of data), and telnet:// doesn't output anything.

See also:
outputType
Enumerator:
T_STREAM 

stream of data (e.g. single file)

T_FILESYSTEM 

structured directory

T_NONE 

no information about the type available

T_ERROR 

used to signal an error

Definition at line 105 of file kprotocolinfo.h.


Constructor & Destructor Documentation

KProtocolInfo::KProtocolInfo ( QDataStream &  _str,
int  offset 
)

For internal use only.

construct a KProtocolInfo from a stream

Definition at line 112 of file kprotocolinfo.cpp.

KProtocolInfo::~KProtocolInfo (  )  [virtual]

Definition at line 118 of file kprotocolinfo.cpp.


Member Function Documentation

QStringList KProtocolInfo::archiveMimeTypes (  )  const

For internal use only.

. Use KProtocolManager instead.

Definition at line 374 of file kprotocolinfo.cpp.

bool KProtocolInfo::canDeleteRecursive (  )  const [protected]

Definition at line 397 of file kprotocolinfo.cpp.

bool KProtocolInfo::canRenameFromFile (  )  const [protected]

Definition at line 385 of file kprotocolinfo.cpp.

bool KProtocolInfo::canRenameToFile (  )  const [protected]

Definition at line 391 of file kprotocolinfo.cpp.

QStringList KProtocolInfo::capabilities ( const QString &  protocol  )  [static]

Returns the suggested URI parsing mode for the KUrl parser.

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

The following parsing modes are defined:

  • "url" for a standards compliant URL
  • "rawuri" for a non-conformant URI for which URL parsing would be meaningless
  • "mailto" for a mailto style URI (the path part contains only an email address)
Parameters:
protocol the protocol to check
Returns:
the suggested parsing mode, or KUrl::Auto if unspecified 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.

Parameters:
protocol the protocol to check
Returns:
the list of capabilities.

Definition at line 350 of file kprotocolinfo.cpp.

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

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

Parameters:
protocol the protocol to check
Returns:
the config file, or an empty string if unknown

Definition at line 266 of file kprotocolinfo.cpp.

QString KProtocolInfo::defaultMimeType (  )  const

For internal use only.

. Use KProtocolManager instead.

Definition at line 368 of file kprotocolinfo.cpp.

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

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

Definition at line 285 of file kprotocolinfo.cpp.

QString KProtocolInfo::docPath ( const QString &  protocol  )  [static]

Returns the documentation path for the specified protocol.

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

Parameters:
protocol the protocol to check
Returns:
the docpath of the protocol, or an empty string if unknown

Definition at line 312 of file kprotocolinfo.cpp.

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.

Parameters:
protocol the protocol to check
Returns:
the executable of library to open, or QString() for unsupported protocols
See also:
KUrl::protocol()

Definition at line 294 of file kprotocolinfo.cpp.

KProtocolInfo::ExtraFieldList KProtocolInfo::extraFields ( const KUrl &  url  )  [static]

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

Definition at line 303 of file kprotocolinfo.cpp.

KProtocolInfo::FileNameUsedForCopying KProtocolInfo::fileNameUsedForCopying (  )  const [protected]

Definition at line 403 of file kprotocolinfo.cpp.

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.

Parameters:
protocol the protocol to check
Returns:
the icon of the protocol, or an empty string if unknown

Definition at line 256 of file kprotocolinfo.cpp.

bool KProtocolInfo::isFilterProtocol ( const QString &  protocol  )  [static]

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

Definition at line 246 of file kprotocolinfo.cpp.

bool KProtocolInfo::isFilterProtocol ( const KUrl &  url  )  [static]

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.

Parameters:
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

Definition at line 409 of file kprotocolinfo.cpp.

bool KProtocolInfo::isHelperProtocol ( const QString &  protocol  )  [static]

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

Definition at line 419 of file kprotocolinfo.cpp.

bool KProtocolInfo::isHelperProtocol ( const KUrl &  url  )  [static]

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

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

Definition at line 414 of file kprotocolinfo.cpp.

bool KProtocolInfo::isKnownProtocol ( const QString &  protocol  )  [static]

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

Definition at line 434 of file kprotocolinfo.cpp.

bool KProtocolInfo::isKnownProtocol ( const KUrl &  url  )  [static]

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

Parameters:
url the url to check
Returns:
true if the protocol is known
See also:
name()

Definition at line 429 of file kprotocolinfo.cpp.

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.

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

Definition at line 276 of file kprotocolinfo.cpp.

QString KProtocolInfo::protocolClass ( const QString &  protocol  )  [static]

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.

Parameters:
protocol the protocol to check
Returns:
the class of the protocol, or an empty string if unknown

Definition at line 321 of file kprotocolinfo.cpp.

QStringList KProtocolInfo::protocols (  )  [static]

Returns list of all known protocols.

Returns:
a list of all known protocols

Definition at line 241 of file kprotocolinfo.cpp.

QString KProtocolInfo::proxiedBy ( const QString &  protocol  )  [static]

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.

Definition at line 359 of file kprotocolinfo.cpp.

bool KProtocolInfo::showFilePreview ( const QString &  protocol  )  [static]

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.

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

Definition at line 330 of file kprotocolinfo.cpp.

bool KProtocolInfo::supportsListing (  )  const

For internal use only.

. Use KProtocolManager instead.

Definition at line 380 of file kprotocolinfo.cpp.


Member Data Documentation

bool KProtocolInfo::m_canCopyFromFile [protected]

Definition at line 354 of file kprotocolinfo.h.

bool KProtocolInfo::m_canCopyToFile [protected]

Definition at line 355 of file kprotocolinfo.h.

QString KProtocolInfo::m_config [protected]

Definition at line 356 of file kprotocolinfo.h.

QString KProtocolInfo::m_defaultMimetype [protected]

Definition at line 351 of file kprotocolinfo.h.

bool KProtocolInfo::m_determineMimetypeFromExtension [protected]

Definition at line 352 of file kprotocolinfo.h.

QString KProtocolInfo::m_exec [protected]

Definition at line 337 of file kprotocolinfo.h.

QString KProtocolInfo::m_icon [protected]

Definition at line 353 of file kprotocolinfo.h.

Type KProtocolInfo::m_inputType [protected]

Definition at line 338 of file kprotocolinfo.h.

bool KProtocolInfo::m_isHelperProtocol [protected]

Definition at line 342 of file kprotocolinfo.h.

bool KProtocolInfo::m_isSourceProtocol [protected]

Definition at line 341 of file kprotocolinfo.h.

QStringList KProtocolInfo::m_listing [protected]

Definition at line 340 of file kprotocolinfo.h.

int KProtocolInfo::m_maxSlaves [protected]

Definition at line 357 of file kprotocolinfo.h.

QString KProtocolInfo::m_name [protected]

Definition at line 336 of file kprotocolinfo.h.

Type KProtocolInfo::m_outputType [protected]

Definition at line 339 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsDeleting [protected]

Definition at line 347 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsLinking [protected]

Definition at line 348 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsListing [protected]

Definition at line 343 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsMakeDir [protected]

Definition at line 346 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsMoving [protected]

Definition at line 349 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsOpening [protected]

Definition at line 350 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsReading [protected]

Definition at line 344 of file kprotocolinfo.h.

bool KProtocolInfo::m_supportsWriting [protected]

Definition at line 345 of file kprotocolinfo.h.


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

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal