home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kprotocolinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-10-08  |  23.6 KB  |  689 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 1999 Torben Weis <weis@kde.org>
  3.    Copyright (C) 2000-2001 Waldo Bastian <bastian@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License version 2 as published by the Free Software Foundation.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.    Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __kprotocolinfo_h__
  20. #define __kprotocolinfo_h__
  21.  
  22. #include <qstring.h>
  23. #include <qstringlist.h>
  24. #include <qdatastream.h>
  25.  
  26. #include <kurl.h>
  27. #include <ksycocaentry.h>
  28. #include <ksycocatype.h>
  29.  
  30. /**
  31.  * Information about I/O (Internet, etc.) protocols supported by KDE.
  32.  
  33.  * This class is useful if you want to know which protocols
  34.  * KDE supports. In addition you can find out lots of information
  35.  * about a certain protocol. A KProtocolInfo instance represents a
  36.  * single protocol. Most of the functionality is provided by the static
  37.  * methods that scan the *.protocol files of all installed kioslaves to get
  38.  * this information.
  39.  *
  40.  * *.protocol files are installed in the "services" resource.
  41.  *
  42.  * @author Torben Weis <weis@kde.org>
  43.  */
  44. class KIO_EXPORT KProtocolInfo : public KSycocaEntry
  45. {
  46.   friend class KProtocolInfoFactory;
  47.   K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry )
  48.  
  49. public:
  50.   typedef KSharedPtr<KProtocolInfo> Ptr;
  51.  
  52. public:
  53.   /**
  54.    * Read a protocol description file
  55.    * @param path the path of the description file
  56.    */
  57.   KProtocolInfo( const QString & path); // KDE4: make private and add friend class KProtocolInfoBuildFactory
  58.                                         // Then we can get rid of the d pointer
  59.  
  60.   /**
  61.    * Returns whether the protocol description file is valid.
  62.    * @return true if valid, false otherwise
  63.    */
  64.   virtual bool isValid() const { return !m_name.isEmpty(); }
  65.  
  66.   /**
  67.    * Returns the name of the protocol.
  68.    *
  69.    * This corresponds to the "protocol=" field in the protocol description file.
  70.    *
  71.    * @return the name of the protocol
  72.    * @see KURL::protocol()
  73.    */
  74.   virtual QString name() const { return m_name; }
  75.  
  76.   //
  77.   // Static functions:
  78.   //
  79.  
  80.   /**
  81.    * Returns list of all known protocols.
  82.    * @return a list of all known protocols
  83.    */
  84.   static QStringList protocols();
  85.  
  86.   /**
  87.    * Returns whether a protocol is installed that is able to handle @p url.
  88.    *
  89.    * @param url the url to check
  90.    * @return true if the protocol is known
  91.    * @see name()
  92.    */
  93.   static bool isKnownProtocol( const KURL &url );
  94.  
  95.   /**
  96.    * Same as above except you can supply just the protocol instead of
  97.    * the whole URL.
  98.    */
  99.  static bool isKnownProtocol( const QString& protocol )
  100. #ifdef KPROTOCOLINFO_KDECORE
  101.   KDE_WEAK_SYMBOL
  102. #endif
  103.   ;
  104.  
  105.   /**
  106.    * Returns the library / executable to open for the protocol @p protocol
  107.    * Example : "kio_ftp", meaning either the executable "kio_ftp" or
  108.    * the library "kio_ftp.la" (recommended), whichever is available.
  109.    *
  110.    * This corresponds to the "exec=" field in the protocol description file.
  111.    * @param protocol the protocol to check
  112.    * @return the executable of library to open, or QString::null for
  113.    *         unsupported protocols
  114.    * @see KURL::protocol()
  115.    */
  116.   static QString exec( const QString& protocol );
  117.  
  118.   /**
  119.    * Describes the type of a protocol.
  120.    */
  121.   enum Type { T_STREAM, ///< protocol returns a stream
  122.           T_FILESYSTEM, ///<protocol describes location in a file system
  123.           T_NONE,   ///< no information about the tyope available
  124.           T_ERROR   ///< used to signal an error
  125.   };
  126.  
  127.   /**
  128.    * Returns whether the protocol should be treated as a filesystem
  129.    * or as a stream when reading from it.
  130.    *
  131.    * This corresponds to the "input=" field in the protocol description file.
  132.    * Valid values for this field are "filesystem", "stream" or "none" (default).
  133.    *
  134.    * @param url the url to check
  135.    * @return the input type of the given @p url
  136.    */
  137.   static Type inputType( const KURL &url );
  138.  
  139.   /**
  140.    * Returns whether the protocol should be treated as a filesystem
  141.    * or as a stream when writing to it.
  142.    *
  143.    * This corresponds to the "output=" field in the protocol description file.
  144.    * Valid values for this field are "filesystem", "stream" or "none" (default).
  145.    *
  146.    * @param url the url to check
  147.    * @return the output type of the given @p url
  148.    */
  149.   static Type outputType( const KURL &url );
  150.  
  151.   /**
  152.    * Returns the list of fields this protocol returns when listing
  153.    * The current possibilities are
  154.    * Name, Type, Size, Date, AccessDate, Access, Owner, Group, Link, URL, MimeType
  155.    * as well as Extra1, Extra2 etc. for extra fields (see extraFields).
  156.    *
  157.    * This corresponds to the "listing=" field in the protocol description file.
  158.    * The supported fields should be separated with ',' in the protocol description file.
  159.    *
  160.    * @param url the url to check
  161.    * @return a list of field names
  162.    */
  163.   static QStringList listing( const KURL &url );
  164.  
  165.   /**
  166.    * Definition of an extra field in the UDS entries, returned by a listDir operation.
  167.    *
  168.    * The name is the name of the column, translated.
  169.    *
  170.    * The type name comes from QVariant::typeName()
  171.    * Currently supported types: "QString", "QDateTime" (ISO-8601 format)
  172.    *
  173.    * @since 3.2
  174.    */
  175.   struct ExtraField {
  176.     ExtraField() {} // for QValueList
  177.     ExtraField(const QString& _name, const QString& _type )
  178.       : name(_name), type(_type) {
  179.     }
  180.     QString name;
  181.     QString type; // KDE4: make it QVariant::Type
  182.   };
  183.   typedef QValueList<ExtraField > ExtraFieldList;
  184.   /**
  185.    * Definition of extra fields in the UDS entries, returned by a listDir operation.
  186.    *
  187.    * This corresponds to the "ExtraNames=" and "ExtraTypes=" fields in the protocol description file.
  188.    * Those two lists should be separated with ',' in the protocol description file.
  189.    * See ExtraField for details about names and types
  190.    *
  191.    * @since 3.2
  192.    */
  193.   static ExtraFieldList extraFields( const KURL& url );
  194.  
  195.   /**
  196.    * Returns whether the protocol can act as a source protocol.
  197.    *
  198.    * A source protocol retrieves data from or stores data to the
  199.    * location specified by a URL.
  200.    * A source protocol is the opposite of a filter protocol.
  201.    *
  202.    * The "source=" field in the protocol description file determines
  203.    * whether a protocol is a source protocol or a filter protocol.
  204.    * @param url the url to check
  205.    * @return true if the protocol is a source of data (e.g. http), false if the
  206.    *         protocol is a filter (e.g. gzip)
  207.    */
  208.   static bool isSourceProtocol( const KURL &url );
  209.  
  210.   /**
  211.    * Returns whether the protocol can act as a helper protocol.
  212.    * A helper protocol invokes an external application and does not return
  213.    * a file or stream.
  214.    *
  215.    * This corresponds to the "helper=" field in the protocol description file.
  216.    * Valid values for this field are "true" or "false" (default).
  217.    *
  218.    * @param url the url to check
  219.    * @return true if the protocol is a helper protocol (e.g. vnc), false
  220.    *              if not (e.g. http)
  221.    */
  222.   static bool isHelperProtocol( const KURL &url );
  223.  
  224.   /**
  225.    * Same as above except you can supply just the protocol instead of
  226.    * the whole URL.
  227.    */
  228.  static bool isHelperProtocol( const QString& protocol )
  229. #ifdef KPROTOCOLINFO_KDECORE
  230.   KDE_WEAK_SYMBOL
  231. #endif
  232.   ;
  233.  
  234.   /**
  235.    * Returns whether the protocol can act as a filter protocol.
  236.    *
  237.    * A filter protocol can operate on data that is passed to it
  238.    * but does not retrieve/store data itself, like gzip.
  239.    * A filter protocol is the opposite of a source protocol.
  240.    *
  241.    * The "source=" field in the protocol description file determines
  242.    * whether a protocol is a source protocol or a filter protocol.
  243.    * Valid values for this field are "true" (default) for source protocol or
  244.    * "false" for filter protocol.
  245.    *
  246.    * @param url the url to check
  247.    * @return true if the protocol is a filter (e.g. gzip), false if the
  248.    *         protocol is a helper or source
  249.    */
  250.   static bool isFilterProtocol( const KURL &url );
  251.  
  252.   /**
  253.    * Same as above except you can supply just the protocol instead of
  254.    * the whole URL.
  255.    */
  256.   static bool isFilterProtocol( const QString& protocol )
  257. #ifdef KPROTOCOLINFO_KDECORE
  258.   KDE_WEAK_SYMBOL
  259. #endif
  260.   ;
  261.  
  262.   /**
  263.    * Returns whether the protocol can list files/objects.
  264.    * If a protocol supports listing it can be browsed in e.g. file-dialogs
  265.    * and konqueror.
  266.    *
  267.    * Whether a protocol supports listing is determined by the "listing="
  268.    * field in the protocol description file.
  269.    * If the protocol support listing it should list the fields it provides in
  270.    * this field. If the protocol does not support listing this field should
  271.    * remain empty (default.)
  272.    *
  273.    * @param url the url to check
  274.    * @return true if the protocol support listing
  275.    * @see listing()
  276.    */
  277.   static bool supportsListing( const KURL &url );
  278.  
  279.   /**
  280.    * Returns whether the protocol can retrieve data from URLs.
  281.    *
  282.    * This corresponds to the "reading=" field in the protocol description file.
  283.    * Valid values for this field are "true" or "false" (default).
  284.    *
  285.    * @param url the url to check
  286.    * @return true if it is possible to read from the URL
  287.    */
  288.   static bool supportsReading( const KURL &url );
  289.  
  290.   /**
  291.    * Returns whether the protocol can store data to URLs.
  292.    *
  293.    * This corresponds to the "writing=" field in the protocol description file.
  294.    * Valid values for this field are "true" or "false" (default).
  295.    *
  296.    * @param url the url to check
  297.    * @return true if the protocol supports writing
  298.    */
  299.   static bool supportsWriting( const KURL &url );
  300.  
  301.   /**
  302.    * Returns whether the protocol can create directories/folders.
  303.    *
  304.    * This corresponds to the "makedir=" field in the protocol description file.
  305.    * Valid values for this field are "true" or "false" (default).
  306.    *
  307.    * @param url the url to check
  308.    * @return true if the protocol can create directories
  309.    */
  310.   static bool supportsMakeDir( const KURL &url );
  311.  
  312.   /**
  313.    * Returns whether the protocol can delete files/objects.
  314.    *
  315.    * This corresponds to the "deleting=" field in the protocol description file.
  316.    * Valid values for this field are "true" or "false" (default).
  317.    *
  318.    * @param url the url to check
  319.    * @return true if the protocol supports deleting
  320.    */
  321.   static bool supportsDeleting( const KURL &url );
  322.  
  323.   /**
  324.    * Returns whether the protocol can create links between files/objects.
  325.    *
  326.    * This corresponds to the "linking=" field in the protocol description file.
  327.    * Valid values for this field are "true" or "false" (default).
  328.    *
  329.    * @param url the url to check
  330.    * @return true if the protocol supports linking
  331.    */
  332.   static bool supportsLinking( const KURL &url );
  333.  
  334.   /**
  335.    * Returns whether the protocol can move files/objects between different
  336.    * locations.
  337.    *
  338.    * This corresponds to the "moving=" field in the protocol description file.
  339.    * Valid values for this field are "true" or "false" (default).
  340.    *
  341.    * @param url the url to check
  342.    * @return true if the protocol supports moving
  343.    */
  344.   static bool supportsMoving( const KURL &url );
  345.  
  346.   /**
  347.    * Returns whether the protocol can copy files/objects directly from the
  348.    * filesystem itself. If not, the application will read files from the
  349.    * filesystem using the file-protocol and pass the data on to the destination
  350.    * protocol.
  351.    *
  352.    * This corresponds to the "copyFromFile=" field in the protocol description file.
  353.    * Valid values for this field are "true" or "false" (default).
  354.    *
  355.    * @param url the url to check
  356.    * @return true if the protocol can copy files from the local file system
  357.    */
  358.   static bool canCopyFromFile( const KURL &url );
  359.  
  360.   /**
  361.    * Returns whether the protocol can copy files/objects directly to the
  362.    * filesystem itself. If not, the application will receive the data from
  363.    * the source protocol and store it in the filesystem using the
  364.    * file-protocol.
  365.    *
  366.    * This corresponds to the "copyToFile=" field in the protocol description file.
  367.    * Valid values for this field are "true" or "false" (default).
  368.    *
  369.    * @param url the url to check
  370.    * @return true if the protocol can copy files to the local file system
  371.    */
  372.   static bool canCopyToFile( const KURL &url );
  373.  
  374.   /**
  375.    * Returns whether the protocol can rename (i.e. move fast) files/objects
  376.    * directly from the filesystem itself. If not, the application will read
  377.    * files from the filesystem using the file-protocol and pass the data on
  378.    * to the destination protocol.
  379.    *
  380.    * This corresponds to the "renameFromFile=" field in the protocol description file.
  381.    * Valid values for this field are "true" or "false" (default).
  382.    *
  383.    * @param url the url to check
  384.    * @return true if the protocol can rename/move files from the local file system
  385.    * @since 3.4
  386.    */
  387.   static bool canRenameFromFile( const KURL &url );
  388.  
  389.   /**
  390.    * Returns whether the protocol can rename (i.e. move fast) files/objects
  391.    * directly to the filesystem itself. If not, the application will receive
  392.    * the data from the source protocol and store it in the filesystem using the
  393.    * file-protocol.
  394.    *
  395.    * This corresponds to the "renameToFile=" field in the protocol description file.
  396.    * Valid values for this field are "true" or "false" (default).
  397.    *
  398.    * @param url the url to check
  399.    * @return true if the protocol can rename files to the local file system
  400.    * @since 3.4
  401.    */
  402.   static bool canRenameToFile( const KURL &url );
  403.  
  404.   /**
  405.    * Returns whether the protocol can recursively delete directories by itself.
  406.    * If not (the usual case) then KIO will list the directory and delete files
  407.    * and empty directories one by one.
  408.    *
  409.    * This corresponds to the "deleteRecursive=" field in the protocol description file.
  410.    * Valid values for this field are "true" or "false" (default).
  411.    *
  412.    * @param url the url to check
  413.    * @return true if the protocol can delete non-empty directories by itself.
  414.    * @since 3.4
  415.    */
  416.   static bool canDeleteRecursive( const KURL &url );
  417.  
  418.   typedef enum { Name, FromURL } FileNameUsedForCopying;
  419.  
  420.   /**
  421.    * This setting defines the strategy to use for generating a filename, when
  422.    * copying a file or directory to another directory. By default the destination
  423.    * filename is made out of the filename in the source URL. However if the
  424.    * ioslave displays names that are different from the filename of the URL
  425.    * (e.g. kio_fonts shows Arial for arial.ttf, or kio_trash shows foo.txt and
  426.    * uses some internal URL), using Name means that the display name (UDS_NAME)
  427.    * will be used to as the filename in the destination directory.
  428.    *
  429.    * This corresponds to the "fileNameUsedForCopying=" field in the protocol description file.
  430.    * Valid values for this field are "Name" or "FromURL" (default).
  431.    *
  432.    * @param url the url to check
  433.    * @return how to generate the filename in the destination directory when copying/moving
  434.    * @since 3.4
  435.    */
  436.   static FileNameUsedForCopying fileNameUsedForCopying( const KURL &url );
  437.  
  438.   /**
  439.    * Returns default mimetype for this URL based on the protocol.
  440.    *
  441.    * This corresponds to the "defaultMimetype=" field in the protocol description file.
  442.    *
  443.    * @param url the url to check
  444.    * @return the default mime type of the protocol, or null if unknown
  445.    */
  446.   static QString defaultMimetype( const KURL& url );
  447.  
  448.   /**
  449.    * Returns the name of the icon, associated with the specified protocol.
  450.    *
  451.    * This corresponds to the "Icon=" field in the protocol description file.
  452.    *
  453.    * @param protocol the protocol to check
  454.    * @return the icon of the protocol, or null if unknown
  455.    */
  456.   static QString icon( const QString& protocol );
  457.  
  458.   /**
  459.    * Returns the name of the config file associated with the
  460.    * specified protocol. This is useful if two similar protocols
  461.    * need to share a single config file, e.g. http and https.
  462.    *
  463.    * This corresponds to the "config=" field in the protocol description file.
  464.    * The default is the protocol name, see name()
  465.    *
  466.    * @param protocol the protocol to check
  467.    * @return the config file, or null if unknown
  468.    */
  469.   static QString config( const QString& protocol );
  470.  
  471.   /**
  472.    * Returns the soft limit on the number of slaves for this protocol.
  473.    * This limits the number of slaves used for a single operation, note
  474.    * that multiple operations may result in a number of instances that
  475.    * exceeds this soft limit.
  476.    *
  477.    * This corresponds to the "maxInstances=" field in the protocol description file.
  478.    * The default is 1.
  479.    *
  480.    * @param protocol the protocol to check
  481.    * @return the maximum number of slaves, or 1 if unknown
  482.    */
  483.   static int maxSlaves( const QString& protocol );
  484.  
  485.   /**
  486.    * Returns whether mimetypes can be determined based on extension for this
  487.    * protocol. For some protocols, e.g. http, the filename extension in the URL
  488.    * can not be trusted to truly reflect the file type.
  489.    *
  490.    * This corresponds to the "determineMimetypeFromExtension=" field in the protocol description file.
  491.    * Valid values for this field are "true" (default) or "false".
  492.    *
  493.    * @param protocol the protocol to check
  494.    * @return true if the mime types can be determined by extension
  495.    */
  496.   static bool determineMimetypeFromExtension( const QString &protocol );
  497.  
  498.   /**
  499.    * Returns the documentation path for the specified protocol.
  500.    *
  501.    * This corresponds to the "DocPath=" field in the protocol description file.
  502.    *
  503.    * @param protocol the protocol to check
  504.    * @return the docpath of the protocol, or null if unknown
  505.    * @since 3.2
  506.    */
  507.   static QString docPath( const QString& protocol );
  508.  
  509.   /**
  510.    * Returns the protocol class for the specified protocol.
  511.    *
  512.    * This corresponds to the "Class=" field in the protocol description file.
  513.    *
  514.    * The following classes are defined:
  515.    * @li ":internet" for common internet protocols
  516.    * @li ":local" for protocols that access local resources
  517.    *
  518.    * Protocol classes always start with a ':' so that they can not be confused with
  519.    * the protocols themselves.
  520.    *
  521.    * @param protocol the protocol to check
  522.    * @return the class of the protocol, or null if unknown
  523.    * @since 3.2
  524.    */
  525.   static QString protocolClass( const QString& protocol );
  526.  
  527.   /**
  528.    * Returns whether file previews should be shown for the specified protocol.
  529.    *
  530.    * This corresponds to the "ShowPreviews=" field in the protocol description file.
  531.    *
  532.    * By default previews are shown if protocolClass is :local.
  533.    *
  534.    * @param protocol the protocol to check
  535.    * @return true if previews should be shown by default, false otherwise
  536.    * @since 3.2
  537.    */
  538.   static bool showFilePreview( const QString& protocol );
  539.  
  540.   /**
  541.    * Returns the suggested URI parsing mode for the KURL parser.
  542.    *
  543.    * This corresponds to the "URIMode=" field in the protocol description file.
  544.    *
  545.    * The following parsing modes are defined:
  546.    * @li "url" for a standards compliant URL
  547.    * @li "rawuri" for a non-conformant URI for which URL parsing would be meaningless
  548.    * @li "mailto" for a mailto style URI (the path part contains only an email address)
  549.    *
  550.    * @param protocol the protocol to check
  551.    * @return the suggested parsing mode, or KURL::Auto if unspecified
  552.    *
  553.    * @since 3.2
  554.    */
  555.   static KURL::URIMode uriParseMode( const QString& protocol );
  556.  
  557.   /**
  558.    * Returns the list of capabilities provided by the kioslave implementing
  559.    * this protocol.
  560.    *
  561.    * This corresponds to the "Capabilities=" field in the protocol description file.
  562.    *
  563.    * The capability names are not defined globally, they are up to each
  564.    * slave implementation. For example when adding support for a new
  565.    * special command for mounting, one would add the string "Mount" to the
  566.    * capabilities list, and applications could check for that string
  567.    * before sending a special() command that would otherwise do nothing
  568.    * on older kioslave implementations.
  569.    *
  570.    * @param protocol the protocol to check
  571.    * @return the list of capabilities.
  572.    *
  573.    * @since 3.3
  574.    */
  575.   static QStringList capabilities( const QString& protocol );
  576.  
  577.   /**
  578.    * Returns the name of the protocol through which the request
  579.    * will be routed if proxy support is enabled.
  580.    *
  581.    * A good example of this is the ftp protocol for which proxy
  582.    * support is commonly handled by the http protocol.
  583.    *
  584.    * This corresponds to the "ProxiedBy=" in the protocol description file.
  585.    *
  586.    * @since 3.3
  587.    */
  588.   static QString proxiedBy( const QString& protocol );
  589.  
  590. public:
  591.   // Internal functions:
  592.   /**
  593.    * @internal construct a KProtocolInfo from a stream
  594.    */
  595.   KProtocolInfo( QDataStream& _str, int offset);
  596.  
  597.   virtual ~KProtocolInfo();
  598.  
  599.   /**
  600.    * @internal
  601.    * Load the protocol info from a stream.
  602.    */
  603.   virtual void load(QDataStream& );
  604.  
  605.   /**
  606.    * @internal
  607.    * Save the protocol info to a stream.
  608.    */
  609.   virtual void save(QDataStream& );
  610.  
  611.   ////////////////////////// DEPRECATED /////////////////////////
  612.   // The following methods are deprecated:
  613.  
  614.   /// @deprecated
  615.   static Type inputType( const QString& protocol ) KDE_DEPRECATED;
  616.   /// @deprecated
  617.   static Type outputType( const QString& protocol ) KDE_DEPRECATED;
  618.   /**
  619.    * @deprecated
  620.    * Returns the list of fields this protocol returns when listing
  621.    * The current possibilities are
  622.    * Name, Type, Size, Date, AccessDate, Access, Owner, Group, Link, URL, MimeType
  623.    */
  624.   static QStringList listing( const QString& protocol ) KDE_DEPRECATED;
  625.   /// @deprecated
  626.   static bool isSourceProtocol( const QString& protocol ) KDE_DEPRECATED;
  627.   /// @deprecated
  628.   static bool supportsListing( const QString& protocol ) KDE_DEPRECATED;
  629.   /// @deprecated
  630.   static bool supportsReading( const QString& protocol ) KDE_DEPRECATED;
  631.   /// @deprecated
  632.   static bool supportsWriting( const QString& protocol ) KDE_DEPRECATED;
  633.   /// @deprecated
  634.   static bool supportsMakeDir( const QString& protocol ) KDE_DEPRECATED;
  635.   /// @deprecated
  636.   static bool supportsDeleting( const QString& protocol ) KDE_DEPRECATED;
  637.   /// @deprecated
  638.   static bool supportsLinking( const QString& protocol ) KDE_DEPRECATED;
  639.   /// @deprecated
  640.   static bool supportsMoving( const QString& protocol ) KDE_DEPRECATED;
  641.   /// @deprecated
  642.   static bool canCopyFromFile( const QString& protocol ) KDE_DEPRECATED;
  643.   /// @deprecated
  644.   static bool canCopyToFile( const QString& protocol ) KDE_DEPRECATED;
  645.   /// @deprecated
  646.   static QString defaultMimetype( const QString& protocol) KDE_DEPRECATED;
  647.   //////////////////////// END DEPRECATED ///////////////////////
  648.  
  649. protected:
  650.   QString m_name;
  651.   QString m_exec;
  652.   Type m_inputType;
  653.   Type m_outputType;
  654.   QStringList m_listing;
  655.   bool m_isSourceProtocol;
  656.   bool m_isHelperProtocol;
  657.   bool m_supportsListing;
  658.   bool m_supportsReading;
  659.   bool m_supportsWriting;
  660.   bool m_supportsMakeDir;
  661.   bool m_supportsDeleting;
  662.   bool m_supportsLinking;
  663.   bool m_supportsMoving;
  664.   QString m_defaultMimetype;
  665.   bool m_determineMimetypeFromExtension;
  666.   QString m_icon;
  667.   bool m_canCopyFromFile;
  668.   bool m_canCopyToFile;
  669.   QString m_config;
  670.   int m_maxSlaves;
  671.  
  672.   bool canRenameFromFile() const; // for kprotocolinfo_kdecore
  673.   bool canRenameToFile() const; // for kprotocolinfo_kdecore
  674.   bool canDeleteRecursive() const; // for kprotocolinfo_kdecore
  675.   FileNameUsedForCopying fileNameUsedForCopying() const; // for kprotocolinfo_kdecore
  676.   static KProtocolInfo* findProtocol(const KURL &url); // for kprotocolinfo_kdecore
  677.  
  678. protected:
  679.   virtual void virtual_hook( int id, void* data );
  680. private:
  681.   class KProtocolInfoPrivate;
  682.   KProtocolInfoPrivate* d;
  683. };
  684.  
  685. KIO_EXPORT QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field );
  686. KIO_EXPORT QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field );
  687.  
  688. #endif
  689.