• 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
30class TQStringList;
31class TQWidget;
32class KURL;
33template<typename T, typename K> class TQMap;
34
35namespace TDEIO {
36
37 class Job;
38
59class TDEIO_EXPORT NetAccess : public TQObject
60{
61 TQ_OBJECT
62
63public:
117 static bool download(const KURL& src, TQString & target, TQWidget* window);
118
122 static bool download(const KURL& src, TQString & target) TDE_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) TDE_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 ) TDE_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 ) TDE_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) TDE_DEPRECATED;
287
291 static bool exists(const KURL& url) TDE_DEPRECATED;
292
296 static bool exists(const KURL& url, bool source) TDE_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) TDE_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 ) TDE_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 ) TDE_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 ) TDE_DEPRECATED;
476
482 static TQString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : TQString::null; }
483
489 static int lastError() { return lastErrorCode; }
490
491private:
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
531private 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
538private:
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
551private:
552 class NetAccessPrivate* d; // not really needed, the ctor is private already.
553};
554
555}
556
557#endif
TDEIO::Job
The base class for all jobs.
Definition jobclasses.h:67
TDEIO::NetAccess
Net Transparency.
Definition netaccess.h:60
TDEIO::NetAccess::move
static bool move(const KURL &src, const KURL &target, TQWidget *window=0L)
Full-fledged equivalent of TDEIO::move.
Definition netaccess.cpp:157
TDEIO::NetAccess::del
static bool del(const KURL &url, TQWidget *window)
Deletes a file or a directory in a synchronous way.
Definition netaccess.cpp:256
TDEIO::NetAccess::lastError
static int lastError()
Returns the error code for the last job, in case it failed.
Definition netaccess.h:489
TDEIO::NetAccess::download
static bool download(const KURL &src, TQString &target, TQWidget *window)
Downloads a file from an arbitrary URL (src) to a temporary file on the local filesystem (target).
Definition netaccess.cpp:57
TDEIO::NetAccess::exists
static bool exists(const KURL &url, bool source, TQWidget *window)
Tests whether a URL exists.
Definition netaccess.cpp:185
TDEIO::NetAccess::stat
static bool stat(const KURL &url, TDEIO::UDSEntry &entry, TQWidget *window)
Tests whether a URL exists and return information on it.
Definition netaccess.cpp:204
TDEIO::NetAccess::file_move
static bool file_move(const KURL &src, const KURL &target, int permissions=-1, bool overwrite=false, bool resume=false, TQWidget *window=0L)
Full-fledged equivalent of TDEIO::file_move.
Definition netaccess.cpp:131
TDEIO::NetAccess::synchronousRun
static bool synchronousRun(Job *job, TQWidget *window, TQByteArray *data=0, KURL *finalURL=0, TQMap< TQString, TQString > *metaData=0)
This function executes a job in a synchronous way.
Definition netaccess.cpp:279
TDEIO::NetAccess::upload
static bool upload(const TQString &src, const KURL &target, TQWidget *window)
Uploads file src to URL target.
Definition netaccess.cpp:94
TDEIO::NetAccess::copy
static bool copy(const KURL &src, const KURL &target, TQWidget *window)
Alternative to upload for copying over the network.
Definition netaccess.cpp:117
TDEIO::NetAccess::removeTempFile
static void removeTempFile(const TQString &name)
Removes the specified file if and only if it was created by TDEIO::NetAccess as a temporary file for ...
Definition netaccess.cpp:298
TDEIO::NetAccess::mostLocalURL
static KURL mostLocalURL(const KURL &url, TQWidget *window)
Tries to map a local URL for the given URL.
Definition netaccess.cpp:213
TDEIO::NetAccess::dircopy
static bool dircopy(const KURL &src, const KURL &target, TQWidget *window)
Alternative method for copying over the network.
Definition netaccess.cpp:144
TDEIO::NetAccess::lastErrorString
static TQString lastErrorString()
Returns the error string for the last job, in case it failed.
Definition netaccess.h:482
TDEIO::NetAccess::fish_execute
static TQString fish_execute(const KURL &url, const TQString command, TQWidget *window)
Executes a remote process via the fish ioslave in a synchronous way.
Definition netaccess.cpp:273
TDEIO::NetAccess::localURL
static KURL localURL(const KURL &url, TQWidget *window)
Returns the output of the localURL TDEIO job.
Definition netaccess.cpp:193
TDEIO::NetAccess::file_copy
static bool file_copy(const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, TQWidget *window=0L)
Full-fledged equivalent of TDEIO::file_copy.
Definition netaccess.cpp:122
TDEIO::NetAccess::mkdir
static bool mkdir(const KURL &url, TQWidget *window, int permissions=-1)
Creates a directory in a synchronous way.
Definition netaccess.cpp:267
TDEIO
A namespace for TDEIO globals.
Definition authinfo.h:29
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/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • 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.15.0
This website is maintained by Timothy Pearson.