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

tdeio/tdeio

  • tdeio
  • tdeio
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 __tdeio_netaccess_h
24 #define __tdeio_netaccess_h
25 
26 #include <tqobject.h>
27 #include <tqstring.h>
28 #include <tdeio/global.h>
29 
30 class TQStringList;
31 class TQWidget;
32 class KURL;
33 template<typename T, typename K> class TQMap;
34 
35 namespace TDEIO {
36 
37  class Job;
38 
59 class TDEIO_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 
262  static KURL localURL(const KURL& url, TQWidget* window);
263 
280  static bool exists(const KURL& url, bool source, TQWidget* window);
281 
286  static bool exists(const KURL& url, TQWidget* window) KDE_DEPRECATED;
287 
291  static bool exists(const KURL& url) KDE_DEPRECATED;
292 
296  static bool exists(const KURL& url, bool source) KDE_DEPRECATED; // KDE4: merge
297 
314  static bool stat(const KURL& url, TDEIO::UDSEntry & entry, TQWidget* window);
315 
319  static bool stat(const KURL& url, TDEIO::UDSEntry & entry) KDE_DEPRECATED;
320 
337  static KURL mostLocalURL(const KURL& url, TQWidget* window);
338 
353  static bool del( const KURL & url, TQWidget* window );
354 
361  static bool del( const KURL & url ) KDE_DEPRECATED;
362 
378  static bool mkdir( const KURL & url, TQWidget* window, int permissions = -1 );
379 
386  static bool mkdir( const KURL & url, int permissions = -1 ) KDE_DEPRECATED;
387 
406  static TQString fish_execute( const KURL & url, const TQString command, TQWidget* window );
407 
442  static bool synchronousRun( Job* job, TQWidget* window, TQByteArray* data=0,
443  KURL* finalURL=0, TQMap<TQString,TQString>* metaData=0 );
444 
467  static TQString mimetype( const KURL & url, TQWidget* window );
468 
475  static TQString mimetype( const KURL & url ) KDE_DEPRECATED;
476 
482  static TQString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : TQString::null; }
483 
489  static int lastError() { return lastErrorCode; }
490 
491 private:
495  NetAccess() : m_metaData(0), d(0) {}
496 
500  ~NetAccess() {}
501 
505  bool filecopyInternal(const KURL& src, const KURL& target, int permissions,
506  bool overwrite, bool resume, TQWidget* window, bool move);
507  bool dircopyInternal(const KURL::List& src, const KURL& target,
508  TQWidget* window, bool move);
509  bool statInternal(const KURL & url, int details, bool source, TQWidget* window = 0);
510  KURL localURLInternal( const KURL & url, TQWidget* window = 0);
511 
512  bool delInternal(const KURL & url, TQWidget* window = 0);
513  bool mkdirInternal(const KURL & url, int permissions, TQWidget* window = 0);
514  TQString fish_executeInternal(const KURL & url, const TQString command, TQWidget* window = 0);
515  bool synchronousRunInternal( Job* job, TQWidget* window, TQByteArray* data,
516  KURL* finalURL, TQMap<TQString,TQString>* metaData );
517 
518  TQString mimetypeInternal(const KURL & url, TQWidget* window = 0);
519  void enter_loop();
520 
524  static TQStringList* tmpfiles;
525 
526  static TQString* lastErrorMsg;
527  static int lastErrorCode;
528 
529  friend class I_like_this_class;
530 
531 private slots:
532  void slotResult( TDEIO::Job * job );
533  void slotMimetype( TDEIO::Job * job, const TQString & type );
534  void slotLocalURL(TDEIO::Job*, const KURL&, bool);
535  void slotData( TDEIO::Job*, const TQByteArray& );
536  void slotRedirection( TDEIO::Job*, const KURL& );
537 
538 private:
539  UDSEntry m_entry;
540  TQString m_mimetype;
541  KURL m_localURL;
542  TQByteArray m_data;
543  KURL m_url;
544  TQMap<TQString, TQString> *m_metaData;
545 
549  bool bJobOK;
550 
551 private:
552  class NetAccessPrivate* d; // not really needed, the ctor is private already.
553 };
554 
555 }
556 
557 #endif
TDEIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:507
TDEIO::file_copy
TDEIO_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:1998
TDEIO::del
TDEIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4421
TDEIO::move
TDEIO_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:3943
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29
TDEIO::Job
The base class for all jobs.
Definition: jobclasses.h:67
TDEIO::NetAccess
Net Transparency.
Definition: netaccess.h:59
TDEIO::copy
TDEIO_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:3921
TDEIO::localURL
TDEIO_EXPORT LocalURLJob * localURL(const KURL &remoteUrl)
Retrieve local URL if available.
Definition: job.cpp:841
TDEIO::stat
TDEIO_EXPORT StatJob * stat(const KURL &url, bool showProgressInfo=true)
Find all details for one file or directory.
Definition: job.cpp:921
TDEIO::mimetype
TDEIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1544
TDEIO::file_move
TDEIO_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:2004
TDEIO::NetAccess::lastErrorString
static TQString lastErrorString()
Returns the error string for the last job, in case it failed.
Definition: netaccess.h:482
TDEIO::mkdir
TDEIO_EXPORT SimpleJob * mkdir(const KURL &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:751
TDEIO::NetAccess::lastError
static int lastError()
Returns the error code for the last job, in case it failed.
Definition: netaccess.h:489

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.