kio Library API Documentation

netaccess.h

00001 /*  $Id: netaccess.h,v 1.59 2003/08/30 08:56:21 raabe Exp $
00002 
00003     This file is part of the KDE libraries
00004     Copyright (C) 1997 Torben Weis (weis@kde.org)
00005     Copyright (C) 1998 Matthias Ettrich (ettrich@kde.org)
00006     Copyright (C) 1999 David Faure (faure@kde.org)
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021     Boston, MA 02111-1307, USA.
00022 */
00023 
00024 #ifndef __kio_netaccess_h
00025 #define __kio_netaccess_h
00026 
00027 #include <qobject.h>
00028 #include <qstring.h>
00029 #include <kio/global.h>
00030 #include <kdemacros.h>
00031 
00032 class QStringList;
00033 class QWidget;
00034 class KURL;
00035 
00036 namespace KIO {
00037 
00038   class Job;
00039 
00060 class NetAccess : public QObject
00061 {
00062   Q_OBJECT
00063 
00064 public:
00110     static bool download(const KURL& src, QString & target, QWidget* window);
00111 
00115     static bool download(const KURL& src, QString & target) KDE_DEPRECATED;
00116 
00128     static void removeTempFile(const QString& name);
00129 
00148     static bool upload(const QString& src, const KURL& target, QWidget* window);
00149 
00153     static bool upload(const QString& src, const KURL& target) KDE_DEPRECATED;
00154 
00173     static bool copy( const KURL& src, const KURL& target, QWidget* window );
00174     // KDE4: rename to file_copy
00175 
00179     static bool copy( const KURL& src, const KURL& target ) KDE_DEPRECATED;
00180     // KDE4: merge with above
00181 
00185     static bool file_copy( const KURL& src, const KURL& dest, int permissions=-1,
00186                             bool overwrite=false, bool resume=false, QWidget* window = 0L );
00187 
00193     static bool file_move( const KURL& src, const KURL& target, int permissions=-1,
00194                            bool overwrite=false, bool resume=false, QWidget* window = 0L );
00195 
00196 
00216     static bool dircopy( const KURL& src, const KURL& target, QWidget* window );
00217 
00221     static bool dircopy( const KURL& src, const KURL& target ) KDE_DEPRECATED; // KDE4: merge
00222 
00226     static bool dircopy( const KURL::List& src, const KURL& target, QWidget* window = 0L );
00227 
00233     static bool move( const KURL& src, const KURL& target, QWidget* window = 0L );
00234 
00240     static bool move( const KURL::List& src, const KURL& target, QWidget* window = 0L );
00241 
00257     static bool exists(const KURL& url, bool source, QWidget* window);
00258 
00262     static bool exists(const KURL& url, QWidget* window) KDE_DEPRECATED;
00263 
00267     static bool exists(const KURL& url) KDE_DEPRECATED;
00268 
00272     static bool exists(const KURL& url, bool source) KDE_DEPRECATED; // KDE4: merge
00273 
00290     static bool stat(const KURL& url, KIO::UDSEntry & entry, QWidget* window);
00291 
00295     static bool stat(const KURL& url, KIO::UDSEntry & entry) KDE_DEPRECATED;
00296 
00311     static bool del( const KURL & url, QWidget* window );
00312 
00316     static bool del( const KURL & url ) KDE_DEPRECATED;
00317 
00332     static bool mkdir( const KURL & url, QWidget* window, int permissions = -1 );
00333 
00337     static bool mkdir( const KURL & url, int permissions = -1 ) KDE_DEPRECATED;
00338 
00357     static QString fish_execute( const KURL & url, const QString command, QWidget* window );
00358 
00381     static QString mimetype( const KURL & url, QWidget* window );
00382 
00386     static QString mimetype( const KURL & url ) KDE_DEPRECATED;
00387 
00392     static QString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : QString::null; }
00393 
00394 private:
00398     NetAccess() {}
00399 
00403     ~NetAccess() {}
00404 
00408     bool filecopyInternal(const KURL& src, const KURL& target, int permissions,
00409                           bool overwrite, bool resume, QWidget* window, bool move);
00410     bool dircopyInternal(const KURL::List& src, const KURL& target,
00411                          QWidget* window, bool move);
00412     bool statInternal(const KURL & url, int details, bool source, QWidget* window = 0);
00413     UDSEntry m_entry;
00414     bool delInternal(const KURL & url, QWidget* window = 0);
00415     bool mkdirInternal(const KURL & url, int permissions, QWidget* window = 0);
00416     QString fish_executeInternal(const KURL & url, const QString command, QWidget* window = 0);
00417 
00418     QString mimetypeInternal(const KURL & url, QWidget* window = 0);
00419     void enter_loop();
00420     QString m_mimetype;
00421 
00425     static QStringList* tmpfiles;
00426 
00427     static QString* lastErrorMsg;
00431     bool bJobOK;
00432     friend class I_like_this_class;
00433 
00434 private slots:
00435     void slotResult( KIO::Job * job );
00436     void slotMimetype( KIO::Job * job, const QString & type );
00437 private:
00438     class NetAccessPrivate* d;
00439 };
00440 
00441 }
00442 
00443 #endif
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:20:43 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003