kio Library API Documentation

netaccess.h

00001 /*  $Id: netaccess.h,v 1.45 2002/10/19 20:29:56 amantia 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 class QStringList;
00031 class KURL;
00032 
00033 namespace KIO {
00034 
00035   class Job;
00036 
00052 class NetAccess : public QObject
00053 {
00054   Q_OBJECT
00055 
00056 public:
00095     static bool download(const KURL& src, QString & target);
00096 
00108     static void removeTempFile(const QString& name);
00109 
00123     static bool upload(const QString& src, const KURL& target);
00124 
00132     static bool copy( const KURL& src, const KURL& target );
00133 
00141     static bool dircopy( const KURL& src, const KURL& target );
00142 
00151     static bool exists(const KURL& url);
00152 
00165     static bool exists(const KURL& url, bool source);
00166 
00177     static bool stat(const KURL& url, KIO::UDSEntry & entry);
00178 
00188     static bool del( const KURL & url );
00189 
00199     static bool mkdir( const KURL & url, int permissions = -1 );
00200 
00201 
00215     static QString mimetype( const KURL & url );
00216 
00220     static QString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : QString::null; }
00221 
00222 private:
00226     NetAccess() {}
00230     ~NetAccess() {}
00234     bool copyInternal(const KURL& src, const KURL& target, bool overwrite);
00235     bool dircopyInternal(const KURL& src, const KURL& target);
00236     bool statInternal(const KURL & url, int details, bool source);
00237     UDSEntry m_entry;
00238     bool delInternal(const KURL & url);
00239     bool mkdirInternal(const KURL & url, int permissions);
00240     QString mimetypeInternal(const KURL & url);
00241     void enter_loop();
00242     QString m_mimetype;
00246     static QStringList* tmpfiles;
00247 
00248     static QString* lastErrorMsg;
00252     bool bJobOK;
00253     friend class I_like_this_class;
00254 
00255 private slots:
00256     void slotResult( KIO::Job * job );
00257     void slotMimetype( KIO::Job * job, const QString & type );
00258 private:
00259     class NetAccessPrivate* d;
00260 };
00261 
00262 };
00263 
00264 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:32 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001