• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • 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 <QtCore/QObject>
00027 #include <QtCore/QString>
00028 #include <kio/global.h>
00029 #include <kio/udsentry.h>
00030 #include <kurl.h>
00031 #include <kio/jobclasses.h> // for KIO::JobFlags
00032 
00033 class QStringList;
00034 class QWidget;
00035 
00036 template<typename T, typename K> class QMap;
00037 
00038 class KJob;
00039 namespace KIO {
00040 
00041   class Job;
00042 
00043   class NetAccessPrivate;
00064 class KIO_EXPORT NetAccess : public QObject
00065 {
00066   Q_OBJECT
00067 
00068 public:
00069     enum StatSide {
00070         SourceSide,
00071         DestinationSide
00072     };
00073 
00138     static bool download(const KUrl& src, QString & target, QWidget* window);
00139 
00151     static void removeTempFile(const QString& name);
00152 
00171     static bool upload(const QString& src, const KUrl& target, QWidget* window);
00172 
00189     static bool file_copy( const KUrl& src, const KUrl& target, QWidget* window = 0 );
00191     static KDE_DEPRECATED bool copy( const KUrl& src, const KUrl& target,
00192                                      QWidget* window = 0 );
00193 
00214     static bool dircopy( const KUrl& src, const KUrl& target, QWidget* window ); // TODO deprecate in favor of KIO::copy + synchronousRun (or job->exec())
00215 
00219     static bool dircopy( const KUrl::List& src, const KUrl& target, QWidget* window = 0L ); // TODO deprecate in favor of KIO::copy + synchronousRun (or job->exec())
00220 
00226     static KDE_DEPRECATED bool move( const KUrl& src, const KUrl& target, QWidget* window = 0L );
00227 
00233     static KDE_DEPRECATED bool move( const KUrl::List& src, const KUrl& target, QWidget* window = 0L );
00234 
00250     static KDE_DEPRECATED bool exists(const KUrl& url, bool source, QWidget* window);
00251 
00266     static bool exists(const KUrl& url, StatSide statSide, QWidget* window);
00267 
00284     static bool stat(const KUrl& url, KIO::UDSEntry & entry, QWidget* window);
00285 
00286 
00302     static KUrl mostLocalUrl(const KUrl& url, QWidget* window);
00303 
00318     static bool del( const KUrl & url, QWidget* window );
00319 
00335     static bool mkdir( const KUrl & url, QWidget* window, int permissions = -1 );
00336 
00355     static QString fish_execute( const KUrl & url, const QString &command, QWidget* window );
00356 
00389     static bool synchronousRun( Job* job, QWidget* window, QByteArray* data=0,
00390                                 KUrl* finalURL=0, QMap<QString,QString>* metaData=0 );
00391 
00410     static QString mimetype( const KUrl & url, QWidget* window );
00411 
00412 
00418     static QString lastErrorString();
00419 
00424     static int lastError();
00425 
00426 Q_SIGNALS:
00427     void leaveModality();
00428 private:
00432     NetAccess();
00433 
00437     ~NetAccess();
00438 
00442     bool filecopyInternal(const KUrl& src, const KUrl& target, int permissions,
00443                           KIO::JobFlags flags, QWidget* window, bool move);
00444     bool dircopyInternal(const KUrl::List& src, const KUrl& target,
00445                          QWidget* window, bool move);
00446     bool statInternal(const KUrl & url, int details, StatSide side, QWidget* window = 0);
00447 
00448     bool delInternal(const KUrl & url, QWidget* window = 0);
00449     bool mkdirInternal(const KUrl & url, int permissions, QWidget* window = 0);
00450     QString fish_executeInternal(const KUrl & url, const QString &command, QWidget* window = 0);
00451     bool synchronousRunInternal( Job* job, QWidget* window, QByteArray* data,
00452                                  KUrl* finalURL, QMap<QString,QString>* metaData );
00453 
00454     QString mimetypeInternal(const KUrl & url, QWidget* window = 0);
00455     void enter_loop();
00456 
00457     friend class I_like_this_class;
00458 
00459 private Q_SLOTS:
00460     void slotResult( KJob * job );
00461     void slotMimetype( KIO::Job * job, const QString & type );
00462     void slotData( KIO::Job*, const QByteArray& );
00463     void slotRedirection( KIO::Job*, const KUrl& );
00464 
00465 private:
00466     NetAccessPrivate * const d;
00467 };
00468 
00469 }
00470 
00471 #endif

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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