kprotocolinfo.h Source File (kio Library)

| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | 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 <kurl.h>
    00025 #include <ksycocaentry.h>
    00026 #include <ksycocatype.h>
    00027
    00040 class KProtocolInfo : public KSycocaEntry
    00041 {
    00042   friend class KProtocolInfoFactory;
    00043   K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry )
    00044
    00045 public:
    00046   typedef KSharedPtr<KProtocolInfo> Ptr;
    00047
    00048 public:
    00052   KProtocolInfo( const QString & path);
    00053
    00057   virtual bool isValid() const { return !m_name.isEmpty(); }
    00058
    00066   virtual QString name() const { return m_name; }
    00067
    00068   //
    00069   // Static functions:
    00070   //
    00071
    00075   static QStringList protocols();
    00076
    00082   static bool isKnownProtocol( const KURL &url );
    00083
    00092   static QString exec( const QString& protocol );
    00093
    00094   enum Type { T_STREAM, T_FILESYSTEM, T_NONE, T_ERROR };
    00103   static Type inputType( const KURL &url );
    00104
    00113   static Type outputType( const KURL &url );
    00114
    00123   static QStringList listing( const KURL &url );
    00124
    00137   static bool isSourceProtocol( const KURL &url );
    00138
    00146   static bool isHelperProtocol( const KURL &url );
    00147
    00160   static bool isFilterProtocol( const KURL &url );
    00161
    00174   static bool supportsListing( const KURL &url );
    00175
    00182   static bool supportsReading( const KURL &url );
    00183
    00190   static bool supportsWriting( const KURL &url );
    00191
    00198   static bool supportsMakeDir( const KURL &url );
    00199
    00206   static bool supportsDeleting( const KURL &url );
    00207
    00214   static bool supportsLinking( const KURL &url );
    00215
    00223   static bool supportsMoving( const KURL &url );
    00224
    00234   static bool canCopyFromFile( const KURL &url );
    00235
    00245   static bool canCopyToFile( const KURL &url );
    00246
    00252   static QString defaultMimetype( const KURL& url );
    00253
    00259   static QString icon( const QString& protocol );
    00260
    00269   static QString config( const QString& protocol );
    00270
    00280   static int maxSlaves( const QString& protocol );
    00281
    00290   static bool determineMimetypeFromExtension( const QString &protocol );
    00291
    00292 public:
    00293   // Internal functions:
    00297   KProtocolInfo( QDataStream& _str, int offset);
    00298
    00299   virtual ~KProtocolInfo();
    00300
    00305   virtual void load(QDataStream& );
    00306
    00311   virtual void save(QDataStream& );
    00312
    00314   // The following methods are deprecated:
    00315
    00316   static Type inputType( const QString& protocol );
    00317   static Type outputType( const QString& protocol );
    00323   static QStringList listing( const QString& protocol );
    00324   static bool isSourceProtocol( const QString& protocol );
    00325   static bool isHelperProtocol( const QString& protocol );
    00326   static bool isFilterProtocol( const QString& protocol );
    00327   static bool isKnownProtocol( const QString& protocol );
    00328   static bool supportsListing( const QString& protocol );
    00329   static bool supportsReading( const QString& protocol );
    00330   static bool supportsWriting( const QString& protocol );
    00331   static bool supportsMakeDir( const QString& protocol );
    00332   static bool supportsDeleting( const QString& protocol );
    00333   static bool supportsLinking( const QString& protocol );
    00334   static bool supportsMoving( const QString& protocol );
    00335   static bool canCopyFromFile( const QString& protocol );
    00336   static bool canCopyToFile( const QString& protocol );
    00337   static QString defaultMimetype( const QString& protocol);
    00339
    00340 protected:
    00341   QString m_name;
    00342   QString m_exec;
    00343   Type m_inputType;
    00344   Type m_outputType;
    00345   QStringList m_listing;
    00346   bool m_isSourceProtocol;
    00347   bool m_isHelperProtocol;
    00348   bool m_supportsListing;
    00349   bool m_supportsReading;
    00350   bool m_supportsWriting;
    00351   bool m_supportsMakeDir;
    00352   bool m_supportsDeleting;
    00353   bool m_supportsLinking;
    00354   bool m_supportsMoving;
    00355   QString m_defaultMimetype;
    00356   bool m_determineMimetypeFromExtension;
    00357   QString m_icon;
    00358   bool m_canCopyFromFile;
    00359   bool m_canCopyToFile;
    00360   QString m_config;
    00361   int m_maxSlaves;
    00362 protected:
    00363   virtual void virtual_hook( int id, void* data );
    00364 private:
    00365   class KProtocolInfoPrivate* d;
    00366 };
    00367
    00368 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:14:11 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001