# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kprotocolinfo.h

    00001 /* This file is part of the KDE libraries
    00002    Copyright (C) 1999 Torben Weis <weis@kde.org>
    00003    Copyright (C) 2000-2001 Waldo Bastian <bastian@kde.org>
    00004
    00005    This library is free software; you can redistribute it and/or
    00006    modify it under the terms of the GNU Library General Public
    00007    License version 2 as published by the Free Software Foundation.
    00008
    00009    This library is distributed in the hope that it will be useful,
    00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012    Library General Public License for more details.
    00013
    00014    You should have received a copy of the GNU Library General Public License
    00015    along with this library; see the file COPYING.LIB.  If not, write to
    00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017    Boston, MA 02111-1307, USA.
    00018 */
    00019 #ifndef __kprotocolinfo_h__
    00020 #define __kprotocolinfo_h__
    00021
    00022 #include <qstring.h>
    00023 #include <qstringlist.h>
    00024 #include <qdatastream.h>
    00025
    00026 #include <kurl.h>
    00027 #include <ksycocaentry.h>
    00028 #include <ksycocatype.h>
    00029
    00044 class KIO_EXPORT KProtocolInfo : public KSycocaEntry
    00045 {
    00046   friend class KProtocolInfoFactory;
    00047   K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry )
    00048
    00049 public:
    00050   typedef KSharedPtr<KProtocolInfo> Ptr;
    00051
    00052 public:
    00057   KProtocolInfo( const QString & path); // KDE4: make private and add friend class KProtocolInfoBuildFactory
    00058                                         // Then we can get rid of the d pointer
    00059
    00064   virtual bool isValid() const { return !m_name.isEmpty(); }
    00065
    00074   virtual QString name() const { return m_name; }
    00075
    00076   //
    00077   // Static functions:
    00078   //
    00079
    00084   static QStringList protocols();
    00085
    00093   static bool isKnownProtocol( const KURL &url );
    00094
    00099   static bool isKnownProtocol( const QString& protocol );
    00100
    00112   static QString exec( const QString& protocol );
    00113
    00117   enum Type { T_STREAM,
    00118           T_FILESYSTEM,
    00119           T_NONE,
    00120           T_ERROR
    00121   };
    00122
    00133   static Type inputType( const KURL &url );
    00134
    00145   static Type outputType( const KURL &url );
    00146
    00159   static QStringList listing( const KURL &url );
    00160
    00171   struct ExtraField {
    00172     ExtraField() {} // for QValueList
    00173     ExtraField(const QString& _name, const QString& _type )
    00174       : name(_name), type(_type) {
    00175     }
    00176     QString name;
    00177     QString type; // KDE4: make it QVariant::Type
    00178   };
    00179   typedef QValueList<ExtraField > ExtraFieldList;
    00189   static ExtraFieldList extraFields( const KURL& url );
    00190
    00204   static bool isSourceProtocol( const KURL &url );
    00205
    00218   static bool isHelperProtocol( const KURL &url );
    00219
    00224   static bool isHelperProtocol( const QString& protocol );
    00225
    00242   static bool isFilterProtocol( const KURL &url );
    00243
    00248   static bool isFilterProtocol( const QString& protocol );
    00249
    00265   static bool supportsListing( const KURL &url );
    00266
    00276   static bool supportsReading( const KURL &url );
    00277
    00287   static bool supportsWriting( const KURL &url );
    00288
    00298   static bool supportsMakeDir( const KURL &url );
    00299
    00309   static bool supportsDeleting( const KURL &url );
    00310
    00320   static bool supportsLinking( const KURL &url );
    00321
    00332   static bool supportsMoving( const KURL &url );
    00333
    00346   static bool canCopyFromFile( const KURL &url );
    00347
    00360   static bool canCopyToFile( const KURL &url );
    00361
    00375   static bool canRenameFromFile( const KURL &url );
    00376
    00390   static bool canRenameToFile( const KURL &url );
    00391
    00404   static bool canDeleteRecursive( const KURL &url );
    00405
    00406   typedef enum { Name, FromURL } FileNameUsedForCopying;
    00407
    00424   static FileNameUsedForCopying fileNameUsedForCopying( const KURL &url );
    00425
    00434   static QString defaultMimetype( const KURL& url );
    00435
    00444   static QString icon( const QString& protocol );
    00445
    00457   static QString config( const QString& protocol );
    00458
    00471   static int maxSlaves( const QString& protocol );
    00472
    00484   static bool determineMimetypeFromExtension( const QString &protocol );
    00485
    00495   static QString docPath( const QString& protocol );
    00496
    00513   static QString protocolClass( const QString& protocol );
    00514
    00526   static bool showFilePreview( const QString& protocol );
    00527
    00543   static KURL::URIMode uriParseMode( const QString& protocol );
    00544
    00563   static QStringList capabilities( const QString& protocol );
    00564
    00576   static QString proxiedBy( const QString& protocol );
    00577
    00578 public:
    00579   // Internal functions:
    00583   KProtocolInfo( QDataStream& _str, int offset);
    00584
    00585   virtual ~KProtocolInfo();
    00586
    00591   virtual void load(QDataStream& );
    00592
    00597   virtual void save(QDataStream& );
    00598
    00600   // The following methods are deprecated:
    00601
    00603   static Type inputType( const QString& protocol ) KDE_DEPRECATED;
    00605   static Type outputType( const QString& protocol ) KDE_DEPRECATED;
    00612   static QStringList listing( const QString& protocol ) KDE_DEPRECATED;
    00614   static bool isSourceProtocol( const QString& protocol ) KDE_DEPRECATED;
    00616   static bool supportsListing( const QString& protocol ) KDE_DEPRECATED;
    00618   static bool supportsReading( const QString& protocol ) KDE_DEPRECATED;
    00620   static bool supportsWriting( const QString& protocol ) KDE_DEPRECATED;
    00622   static bool supportsMakeDir( const QString& protocol ) KDE_DEPRECATED;
    00624   static bool supportsDeleting( const QString& protocol ) KDE_DEPRECATED;
    00626   static bool supportsLinking( const QString& protocol ) KDE_DEPRECATED;
    00628   static bool supportsMoving( const QString& protocol ) KDE_DEPRECATED;
    00630   static bool canCopyFromFile( const QString& protocol ) KDE_DEPRECATED;
    00632   static bool canCopyToFile( const QString& protocol ) KDE_DEPRECATED;
    00634   static QString defaultMimetype( const QString& protocol) KDE_DEPRECATED;
    00636
    00637 protected:
    00638   QString m_name;
    00639   QString m_exec;
    00640   Type m_inputType;
    00641   Type m_outputType;
    00642   QStringList m_listing;
    00643   bool m_isSourceProtocol;
    00644   bool m_isHelperProtocol;
    00645   bool m_supportsListing;
    00646   bool m_supportsReading;
    00647   bool m_supportsWriting;
    00648   bool m_supportsMakeDir;
    00649   bool m_supportsDeleting;
    00650   bool m_supportsLinking;
    00651   bool m_supportsMoving;
    00652   QString m_defaultMimetype;
    00653   bool m_determineMimetypeFromExtension;
    00654   QString m_icon;
    00655   bool m_canCopyFromFile;
    00656   bool m_canCopyToFile;
    00657   QString m_config;
    00658   int m_maxSlaves;
    00659
    00660   bool canRenameFromFile() const; // for kprotocolinfo_kdecore
    00661   bool canRenameToFile() const; // for kprotocolinfo_kdecore
    00662   bool canDeleteRecursive() const; // for kprotocolinfo_kdecore
    00663   FileNameUsedForCopying fileNameUsedForCopying() const; // for kprotocolinfo_kdecore
    00664   static KProtocolInfo* findProtocol(const KURL &url); // for kprotocolinfo_kdecore
    00665
    00666 protected:
    00667   virtual void virtual_hook( int id, void* data );
    00668 private:
    00669   class KProtocolInfoPrivate;
    00670   KProtocolInfoPrivate* d;
    00671 };
    00672
    00673 KIO_EXPORT QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field );
    00674 KIO_EXPORT QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field );
    00675
    00676 #endif

This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:24:03 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003