• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • sycoca
kprotocolinfo.h
Go to the documentation of this file.
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 <kglobal.h>
23 
24 #include <kurl.h>
25 #include <ksycocaentry.h>
26 #include <ksycocatype.h>
27 #include <QtCore/QVariant>
28 #include <QtCore/QStringList>
29 
30 class QDataStream;
31 class KProtocolInfoPrivate;
32 
49 class KDECORE_EXPORT KProtocolInfo : public KSycocaEntry
50 {
51  friend class KProtocolInfoFactory;
52  friend class KBuildProtocolInfoFactory;
53  friend class KProtocolManager;
54 public:
55  typedef KSharedPtr<KProtocolInfo> Ptr;
56  typedef QList<Ptr> List;
57 
58 public:
59 
60  //
61  // Static functions:
62  //
63 
68  static QStringList protocols();
69 
77  static bool isKnownProtocol( const KUrl &url );
78 
83  static bool isKnownProtocol( const QString& protocol );
84 
96  static QString exec( const QString& protocol );
97 
105  enum Type { T_STREAM,
106  T_FILESYSTEM,
107  T_NONE,
108  T_ERROR
109  };
110 
119  struct ExtraField {
120 
121  enum Type { String = QVariant::String, DateTime = QVariant::DateTime, Invalid = QVariant::Invalid };
122 
123  ExtraField() : type(Invalid) {}
124  ExtraField(const QString& _name, Type _type )
125  : name(_name), type(_type) {
126  }
127  QString name;
128  Type type;
129  };
130  typedef QList<ExtraField> ExtraFieldList;
138  static ExtraFieldList extraFields( const KUrl& url );
139 
152  static bool isHelperProtocol( const KUrl &url );
153 
158  static bool isHelperProtocol( const QString& protocol );
159 
176  static bool isFilterProtocol( const KUrl &url );
177 
182  static bool isFilterProtocol( const QString& protocol );
183 
192  static QString icon( const QString& protocol );
193 
205  static QString config( const QString& protocol );
206 
219  static int maxSlaves( const QString& protocol );
220 
221 
233  static int maxSlavesPerHost( const QString& protocol );
234 
246  static bool determineMimetypeFromExtension( const QString &protocol );
247 
256  static QString docPath( const QString& protocol );
257 
273  static QString protocolClass( const QString& protocol );
274 
285  static bool showFilePreview( const QString& protocol );
286 
303  static QStringList capabilities( const QString& protocol );
304 
314  static QString proxiedBy( const QString& protocol );
315 
316 public:
317  // Internal functions:
321  KProtocolInfo( QDataStream& _str, int offset);
322 
323  virtual ~KProtocolInfo();
324 
325  typedef enum { Name, FromUrl, DisplayName } FileNameUsedForCopying;
326 
328  bool supportsListing() const;
330  QString defaultMimeType() const;
332  QStringList archiveMimeTypes() const;
333 
334 protected:
335  QString m_name;
336  QString m_exec;
337  Type m_inputType;
338  Type m_outputType;
339  QStringList m_listing;
340  bool m_isSourceProtocol;
341  bool m_isHelperProtocol;
342  bool m_supportsListing;
343  bool m_supportsReading;
344  bool m_supportsWriting;
345  bool m_supportsMakeDir;
346  bool m_supportsDeleting;
347  bool m_supportsLinking;
348  bool m_supportsMoving;
349  bool m_supportsOpening;
350  QString m_defaultMimetype;
351  bool m_determineMimetypeFromExtension;
352  QString m_icon;
353  bool m_canCopyFromFile;
354  bool m_canCopyToFile;
355  QString m_config;
356  int m_maxSlaves;
357 
358  bool canRenameFromFile() const;
359  bool canRenameToFile() const;
360  bool canDeleteRecursive() const;
361  FileNameUsedForCopying fileNameUsedForCopying() const;
362 
363 private:
368  KProtocolInfo( const QString & path);
369 
370  Q_DECLARE_PRIVATE(KProtocolInfo)
371 
372  void load(QDataStream &s);
373 };
374 
375 KDECORE_EXPORT QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field );
376 KDECORE_EXPORT QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field );
377 
378 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Fri Nov 16 2012 14:49:04 by doxygen 1.8.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs-4.8.5 API Reference

Skip menu "kdelibs-4.8.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal