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

KDECore

kprotocolinfo.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef KPROTOCOLINFO_H
00020 #define KPROTOCOLINFO_H
00021 
00022 #include <kglobal.h>
00023 
00024 #include <kurl.h>
00025 #include <ksycocaentry.h>
00026 #include <ksycocatype.h>
00027 #include <QtCore/QVariant>
00028 #include <QtCore/QStringList>
00029 
00030 class QDataStream;
00031 class KProtocolInfoPrivate;
00032 
00049 class KDECORE_EXPORT KProtocolInfo : public KSycocaEntry
00050 {
00051   friend class KProtocolInfoFactory;
00052   friend class KBuildProtocolInfoFactory;
00053   friend class KProtocolManager;
00054 public:
00055   typedef KSharedPtr<KProtocolInfo> Ptr;
00056     typedef QList<Ptr> List;
00057 
00058 public:
00059 
00060   //
00061   // Static functions:
00062   //
00063 
00068   static QStringList protocols();
00069 
00077   static bool isKnownProtocol( const KUrl &url );
00078 
00083   static bool isKnownProtocol( const QString& protocol );
00084 
00096   static QString exec( const QString& protocol );
00097 
00105   enum Type { T_STREAM, 
00106           T_FILESYSTEM, 
00107           T_NONE,   
00108           T_ERROR   
00109   };
00110 
00119   struct ExtraField {
00120 
00121     enum Type { String = QVariant::String, DateTime = QVariant::DateTime, Invalid = QVariant::Invalid };
00122 
00123     ExtraField() : type(Invalid) {}
00124     ExtraField(const QString& _name, Type _type )
00125       : name(_name), type(_type) {
00126     }
00127     QString name;
00128     Type type;
00129   };
00130   typedef QList<ExtraField> ExtraFieldList;
00138   static ExtraFieldList extraFields( const KUrl& url );
00139 
00152   static bool isHelperProtocol( const KUrl &url );
00153 
00158   static bool isHelperProtocol( const QString& protocol );
00159 
00176   static bool isFilterProtocol( const KUrl &url );
00177 
00182   static bool isFilterProtocol( const QString& protocol );
00183 
00192   static QString icon( const QString& protocol );
00193 
00205   static QString config( const QString& protocol );
00206 
00219   static int maxSlaves( const QString& protocol );
00220 
00232   static bool determineMimetypeFromExtension( const QString &protocol );
00233 
00242   static QString docPath( const QString& protocol );
00243 
00259   static QString protocolClass( const QString& protocol );
00260 
00271   static bool showFilePreview( const QString& protocol );
00272 
00286   //static KUrl::URIMode uriParseMode( const QString& protocol ); - gone in Qt-4.x
00287 
00304   static QStringList capabilities( const QString& protocol );
00305 
00315   static QString proxiedBy( const QString& protocol );
00316 
00317 public:
00318   // Internal functions:
00322   KProtocolInfo( QDataStream& _str, int offset);
00323 
00324   virtual ~KProtocolInfo();
00325 
00326   typedef enum { Name, FromUrl } FileNameUsedForCopying;
00327 
00329   bool supportsListing() const;
00331   QString defaultMimeType() const;
00333   QStringList archiveMimeTypes() const;
00334 
00335 protected:
00336   QString m_name;
00337   QString m_exec;
00338   Type m_inputType;
00339   Type m_outputType;
00340   QStringList m_listing;
00341   bool m_isSourceProtocol;
00342   bool m_isHelperProtocol;
00343   bool m_supportsListing;
00344   bool m_supportsReading;
00345   bool m_supportsWriting;
00346   bool m_supportsMakeDir;
00347   bool m_supportsDeleting;
00348   bool m_supportsLinking;
00349   bool m_supportsMoving;
00350   bool m_supportsOpening;
00351   QString m_defaultMimetype;
00352   bool m_determineMimetypeFromExtension;
00353   QString m_icon;
00354   bool m_canCopyFromFile;
00355   bool m_canCopyToFile;
00356   QString m_config;
00357   int m_maxSlaves;
00358 
00359   bool canRenameFromFile() const;
00360   bool canRenameToFile() const;
00361   bool canDeleteRecursive() const;
00362   FileNameUsedForCopying fileNameUsedForCopying() const;
00363 
00364 private:
00369   KProtocolInfo( const QString & path);
00370 
00371     Q_DECLARE_PRIVATE(KProtocolInfo)
00372 
00373     void load(QDataStream &s);
00374 };
00375 
00376 KDECORE_EXPORT QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field );
00377 KDECORE_EXPORT QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field );
00378 
00379 #endif

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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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