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

KIO

  • 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
33class QStringList;
34class QWidget;
35
36template<typename T, typename K> class QMap;
37
38class KJob;
39namespace KIO {
40
41 class Job;
42
43 class NetAccessPrivate;
67class KIO_EXPORT NetAccess : public QObject
68{
69 Q_OBJECT
70
71public:
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
439Q_SIGNALS:
440 void leaveModality();
441private:
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
472private 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
478private:
479 NetAccessPrivate * const d;
480};
481
482}
483
484#endif
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::NetAccess
Net Transparency.
Definition: netaccess.h:68
KIO::NetAccess::StatSide
StatSide
Definition: netaccess.h:72
KIO::NetAccess::SourceSide
@ SourceSide
Definition: netaccess.h:73
KIO::NetAccess::leaveModality
void leaveModality()
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:59
KJob
KUrl::List
KUrl
QMap
QObject
QWidget
global.h
jobclasses.h
kurl.h
mkdir
int mkdir(const QString &pathname, mode_t)
stat
int stat(const QString &path, KDE_struct_stat *buf)
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
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
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::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
KIO::mimetype
MimetypeJob * mimetype(const KUrl &url, JobFlags flags=DefaultFlags)
Find mimetype for one file or directory.
Definition: job.cpp:1856
copy
KAction * copy(const QObject *recvr, const char *slot, QObject *parent)
del
KGuiItem del()
udsentry.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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