• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
kprotocolinfo.h
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 <tqstring.h>
23 #include <tqstringlist.h>
24 #include <tqdatastream.h>
25 
26 #include <kurl.h>
27 #include <tdesycocaentry.h>
28 #include <tdesycocatype.h>
29 
44 class TDEIO_EXPORT KProtocolInfo : public KSycocaEntry
45 {
46  friend class KProtocolInfoFactory;
47  K_SYCOCATYPE( KST_KProtocolInfo, KSycocaEntry )
48 
49 public:
50  typedef TDESharedPtr<KProtocolInfo> Ptr;
51 
52 public:
57  KProtocolInfo( const TQString & path); // KDE4: make private and add friend class KProtocolInfoBuildFactory
58  // Then we can get rid of the d pointer
59 
64  virtual bool isValid() const { return !m_name.isEmpty(); }
65 
74  virtual TQString name() const { return m_name; }
75 
76  //
77  // Static functions:
78  //
79 
84  static TQStringList protocols();
85 
93  static bool isKnownProtocol( const KURL &url );
94 
99  static bool isKnownProtocol( const TQString& protocol )
100 #ifdef KPROTOCOLINFO_TDECORE
101  TDE_WEAK_SYMBOL
102 #endif
103  ;
104 
116  static TQString exec( const TQString& protocol );
117 
121  enum Type { T_STREAM,
122  T_FILESYSTEM,
123  T_NONE,
124  T_ERROR
125  };
126 
137  static Type inputType( const KURL &url );
138 
149  static Type outputType( const KURL &url );
150 
163  static TQStringList listing( const KURL &url );
164 
175  struct ExtraField {
176  ExtraField() {} // for QValueList
177  ExtraField(const TQString& _name, const TQString& _type )
178  : name(_name), type(_type) {
179  }
180  TQString name;
181  TQString type; // KDE4: make it TQVariant::Type
182  };
183  typedef TQValueList<ExtraField > ExtraFieldList;
193  static ExtraFieldList extraFields( const KURL& url );
194 
208  static bool isSourceProtocol( const KURL &url );
209 
222  static bool isHelperProtocol( const KURL &url );
223 
228  static bool isHelperProtocol( const TQString& protocol )
229 #ifdef KPROTOCOLINFO_TDECORE
230  TDE_WEAK_SYMBOL
231 #endif
232  ;
233 
250  static bool isFilterProtocol( const KURL &url );
251 
256  static bool isFilterProtocol( const TQString& protocol )
257 #ifdef KPROTOCOLINFO_TDECORE
258  TDE_WEAK_SYMBOL
259 #endif
260  ;
261 
277  static bool supportsListing( const KURL &url );
278 
288  static bool supportsReading( const KURL &url );
289 
299  static bool supportsWriting( const KURL &url );
300 
310  static bool supportsMakeDir( const KURL &url );
311 
321  static bool supportsDeleting( const KURL &url );
322 
332  static bool supportsLinking( const KURL &url );
333 
344  static bool supportsMoving( const KURL &url );
345 
358  static bool canCopyFromFile( const KURL &url );
359 
372  static bool canCopyToFile( const KURL &url );
373 
387  static bool canRenameFromFile( const KURL &url );
388 
402  static bool canRenameToFile( const KURL &url );
403 
416  static bool canDeleteRecursive( const KURL &url );
417 
418  typedef enum { Name, FromURL } FileNameUsedForCopying;
419 
436  static FileNameUsedForCopying fileNameUsedForCopying( const KURL &url );
437 
446  static TQString defaultMimetype( const KURL& url );
447 
456  static TQString icon( const TQString& protocol );
457 
469  static TQString config( const TQString& protocol );
470 
483  static int maxSlaves( const TQString& protocol );
484 
496  static bool determineMimetypeFromExtension( const TQString &protocol );
497 
507  static TQString docPath( const TQString& protocol );
508 
525  static TQString protocolClass( const TQString& protocol );
526 
538  static bool showFilePreview( const TQString& protocol );
539 
555  static KURL::URIMode uriParseMode( const TQString& protocol );
556 
575  static TQStringList capabilities( const TQString& protocol );
576 
588  static TQString proxiedBy( const TQString& protocol );
589 
590 public:
591  // Internal functions:
595  KProtocolInfo( TQDataStream& _str, int offset);
596 
597  virtual ~KProtocolInfo();
598 
603  virtual void load(TQDataStream& );
604 
609  virtual void save(TQDataStream& );
610 
612  // The following methods are deprecated:
613 
615  static Type inputType( const TQString& protocol ) TDE_DEPRECATED;
617  static Type outputType( const TQString& protocol ) TDE_DEPRECATED;
624  static TQStringList listing( const TQString& protocol ) TDE_DEPRECATED;
626  static bool isSourceProtocol( const TQString& protocol ) TDE_DEPRECATED;
628  static bool supportsListing( const TQString& protocol ) TDE_DEPRECATED;
630  static bool supportsReading( const TQString& protocol ) TDE_DEPRECATED;
632  static bool supportsWriting( const TQString& protocol ) TDE_DEPRECATED;
634  static bool supportsMakeDir( const TQString& protocol ) TDE_DEPRECATED;
636  static bool supportsDeleting( const TQString& protocol ) TDE_DEPRECATED;
638  static bool supportsLinking( const TQString& protocol ) TDE_DEPRECATED;
640  static bool supportsMoving( const TQString& protocol ) TDE_DEPRECATED;
642  static bool canCopyFromFile( const TQString& protocol ) TDE_DEPRECATED;
644  static bool canCopyToFile( const TQString& protocol ) TDE_DEPRECATED;
646  static TQString defaultMimetype( const TQString& protocol) TDE_DEPRECATED;
648 
649 protected:
650  TQString m_name;
651  TQString m_exec;
652  Type m_inputType;
653  Type m_outputType;
654  TQStringList 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  TQString m_defaultMimetype;
665  bool m_determineMimetypeFromExtension;
666  TQString m_icon;
667  bool m_canCopyFromFile;
668  bool m_canCopyToFile;
669  TQString m_config;
670  int m_maxSlaves;
671 
672  bool canRenameFromFile() const; // for kprotocolinfo_tdecore
673  bool canRenameToFile() const; // for kprotocolinfo_tdecore
674  bool canDeleteRecursive() const; // for kprotocolinfo_tdecore
675  FileNameUsedForCopying fileNameUsedForCopying() const; // for kprotocolinfo_tdecore
676  static KProtocolInfo* findProtocol(const KURL &url); // for kprotocolinfo_tdecore
677 
678 protected:
679  virtual void virtual_hook( int id, void* data );
680 private:
681  class KProtocolInfoPrivate;
682  KProtocolInfoPrivate* d;
683 };
684 
685 TDEIO_EXPORT TQDataStream& operator>>( TQDataStream& s, KProtocolInfo::ExtraField& field );
686 TDEIO_EXPORT TQDataStream& operator<<( TQDataStream& s, const KProtocolInfo::ExtraField& field );
687 
688 #endif
KProtocolInfo
Information about I/O (Internet, etc.) protocols supported by KDE.
Definition: kprotocolinfo.h:45
KProtocolInfo::KProtocolInfo
KProtocolInfo(const TQString &path)
Read a protocol description file.
KProtocolInfo::canCopyToFile
static bool canCopyToFile(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::isSourceProtocol
static bool isSourceProtocol(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::protocols
static TQStringList protocols()
Returns list of all known protocols.
KProtocolInfo::supportsListing
static bool supportsListing(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::showFilePreview
static bool showFilePreview(const TQString &protocol)
Returns whether file previews should be shown for the specified protocol.
KProtocolInfo::supportsMoving
static bool supportsMoving(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::supportsLinking
static bool supportsLinking(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::supportsWriting
static bool supportsWriting(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::outputType
static Type outputType(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::extraFields
static ExtraFieldList extraFields(const KURL &url)
Definition of extra fields in the UDS entries, returned by a listDir operation.
KProtocolInfo::determineMimetypeFromExtension
static bool determineMimetypeFromExtension(const TQString &protocol)
Returns whether mimetypes can be determined based on extension for this protocol.
KProtocolInfo::maxSlaves
static int maxSlaves(const TQString &protocol)
Returns the soft limit on the number of slaves for this protocol.
KProtocolInfo::exec
static TQString exec(const TQString &protocol)
Returns the library / executable to open for the protocol protocol Example : "tdeio_ftp",...
KProtocolInfo::icon
static TQString icon(const TQString &protocol)
Returns the name of the icon, associated with the specified protocol.
KProtocolInfo::name
virtual TQString name() const
Returns the name of the protocol.
Definition: kprotocolinfo.h:74
KProtocolInfo::Type
Type
Describes the type of a protocol.
Definition: kprotocolinfo.h:121
KProtocolInfo::T_STREAM
@ T_STREAM
protocol returns a stream
Definition: kprotocolinfo.h:121
KProtocolInfo::T_NONE
@ T_NONE
no information about the tyope available
Definition: kprotocolinfo.h:123
KProtocolInfo::T_FILESYSTEM
@ T_FILESYSTEM
protocol describes location in a file system
Definition: kprotocolinfo.h:122
KProtocolInfo::protocolClass
static TQString protocolClass(const TQString &protocol)
Returns the protocol class for the specified protocol.
KProtocolInfo::docPath
static TQString docPath(const TQString &protocol)
Returns the documentation path for the specified protocol.
KProtocolInfo::capabilities
static TQStringList capabilities(const TQString &protocol)
Returns the list of capabilities provided by the tdeioslave implementing this protocol.
KProtocolInfo::proxiedBy
static TQString proxiedBy(const TQString &protocol)
Returns the name of the protocol through which the request will be routed if proxy support is enabled...
KProtocolInfo::supportsMakeDir
static bool supportsMakeDir(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::config
static TQString config(const TQString &protocol)
Returns the name of the config file associated with the specified protocol.
KProtocolInfo::supportsReading
static bool supportsReading(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::listing
static TQStringList listing(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::isValid
virtual bool isValid() const
Returns whether the protocol description file is valid.
Definition: kprotocolinfo.h:64
KProtocolInfo::uriParseMode
static KURL::URIMode uriParseMode(const TQString &protocol)
Returns the suggested URI parsing mode for the KURL parser.
KProtocolInfo::supportsDeleting
static bool supportsDeleting(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::inputType
static Type inputType(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::defaultMimetype
static TQString defaultMimetype(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::canCopyFromFile
static bool canCopyFromFile(const TQString &protocol) TDE_DEPRECATED
KProtocolInfo::ExtraField
Definition of an extra field in the UDS entries, returned by a listDir operation.
Definition: kprotocolinfo.h:175

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.