• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
netaccess.h
Go to the documentation of this file.
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 KIO_NETACCESS_h
24 #define KIO_NETACCESS_h
25 
26 #include <QtCore/QObject>
27 #include <QtCore/QString>
28 #include <kio/global.h>
29 #include <kio/udsentry.h>
30 #include <kurl.h>
31 #include <kio/jobclasses.h> // for KIO::JobFlags
32 
33 class QStringList;
34 class QWidget;
35 
36 template<typename T, typename K> class QMap;
37 
38 class KJob;
39 namespace KIO {
40 
41  class Job;
42 
43  class NetAccessPrivate;
67 class KIO_EXPORT NetAccess : public QObject
68 {
69  Q_OBJECT
70 
71 public:
72  enum StatSide {
73  SourceSide,
74  DestinationSide
75  };
76 
141  static bool download(const KUrl& src, QString & target, QWidget* window);
142 
154  static void removeTempFile(const QString& name);
155 
174  static bool upload(const QString& src, const KUrl& target, QWidget* window);
175 
192  static bool file_copy( const KUrl& src, const KUrl& target, QWidget* window = 0 );
194 #ifndef KDE_NO_DEPRECATED
195  static KDE_DEPRECATED bool copy( const KUrl& src, const KUrl& target,
196  QWidget* window = 0 );
197 #endif
198 
219  static bool dircopy( const KUrl& src, const KUrl& target, QWidget* window ); // TODO deprecate in favor of KIO::copy + synchronousRun (or job->exec())
220 
224  static bool dircopy( const KUrl::List& src, const KUrl& target, QWidget* window = 0L ); // TODO deprecate in favor of KIO::copy + synchronousRun (or job->exec())
225 
231 #ifndef KDE_NO_DEPRECATED
232  static KDE_DEPRECATED bool move( const KUrl& src, const KUrl& target, QWidget* window = 0L );
233 #endif
234 
240 #ifndef KDE_NO_DEPRECATED
241  static KDE_DEPRECATED bool move( const KUrl::List& src, const KUrl& target, QWidget* window = 0L );
242 #endif
243 
261 #ifndef KDE_NO_DEPRECATED
262  static KDE_DEPRECATED bool exists(const KUrl& url, bool source, QWidget* window);
263 #endif
264 
279  static bool exists(const KUrl& url, StatSide statSide, QWidget* window);
280 
297  static bool stat(const KUrl& url, KIO::UDSEntry & entry, QWidget* window);
298 
299 
315  static KUrl mostLocalUrl(const KUrl& url, QWidget* window);
316 
331  static bool del( const KUrl & url, QWidget* window );
332 
348  static bool mkdir( const KUrl & url, QWidget* window, int permissions = -1 );
349 
368  static QString fish_execute( const KUrl & url, const QString &command, QWidget* window );
369 
402  static bool synchronousRun( Job* job, QWidget* window, QByteArray* data=0,
403  KUrl* finalURL=0, QMap<QString,QString>* metaData=0 );
404 
423  static QString mimetype( const KUrl & url, QWidget* window );
424 
425 
431  static QString lastErrorString();
432 
437  static int lastError();
438 
439 Q_SIGNALS:
440  void leaveModality();
441 private:
445  NetAccess();
446 
450  ~NetAccess();
451 
455  bool filecopyInternal(const KUrl& src, const KUrl& target, int permissions,
456  KIO::JobFlags flags, QWidget* window, bool move);
457  bool dircopyInternal(const KUrl::List& src, const KUrl& target,
458  QWidget* window, bool move);
459  bool statInternal(const KUrl & url, int details, StatSide side, QWidget* window = 0);
460 
461  bool delInternal(const KUrl & url, QWidget* window = 0);
462  bool mkdirInternal(const KUrl & url, int permissions, QWidget* window = 0);
463  QString fish_executeInternal(const KUrl & url, const QString &command, QWidget* window = 0);
464  bool synchronousRunInternal( Job* job, QWidget* window, QByteArray* data,
465  KUrl* finalURL, QMap<QString,QString>* metaData );
466 
467  QString mimetypeInternal(const KUrl & url, QWidget* window = 0);
468  void enter_loop();
469 
470  friend class I_like_this_class;
471 
472 private Q_SLOTS:
473  void slotResult( KJob * job );
474  void slotMimetype( KIO::Job * job, const QString & type );
475  void slotData( KIO::Job*, const QByteArray& );
476  void slotRedirection( KIO::Job*, const KUrl& );
477 
478 private:
479  NetAccessPrivate * const d;
480 };
481 
482 }
483 
484 #endif
KIO::NetAccess
Net Transparency.
Definition: netaccess.h:67
QWidget
kurl.h
QByteArray
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:58
KIO::mimetype
MimetypeJob * mimetype(const KUrl &url, JobFlags flags=DefaultFlags)
Find mimetype for one file or directory.
Definition: job.cpp:1856
QMap
Definition: netaccess.h:36
KIO::mkdir
SimpleJob * mkdir(const KUrl &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:697
KIO::stat
StatJob * stat(const KUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: job.cpp:924
KIO::mostLocalUrl
StatJob * mostLocalUrl(const KUrl &url, JobFlags flags=DefaultFlags)
Tries to map a local URL for the given URL, using a KIO job.
Definition: job.cpp:930
global.h
KUrl
KIO::file_copy
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Copy a single file.
Definition: job.cpp:2473
QObject
QString
QStringList
KIO::move
CopyJob * move(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Moves a file or directory src to the given destination dest.
Definition: copyjob.cpp:2186
KIO::NetAccess::StatSide
StatSide
Definition: netaccess.h:72
KIO::NetAccess::SourceSide
Definition: netaccess.h:73
KIO::del
DeleteJob * del(const KUrl &src, JobFlags flags=DefaultFlags)
Delete a file or directory.
Definition: deletejob.cpp:492
KUrl::List
jobclasses.h
udsentry.h
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::copy
CopyJob * copy(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Copy a file or directory src into the destination dest, which can be a file (including the final file...
Definition: copyjob.cpp:2164
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal