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

kio/kio

  • kio
  • kio
netaccess.h
1 /*
2  This file is part of the KDE libraries
3  Copyright (C) 1997 Torben Weis (weis@kde.org)
4  Copyright (C) 1998 Matthias Ettrich (ettrich@kde.org)
5  Copyright (C) 1999-2004 David Faure (faure@kde.org)
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef __kio_netaccess_h
24 #define __kio_netaccess_h
25 
26 #include <tqobject.h>
27 #include <tqstring.h>
28 #include <kio/global.h>
29 
30 class TQStringList;
31 class TQWidget;
32 class KURL;
33 template<typename T, typename K> class TQMap;
34 
35 namespace KIO {
36 
37  class Job;
38 
59 class KIO_EXPORT NetAccess : public TQObject
60 {
61  Q_OBJECT
62 
63 public:
117  static bool download(const KURL& src, TQString & target, TQWidget* window);
118 
122  static bool download(const KURL& src, TQString & target) KDE_DEPRECATED;
123 
135  static void removeTempFile(const TQString& name);
136 
156  static bool upload(const TQString& src, const KURL& target, TQWidget* window);
157 
161  static bool upload(const TQString& src, const KURL& target) KDE_DEPRECATED;
162 
181  static bool copy( const KURL& src, const KURL& target, TQWidget* window );
182  // KDE4: rename to file_copy
183 
187  static bool copy( const KURL& src, const KURL& target ) KDE_DEPRECATED;
188  // KDE4: merge with above
189 
193  static bool file_copy( const KURL& src, const KURL& dest, int permissions=-1,
194  bool overwrite=false, bool resume=false, TQWidget* window = 0L );
195 
201  static bool file_move( const KURL& src, const KURL& target, int permissions=-1,
202  bool overwrite=false, bool resume=false, TQWidget* window = 0L );
203 
204 
224  static bool dircopy( const KURL& src, const KURL& target, TQWidget* window );
225 
229  static bool dircopy( const KURL& src, const KURL& target ) KDE_DEPRECATED; // KDE4: merge
230 
234  static bool dircopy( const KURL::List& src, const KURL& target, TQWidget* window = 0L );
235 
241  static bool move( const KURL& src, const KURL& target, TQWidget* window = 0L );
242 
248  static bool move( const KURL::List& src, const KURL& target, TQWidget* window = 0L );
249 
266  static bool exists(const KURL& url, bool source, TQWidget* window);
267 
272  static bool exists(const KURL& url, TQWidget* window) KDE_DEPRECATED;
273 
277  static bool exists(const KURL& url) KDE_DEPRECATED;
278 
282  static bool exists(const KURL& url, bool source) KDE_DEPRECATED; // KDE4: merge
283 
300  static bool stat(const KURL& url, KIO::UDSEntry & entry, TQWidget* window);
301 
305  static bool stat(const KURL& url, KIO::UDSEntry & entry) KDE_DEPRECATED;
306 
323  static KURL mostLocalURL(const KURL& url, TQWidget* window);
324 
339  static bool del( const KURL & url, TQWidget* window );
340 
347  static bool del( const KURL & url ) KDE_DEPRECATED;
348 
364  static bool mkdir( const KURL & url, TQWidget* window, int permissions = -1 );
365 
372  static bool mkdir( const KURL & url, int permissions = -1 ) KDE_DEPRECATED;
373 
392  static TQString fish_execute( const KURL & url, const TQString command, TQWidget* window );
393 
428  static bool synchronousRun( Job* job, TQWidget* window, TQByteArray* data=0,
429  KURL* finalURL=0, TQMap<TQString,TQString>* metaData=0 );
430 
453  static TQString mimetype( const KURL & url, TQWidget* window );
454 
461  static TQString mimetype( const KURL & url ) KDE_DEPRECATED;
462 
468  static TQString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : TQString::null; }
469 
475  static int lastError() { return lastErrorCode; }
476 
477 private:
481  NetAccess() : m_metaData(0), d(0) {}
482 
486  ~NetAccess() {}
487 
491  bool filecopyInternal(const KURL& src, const KURL& target, int permissions,
492  bool overwrite, bool resume, TQWidget* window, bool move);
493  bool dircopyInternal(const KURL::List& src, const KURL& target,
494  TQWidget* window, bool move);
495  bool statInternal(const KURL & url, int details, bool source, TQWidget* window = 0);
496 
497  bool delInternal(const KURL & url, TQWidget* window = 0);
498  bool mkdirInternal(const KURL & url, int permissions, TQWidget* window = 0);
499  TQString fish_executeInternal(const KURL & url, const TQString command, TQWidget* window = 0);
500  bool synchronousRunInternal( Job* job, TQWidget* window, TQByteArray* data,
501  KURL* finalURL, TQMap<TQString,TQString>* metaData );
502 
503  TQString mimetypeInternal(const KURL & url, TQWidget* window = 0);
504  void enter_loop();
505 
509  static TQStringList* tmpfiles;
510 
511  static TQString* lastErrorMsg;
512  static int lastErrorCode;
513 
514  friend class I_like_this_class;
515 
516 private slots:
517  void slotResult( KIO::Job * job );
518  void slotMimetype( KIO::Job * job, const TQString & type );
519  void slotData( KIO::Job*, const TQByteArray& );
520  void slotRedirection( KIO::Job*, const KURL& );
521 
522 private:
523  UDSEntry m_entry;
524  TQString m_mimetype;
525  TQByteArray m_data;
526  KURL m_url;
527  TQMap<TQString, TQString> *m_metaData;
528 
532  bool bJobOK;
533 
534 private:
535  class NetAccessPrivate* d; // not really needed, the ctor is private already.
536 };
537 
538 }
539 
540 #endif
KIO::NetAccess
Net Transparency.
Definition: netaccess.h:59
KIO::NetAccess::lastErrorString
static TQString lastErrorString()
Returns the error string for the last job, in case it failed.
Definition: netaccess.h:468
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KIO::file_copy
KIO_EXPORT FileCopyJob * file_copy(const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
Copy a single file.
Definition: job.cpp:1963
KIO::move
KIO_EXPORT CopyJob * move(const KURL &src, const KURL &dest, bool showProgressInfo=true)
Moves a file or directory src to the given destination dest.
Definition: job.cpp:3908
KIO::mimetype
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1509
KIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:506
KIO::copy
KIO_EXPORT CopyJob * copy(const KURL &src, const KURL &dest, bool showProgressInfo=true)
Copy a file or directory src into the destination dest, which can be a file (including the final file...
Definition: job.cpp:3886
KIO::NetAccess::lastError
static int lastError()
Returns the error code for the last job, in case it failed.
Definition: netaccess.h:475
KIO::stat
KIO_EXPORT StatJob * stat(const KURL &url, bool showProgressInfo=true)
Find all details for one file or directory.
Definition: job.cpp:886
KIO::file_move
KIO_EXPORT FileCopyJob * file_move(const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
Move a single file.
Definition: job.cpp:1969
KIO::del
KIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4386
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::mkdir
KIO_EXPORT SimpleJob * mkdir(const KURL &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:751

kio/kio

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

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |