• 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
copyjob.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright 2000 Stephan Kulow <coolo@kde.org>
4  Copyright 2000-2006 David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KIO_COPYJOB_H
23 #define KIO_COPYJOB_H
24 
25 #include <QtCore/QObject>
26 #include <QtCore/QStringList>
27 
28 #include <sys/types.h> // time_t
29 
30 #include <kurl.h>
31 
32 #include "jobclasses.h"
33 
34 class QTimer;
35 
36 namespace KIO {
37 
41  struct CopyInfo
42  {
43  KUrl uSource;
44  KUrl uDest;
45  QString linkDest; // for symlinks only
46  int permissions;
47  time_t ctime;
48  time_t mtime;
49  KIO::filesize_t size; // 0 for dirs
50  };
51 
52  class CopyJobPrivate;
65  class KIO_EXPORT CopyJob : public Job {
66 
67  Q_OBJECT
68 
69  public:
73  enum CopyMode { Copy, Move, Link };
74 
75  virtual ~CopyJob();
76 
81  CopyMode operationMode() const;
82 
87  KUrl::List srcUrls() const;
88 
93  KUrl destUrl() const;
94 
102  void setDefaultPermissions( bool b );
103 
111  void setAutoSkip(bool autoSkip);
112 
120  void setAutoRename(bool autoRename);
121 
128  void setWriteIntoExistingDirectories(bool overwriteAllDirs);
129 
133  virtual bool doSuspend();
134 
135  Q_SIGNALS:
136 
142  void totalFiles( KJob *job, unsigned long files );
148  void totalDirs( KJob *job, unsigned long dirs );
149 
157  void aboutToCreate( KIO::Job *job, const QList<KIO::CopyInfo> &files);
158 
164  void processedFiles( KIO::Job *job, unsigned long files );
170  void processedDirs( KIO::Job *job, unsigned long dirs );
171 
183  void copying( KIO::Job *job, const KUrl& src, const KUrl& dest );
195  void linking( KIO::Job *job, const QString& target, const KUrl& to );
207  void moving( KIO::Job *job, const KUrl& from, const KUrl& to );
216  void creatingDir( KIO::Job *job, const KUrl& dir );
224  void renamed( KIO::Job *job, const KUrl& from, const KUrl& to );
225 
241  void copyingDone( KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed );
251  void copyingLinkDone( KIO::Job *job, const KUrl &from, const QString& target, const KUrl& to );
252  protected Q_SLOTS:
253  virtual void slotResult( KJob *job );
254 
255  protected:
256  CopyJob(CopyJobPrivate &dd);
257  void emitResult();
258 
259  private:
260  Q_PRIVATE_SLOT(d_func(), void slotStart())
261  Q_PRIVATE_SLOT(d_func(), void slotEntries( KIO::Job*, const KIO::UDSEntryList& list ))
262  Q_PRIVATE_SLOT(d_func(), void slotSubError(KIO::ListJob*, KIO::ListJob*))
263  Q_PRIVATE_SLOT(d_func(), void slotProcessedSize( KJob*, qulonglong data_size ))
264  Q_PRIVATE_SLOT(d_func(), void slotTotalSize( KJob*, qulonglong size ))
265  Q_PRIVATE_SLOT(d_func(), void slotReport())
266  Q_PRIVATE_SLOT(d_func(), void sourceStated(const KIO::UDSEntry& entry, const KUrl& sourceUrl))
267 
268  Q_DECLARE_PRIVATE(CopyJob)
269  };
270 
288  KIO_EXPORT CopyJob *copy( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
289 
307  KIO_EXPORT CopyJob *copyAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
308 
320  KIO_EXPORT CopyJob *copy( const KUrl::List& src, const KUrl& dest, JobFlags flags = DefaultFlags );
321 
335  KIO_EXPORT CopyJob *move( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
349  KIO_EXPORT CopyJob *moveAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
362  KIO_EXPORT CopyJob *move( const KUrl::List& src, const KUrl& dest, JobFlags flags = DefaultFlags );
363 
374  KIO_EXPORT CopyJob *link( const KUrl& src, const KUrl& destDir, JobFlags flags = DefaultFlags );
375 
387  KIO_EXPORT CopyJob *link( const KUrl::List& src, const KUrl& destDir, JobFlags flags = DefaultFlags );
388 
402  KIO_EXPORT CopyJob *linkAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
403 
413  KIO_EXPORT CopyJob *trash( const KUrl& src, JobFlags flags = DefaultFlags );
414 
423  KIO_EXPORT CopyJob *trash( const KUrl::List& src, JobFlags flags = DefaultFlags );
424 
425 }
426 
427 #endif
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
kurl.h
KIO::CopyInfo::permissions
int permissions
Definition: copyjob.h:46
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:58
KIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:936
KIO::CopyInfo::uSource
KUrl uSource
Definition: copyjob.h:43
KIO::CopyInfo::linkDest
QString linkDest
Definition: copyjob.h:45
Copy
KIO::CopyInfo::mtime
time_t mtime
Definition: copyjob.h:48
KUrl
KIO::copyAs
CopyJob * copyAs(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Copy a file or directory src into the destination dest, which is the destination name in any case...
Definition: copyjob.cpp:2172
KIO::CopyJob::Move
Definition: copyjob.h:73
KIO::DefaultFlags
Show the progress info GUI, no Resume and no Overwrite.
Definition: jobclasses.h:46
QTimer
KIO::link
CopyJob * link(const KUrl &src, const KUrl &destDir, JobFlags flags=DefaultFlags)
Create a link.
Definition: copyjob.cpp:2214
QString
QList< KIO::CopyInfo >
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::moveAs
CopyJob * moveAs(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Moves a file or directory src to the given destination dest.
Definition: copyjob.cpp:2196
KUrl::List
KIO::CopyInfo::uDest
KUrl uDest
Definition: copyjob.h:44
KIO::CopyJob::CopyMode
CopyMode
Defines the mode of the operation.
Definition: copyjob.h:73
KIO::linkAs
CopyJob * linkAs(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Create a link.
Definition: copyjob.cpp:2226
KRecentDirs::dir
QString dir(const QString &fileClass)
Returns the most recently used directory accociated with this file-class.
Definition: krecentdirs.cpp:68
jobclasses.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
KIO::CopyInfo
Definition: copyjob.h:41
KIO::CopyInfo::ctime
time_t ctime
Definition: copyjob.h:47
Link
KJob
KIO::trash
CopyJob * trash(const KUrl &src, JobFlags flags=DefaultFlags)
Trash a file or directory.
Definition: copyjob.cpp:2233
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: copyjob.h:65
KRecentDirs::list
QStringList list(const QString &fileClass)
Returns a list of directories associated with this file-class.
Definition: krecentdirs.cpp:60
KIO::CopyInfo::size
KIO::filesize_t size
Definition: copyjob.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:52 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