• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

netaccess.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE libraries
00003     Copyright (C) 1997 Torben Weis (weis@kde.org)
00004     Copyright (C) 1998 Matthias Ettrich (ettrich@kde.org)
00005     Copyright (C) 1999-2004 David Faure (faure@kde.org)
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef __kio_netaccess_h
00024 #define __kio_netaccess_h
00025 
00026 #include <qobject.h>
00027 #include <qstring.h>
00028 #include <kio/global.h>
00029 
00030 class QStringList;
00031 class QWidget;
00032 class KURL;
00033 template<typename T, typename K> class QMap;
00034 
00035 namespace KIO {
00036 
00037   class Job;
00038 
00059 class KIO_EXPORT NetAccess : public QObject
00060 {
00061   Q_OBJECT
00062 
00063 public:
00117     static bool download(const KURL& src, QString & target, QWidget* window);
00118 
00122     static bool download(const KURL& src, QString & target) KDE_DEPRECATED;
00123 
00135     static void removeTempFile(const QString& name);
00136 
00156     static bool upload(const QString& src, const KURL& target, QWidget* window);
00157 
00161     static bool upload(const QString& src, const KURL& target) KDE_DEPRECATED;
00162 
00181     static bool copy( const KURL& src, const KURL& target, QWidget* window );
00182     // KDE4: rename to file_copy
00183 
00187     static bool copy( const KURL& src, const KURL& target ) KDE_DEPRECATED;
00188     // KDE4: merge with above
00189 
00193     static bool file_copy( const KURL& src, const KURL& dest, int permissions=-1,
00194                             bool overwrite=false, bool resume=false, QWidget* window = 0L );
00195 
00201     static bool file_move( const KURL& src, const KURL& target, int permissions=-1,
00202                            bool overwrite=false, bool resume=false, QWidget* window = 0L );
00203 
00204 
00224     static bool dircopy( const KURL& src, const KURL& target, QWidget* window );
00225 
00229     static bool dircopy( const KURL& src, const KURL& target ) KDE_DEPRECATED; // KDE4: merge
00230 
00234     static bool dircopy( const KURL::List& src, const KURL& target, QWidget* window = 0L );
00235 
00241     static bool move( const KURL& src, const KURL& target, QWidget* window = 0L );
00242 
00248     static bool move( const KURL::List& src, const KURL& target, QWidget* window = 0L );
00249 
00266     static bool exists(const KURL& url, bool source, QWidget* window);
00267 
00272     static bool exists(const KURL& url, QWidget* window) KDE_DEPRECATED;
00273 
00277     static bool exists(const KURL& url) KDE_DEPRECATED;
00278 
00282     static bool exists(const KURL& url, bool source) KDE_DEPRECATED; // KDE4: merge
00283 
00300     static bool stat(const KURL& url, KIO::UDSEntry & entry, QWidget* window);
00301 
00305     static bool stat(const KURL& url, KIO::UDSEntry & entry) KDE_DEPRECATED;
00306 
00323     static KURL mostLocalURL(const KURL& url, QWidget* window);
00324 
00339     static bool del( const KURL & url, QWidget* window );
00340 
00347     static bool del( const KURL & url ) KDE_DEPRECATED;
00348 
00364     static bool mkdir( const KURL & url, QWidget* window, int permissions = -1 );
00365 
00372     static bool mkdir( const KURL & url, int permissions = -1 ) KDE_DEPRECATED;
00373 
00392     static QString fish_execute( const KURL & url, const QString command, QWidget* window );
00393 
00428     static bool synchronousRun( Job* job, QWidget* window, QByteArray* data=0,
00429                                 KURL* finalURL=0, QMap<QString,QString>* metaData=0 );
00430 
00453     static QString mimetype( const KURL & url, QWidget* window );
00454 
00461     static QString mimetype( const KURL & url ) KDE_DEPRECATED;
00462 
00468     static QString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : QString::null; }
00469 
00475     static int lastError() { return lastErrorCode; }
00476 
00477 private:
00481     NetAccess() : m_metaData(0), d(0) {}
00482 
00486     ~NetAccess() {}
00487 
00491     bool filecopyInternal(const KURL& src, const KURL& target, int permissions,
00492                           bool overwrite, bool resume, QWidget* window, bool move);
00493     bool dircopyInternal(const KURL::List& src, const KURL& target,
00494                          QWidget* window, bool move);
00495     bool statInternal(const KURL & url, int details, bool source, QWidget* window = 0);
00496 
00497     bool delInternal(const KURL & url, QWidget* window = 0);
00498     bool mkdirInternal(const KURL & url, int permissions, QWidget* window = 0);
00499     QString fish_executeInternal(const KURL & url, const QString command, QWidget* window = 0);
00500     bool synchronousRunInternal( Job* job, QWidget* window, QByteArray* data,
00501                                  KURL* finalURL, QMap<QString,QString>* metaData );
00502 
00503     QString mimetypeInternal(const KURL & url, QWidget* window = 0);
00504     void enter_loop();
00505 
00509     static QStringList* tmpfiles;
00510 
00511     static QString* lastErrorMsg;
00512     static int lastErrorCode;
00513 
00514     friend class I_like_this_class;
00515 
00516 private slots:
00517     void slotResult( KIO::Job * job );
00518     void slotMimetype( KIO::Job * job, const QString & type );
00519     void slotData( KIO::Job*, const QByteArray& );
00520     void slotRedirection( KIO::Job*, const KURL& );
00521 
00522 private:
00523     UDSEntry m_entry;
00524     QString m_mimetype;
00525     QByteArray m_data;
00526     KURL m_url;
00527     QMap<QString, QString> *m_metaData;
00528 
00532     bool bJobOK;
00533 
00534 private:
00535     class NetAccessPrivate* d; // not really needed, the ctor is private already.
00536 };
00537 
00538 }
00539 
00540 #endif

kio

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal